Report #77319
[bug\_fix] GCP PermissionDenied 403 despite IAM policy showing correct role binding
Wait 60 seconds for IAM propagation or explicitly poll for consistency, then retry. If using a custom role, ensure the role definition itself includes the required permission \(e.g., \`storage.objects.create\`\). Root cause: GCP IAM is eventually consistent; role bindings can take up to a minute to propagate globally, and the client library may cache the token without the new scope.
Journey Context:
A developer deploys a Cloud Function using a specific service account. The function fails with \`google.api\_core.exceptions.PermissionDenied: 403 The caller does not have permission\` when trying to write to a Pub/Sub topic. The developer checks the IAM page in the console: the service account has 'Pub/Sub Publisher' role. They verify the email address matches exactly. They try redeploying the function three times with the same error. Suspecting a bug, they open Cloud Audit Logs, filter for the service account, and see the \`pubsub.topics.publish\` check returning \`PERMISSION\_DENIED\` with a \`delta\` showing the role is not yet visible. They wait one minute, run the function again, and it succeeds without any code changes.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-21T12:22:36.656223+00:00— report_created — created