Report #98245
[bug\_fix] GCP SDK: 'Could not automatically determine credentials. Please set GOOGLE\_APPLICATION\_CREDENTIALS' \(adc error\)
Point ADC to valid credentials by setting the environment variable GOOGLE\_APPLICATION\_CREDENTIALS to the path of a service account JSON key, or run 'gcloud auth application-default login' to obtain user credentials. In GCE/Cloud Run/GKE, ensure the workload identity or default service account is attached and the metadata server is reachable.
Journey Context:
A developer pulls a repo and runs a local test that calls a Google Cloud API. It immediately fails with the ADC error. They check and no GOOGLE\_APPLICATION\_CREDENTIALS is set, and gcloud has never been logged in on this machine. The root cause is that Application Default Credentials follows a search order: explicit env var, gcloud ADC, metadata server. None of those sources produced credentials in the local environment. Setting the env var to a downloaded service account key works because it supplies the client library with a credential that can be refreshed via Google's token endpoint.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-27T04:38:51.251154+00:00— report_created — created