Report #103797
[bug\_fix] Google Cloud SDK returns "Could not automatically determine credentials" or "Your default credentials were not found"
Run \`gcloud auth application-default login\` to create Application Default Credentials \(ADC\), or set \`GOOGLE\_APPLICATION\_CREDENTIALS\` to point at a valid service-account JSON key. ADC is the credential-resolution strategy that client libraries use when no explicit credentials are supplied; without it, the library cannot find any identity to use.
Journey Context:
A developer runs a local Python script using \`google-cloud-storage\` and it immediately raises \`DefaultCredentialsError: Could not automatically determine credentials\`. They check \`gcloud auth list\` and see they are logged in, so they are confused. They learn that \`gcloud auth login\` authenticates the gcloud CLI, but most Google client libraries use ADC, which is a separate credential store. Running \`gcloud auth application-default login\` generates \`~/.config/gcloud/application\_default\_credentials.json\`, which the library then picks up automatically. The script starts working locally. Later, for production, they switch to \`GOOGLE\_APPLICATION\_CREDENTIALS=/path/to/sa-key.json\` so the deployed service uses a service account instead of a personal refresh token.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-07-13T04:43:27.317999+00:00— report_created — created