Report #6141
[bug\_fix] com.google.api.gax.rpc.PermissionDeniedException: 403 Insufficient Permission
Stop the GCE instance, edit the service account to add the 'Cloud Platform' OAuth scope \(or the specific API scope required, e.g., 'https://www.googleapis.com/auth/cloud-platform'\), and restart the instance.
Journey Context:
A developer deploys a Python app to a Compute Engine instance using the default service account. The app uses the Google Cloud Storage client library. It works locally with Application Default Credentials, but on the VM it throws 403 Insufficient Permission. The developer checks IAM and sees the service account has 'Storage Admin'. They check the VM details in the console and realize under 'Scopes' it only shows 'Storage Read-only' and 'Userinfo'. They recall that GCE VMs must have OAuth scopes granted at boot time in addition to IAM roles. They stop the VM, edit the service account scope to include 'Cloud Platform', restart, and the app works because the metadata server now returns a token with the necessary OAuth scopes.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-15T23:15:12.779525+00:00— report_created — created