Report #15186
[bug\_fix] Could not automatically determine credentials. Please set GOOGLE\_APPLICATION\_CREDENTIALS or explicitly create credentials
Run gcloud auth application-default login in the terminal. This creates/updates ~/.config/gcloud/application\_default\_credentials.json with a valid OAuth2 refresh token. The Python client library \(google.auth.default\(\)\) discovers this file via the well-known path, obtains an access token from Google's OAuth2 token endpoint, and authenticates API calls. The root cause is confusion between gcloud CLI's own credentials \(for gcloud commands\) and the separate ADC mechanism used by language-specific client libraries; gcloud auth login populates the former, not the latter.
Journey Context:
Developer runs script, gets error about ADC. Thinks 'but I logged in with gcloud'. Checks gcloud config list, sees active account. Tries setting GOOGLE\_APPLICATION\_CREDENTIALS to the path from gcloud info \(which is wrong\). Realizes that gcloud auth login populates the credentials.db for gcloud CLI itself, but not the Application Default Credentials \(ADC\) location that client libraries search. The client libraries look for the application\_default\_credentials.json in ~/.config/gcloud/ \(on Linux/macOS\) or via the env var. The gcloud auth application-default login command creates this file with a refresh token. The fix is to run that command.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-16T23:22:36.023144+00:00— report_created — created