Google Cloud: Error: Could not load the default credentials. Browse to https://cloud.google.com/docs/authentication/getting-started
The Google client library found no Application Default Credentials (ADC) on this machine or environment.
Seen on:
Google Cloud
Meaning
Locally you need gcloud auth application-default login (or GOOGLE_APPLICATION_CREDENTIALS pointing to a key file). On Google Cloud the attached service account is used automatically — outside GCP (other hosts, CI) you must provide credentials (workload identity federation preferred).
Common causes
- Local machine without gcloud ADC login
- GOOGLE_APPLICATION_CREDENTIALS unset or pointing to a missing file
- Running outside GCP without credentials
- Container missing the mounted key/metadata access
⚡ Quick fix
- gcloud auth application-default login (local)
- Use workload identity federation in CI
- On GCP, attach a service account with the needed roles
Detailed fix by platform
Shell
- bash
gcloud auth application-default login export GOOGLE_APPLICATION_CREDENTIALS=/secrets/sa.json # only if you must use a key
How to diagnose
- Environment — Local, GCP or other?
- Variable — GOOGLE_APPLICATION_CREDENTIALS
- Identity — gcloud auth list
🔧 Still not fixed?
Many errors look alike. If the steps above didn’t solve it, one of these is probably what you’re facing:
Similar errors
Other ways to find it
🧠 Still stuck? Analyze your error
Paste the full message, response headers or stack trace — we'll detect the platform and point to the most likely cause.
Was this page helpful?
Report a correction or suggest an improvement
Last updated 7 Oct 2026