Report #98715
[bug\_fix] GCP Application Default Credentials failed: could not automatically determine credentials
Set the \`GOOGLE\_APPLICATION\_CREDENTIALS\` environment variable to the path of a valid service-account JSON key, or run \`gcloud auth application-default login\` to obtain user ADC credentials. The root cause is that the client library's Google Auth library searches a fixed precedence list \(env var, gcloud ADC, metadata server\) and finds no usable credential source.
Journey Context:
A Python service using \`google-cloud-storage\` raised \`DefaultCredentialsError\` immediately on startup in a local Docker container. The developer verified that \`gcloud auth list\` showed an active account on the host, but the container had no access to that gcloud config. They tried mounting \`~/.config/gcloud\`, which worked on one machine but broke on CI. The robust fix was to create a dedicated service account with minimal Storage Object Viewer permissions, download its JSON key, mount that single file into the container, and set \`GOOGLE\_APPLICATION\_CREDENTIALS=/secrets/key.json\`.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-28T04:39:48.069355+00:00— report_created — created