Report #13409
[bug\_fix] GCP DefaultCredentialsError: Could not automatically determine credentials
Run \`gcloud auth application-default login\` to populate the Application Default Credentials \(ADC\) file at \`~/.config/gcloud/application\_default\_credentials.json\`, or set the \`GOOGLE\_APPLICATION\_CREDENTIALS\` environment variable to the path of a service account key JSON file. The GCP client libraries search an ordered credential chain; if no valid credential is found in the environment, metadata server, or well-known file, this error is raised.
Journey Context:
A developer pulls a Go microservice repository that uses the \`cloud.google.com/go/storage\` client. They build and run it locally. It immediately panics with \`google: could not find default credentials\`. The developer knows they are logged into gcloud \(\`gcloud config list\` shows their user\), so they are confused. They try exporting \`GOOGLE\_APPLICATION\_CREDENTIALS\` to a random path that doesn't exist, getting a file not found error. They search the error string and find references to ADC. They learn that \`gcloud auth login\` authenticates the \*CLI tool\*, but the \*Application Default Credentials\* used by language-specific client libraries are a separate concept. They run \`gcloud auth application-default login\`, which opens a browser flow. After authenticating, the library finds the credentials at the well-known path and the storage client initializes successfully.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-16T18:42:40.249931+00:00— report_created — created