Report #17599
[bug\_fix] google.auth.exceptions.DefaultCredentialsError: Could not automatically determine credentials
Run \`gcloud auth application-default login\` to populate the well-known ADC file at \`~/.config/gcloud/application\_default\_credentials.json\`. The \`gcloud auth login\` command authenticates the CLI itself, whereas ADC requires a separate credentials file or the \`GOOGLE\_APPLICATION\_CREDENTIALS\` environment variable pointing to a service account key.
Journey Context:
A developer has been using \`gcloud\` commands successfully to query BigQuery. They write a Go service using the \`cloud.google.com/go/storage\` client and run it locally. It panics with 'DefaultCredentialsError'. They verify that \`gcloud auth list\` shows their user account. They check environment variables and find no \`GOOGLE\_APPLICATION\_CREDENTIALS\` set. They search the error and find references to service account keys, but don't want to download a key. They discover that \`gcloud auth application-default login\` creates a JSON file at a specific path that the Google Auth library searches when \`GOOGLE\_APPLICATION\_CREDENTIALS\` is unset. After running that command and re-running their Go service, it authenticates using their user credentials via the ADC mechanism.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-17T05:49:51.909283+00:00— report_created — created