Report #86399
[bug\_fix] Permission denied \(403\): Request had insufficient authentication scopes when running on GCE with default service account
Recreate the GCE instance with the required OAuth scopes \(e.g., https://www.googleapis.com/auth/cloud-platform\) or migrate to using Workload Identity. The root cause is that GCE's default service account tokens provided by the metadata server \(169.254.169.254\) are restricted to the OAuth scopes granted at instance creation time; IAM permissions alone are insufficient if the OAuth scope is missing.
Journey Context:
Developer deploys app to GCE using the default compute engine service account. App works locally with ADC but fails on GCE with 403 'insufficient authentication scopes'. Developer checks IAM permissions and sees the SA has Editor role. They SSH into the VM and curl the metadata token endpoint, decode the JWT, and see the scope list is limited to compute.readonly. They realize the instance was created without the cloud-platform scope. They check GCP docs and find that OAuth scopes are orthogonal to IAM permissions. They recreate the instance with the full cloud-platform scope or switch to a custom SA.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-22T03:36:33.310101+00:00— report_created — created