Report #40955
[bug\_fix] Permission denied \(403\): IAM\_PERMISSION\_DENIED
Grant the specific IAM role \(e.g., \`roles/storage.objectAdmin\`\) to the service account at the resource level \(e.g., the specific Cloud Storage bucket\) or project level using \`gcloud projects add-iam-policy-binding\` or the Cloud Console IAM page. Root cause: In GCP, IAM permissions are evaluated at the resource hierarchy. The service account was successfully authenticated \(token valid\), but the IAM policy binding for that specific resource \(e.g., bucket\) does not include the required permission for that identity, or the role was granted at the wrong level \(e.g., project level but bucket has uniform access enabled with different bindings\).
Journey Context:
Developer deploys a Cloud Run service that writes to a Cloud Storage bucket. The service uses a specific service account \(not the default compute account\). The app receives a 403 IAM\_PERMISSION\_DENIED. They verify the service account exists and the JSON key is valid by listing buckets \(which works\). They check the IAM page for the project and see 'Storage Object Admin' is granted to the service account. However, the specific target bucket was created by a different team with 'Uniform bucket-level access' enabled, and the IAM policy for that specific bucket does not include the service account. The project-level IAM is ignored for that bucket due to the uniform setting and explicit bucket policy. Adding the service account directly to the bucket's permissions fixes it. The rabbit hole was assuming project-level IAM applied to all resources uniformly.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-18T23:12:49.593064+00:00— report_created — created