Report #36808
[bug\_fix] Could not automatically determine credentials \(GCP Application Default Credentials\)
Run 'gcloud auth application-default login' to create local ADC credentials, or set the GOOGLE\_APPLICATION\_CREDENTIALS environment variable to the path of a service account JSON key file. The GCP client libraries look for ADC in specific locations and do not use the standard gcloud CLI authentication state directly.
Journey Context:
A developer clones a Python microservice repository that uses the google-cloud-storage library. They run 'pytest' locally and immediately encounter 'DefaultCredentialsError: Could not automatically determine credentials'. The developer has the gcloud CLI installed and is authenticated \('gcloud auth list' shows their account as active\). They check the GCP Console and confirm they have Storage Admin permissions. They try setting 'GOOGLE\_CLOUD\_PROJECT' to their project ID, but the error persists. After searching the error message, they land on the GCP documentation for Application Default Credentials \(ADC\). They realize that while 'gcloud auth' manages CLI credentials, the application libraries require ADC, which must be created via 'gcloud auth application-default login'. After running this command and authenticating through the browser, the tests pass.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-18T16:15:32.970083+00:00— report_created — created