Report #3608
[bug\_fix] google.auth.exceptions.DefaultCredentialsError: Could not automatically determine credentials
Run \`gcloud auth application-default login\` to create local ADC credentials in \`~/.config/gcloud/application\_default\_credentials.json\`, or set \`export GOOGLE\_APPLICATION\_CREDENTIALS="/path/to/service-account.json"\` pointing to a valid service account key. For GCE/Cloud Run, ensure the instance has a service account attached.
Journey Context:
Developer clones a repo using \`google-cloud-storage\` and runs it locally. It immediately throws DefaultCredentialsError. They check \`gcloud auth list\` and see they are logged in with their user account. They search the error and learn that \`gcloud auth login\` is distinct from Application Default Credentials \(ADC\). They run \`gcloud auth application-default login\`, complete the browser OAuth flow, and the library finds the credentials in \`~/.config/gcloud/application\_default\_credentials.json\`. The script works. Later, they move to CI/CD and switch to \`GOOGLE\_APPLICATION\_CREDENTIALS\` pointing to a service account key to avoid interactive login.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-15T17:38:18.091819+00:00— report_created — created