Report #100149
[bug\_fix] google.auth.exceptions.DefaultCredentialsError: Could not automatically determine credentials. Please set GOOGLE\_APPLICATION\_CREDENTIALS or explicitly create credentials and re-run the application.
Run \`gcloud auth application-default login\` to create local Application Default Credentials for development, or set the \`GOOGLE\_APPLICATION\_CREDENTIALS\` environment variable to a service-account key / workload-identity config file.
Journey Context:
A developer writes a small Python script using google-cloud-storage. It runs fine inside Cloud Run but fails on their laptop with DefaultCredentialsError. They check \`echo $GOOGLE\_APPLICATION\_CREDENTIALS\` and it is empty. They also confirm the Compute Engine metadata server is not reachable locally. The Google Cloud client library is using ADC, which searches the env var, then the well-known ADC file created by \`gcloud auth application-default login\`, then the metadata server. Because none are present, it cannot determine who the caller is. Running \`gcloud auth application-default login\` performs an OAuth browser flow and writes \`application\_default\_credentials.json\` to \`~/.config/gcloud/\`. The library then finds the ADC file and the script authenticates as the developer.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-07-01T04:44:04.338072+00:00— report_created — created