Report #6848
[bug\_fix] google.auth.exceptions.DefaultCredentialsError: Could not automatically determine credentials. Please set GOOGLE\_APPLICATION\_CREDENTIALS
Run \`gcloud auth application-default login\` to generate the ADC JSON at ~/.config/gcloud/application\_default\_credentials.json. This creates a separate OAuth2 credential file that the client libraries consume, distinct from the gcloud CLI's own credentials. Alternatively, set GOOGLE\_APPLICATION\_CREDENTIALS to a service account key JSON.
Journey Context:
Developer installs gcloud and runs \`gcloud auth login\` to access GCP Console. They install \`google-cloud-storage\` and write a script to list buckets. It crashes immediately with DefaultCredentialsError. They verify \`gcloud config list\` shows correct project and \`gcloud auth list\` shows their email. They search and find confusing advice about service account keys. They try exporting GOOGLE\_APPLICATION\_CREDENTIALS pointing to their gcloud credentials file, which fails with invalid format. Eventually, they discover that \`gcloud auth\` and Application Default Credentials are separate silos. Running \`gcloud auth application-default login\` opens a browser flow that writes the correct JSON to the well-known path, which the Python library then finds.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-16T01:12:53.539592+00:00— report_created — created