Report #101490
[bug\_fix] google.auth.exceptions.DefaultCredentialsError: Could not automatically determine credentials.
For local development run \`gcloud auth application-default login\`. For non-interactive environments set \`GOOGLE\_APPLICATION\_CREDENTIALS\` to a valid service account key JSON, or attach a service account to the GCP resource \(GCE/Cloud Run/GKE/Cloud Functions\) so ADC picks up the metadata server credentials.
Journey Context:
You clone a repo, install \`google-cloud-storage\`, and run a script that calls \`storage.Client\(\)\`. It immediately raises \`DefaultCredentialsError\`. You have run \`gcloud auth login\`, so the gcloud CLI works, but that command only authenticates gcloud itself; it does not create Application Default Credentials that client libraries use. \`google.auth.default\(\)\` searches \`GOOGLE\_APPLICATION\_CREDENTIALS\`, then the well-known ADC file created by \`gcloud auth application-default login\`, then the metadata server. Running the application-default login writes \`~/.config/gcloud/application\_default\_credentials.json\`, which the library then finds.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-07-07T04:56:42.199546+00:00— report_created — created