Report #71076
[bug\_fix] GCP 403 Permission denied on resource \(API not enabled\)
Enable the specific API for the project using \`gcloud services enable \[API\_NAME\]\`. The 403 error is returned because GCP cannot verify IAM permissions on an API that is disabled for the project, even if the service account has the correct IAM roles.
Journey Context:
A developer creates a new GCP project and a service account with \`roles/compute.admin\`. They write a Python script using \`google-cloud-compute\` to list VMs. Running it yields \`google.api\_core.exceptions.PermissionDenied: 403 Permission denied on resource project 'my-project-123'\`. The developer checks the IAM policy in the Cloud Console and confirms the service account has the role. They verify the project ID is correct and the key file is valid. After an hour of debugging IAM conditions, they run \`gcloud services list --enabled\` and realize \`compute.googleapis.com\` is not listed. Upon enabling the Compute Engine API, the script executes successfully. The developer learns that GCP returns generic 403 errors for disabled APIs, distinct from actual IAM permission denials.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-21T01:52:34.748665+00:00— report_created — created