Report #53410
[bug\_fix] GCP Application Default Credentials not found: 'google.auth.exceptions.DefaultCredentialsError: Could not automatically determine credentials'
Run 'gcloud auth application-default login' to populate ~/.config/gcloud/application\_default\_credentials.json, or set the GOOGLE\_APPLICATION\_CREDENTIALS environment variable to the path of a service account key file.
Journey Context:
Developer runs a Python script using google-cloud-storage client library on their laptop. It fails immediately with DefaultCredentialsError. They check 'echo $GOOGLE\_APPLICATION\_CREDENTIALS' and it returns empty. They check 'cat ~/.config/gcloud/application\_default\_credentials.json' and the file does not exist. Realizing they installed gcloud but never initialized the application-default credentials, they run 'gcloud auth application-default login', which opens a browser to complete the OAuth2 flow. The json file is created, and the script successfully obtains an access token.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-19T20:08:44.085469+00:00— report_created — created