Could not load the default credentials Google Cloud / Firebase Origin: Platform & cloud OSI layer 7 · Application Last updated 15 Oct 2026

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.

Exact message you may see Could not load the default credentialsYour default credentials were not found
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

  1. gcloud auth application-default login (local)
  2. Use workload identity federation in CI
  3. On GCP, attach a service account with the needed roles

Detailed fix by platform

Shell

  1. bash
    gcloud auth application-default login
    export GOOGLE_APPLICATION_CREDENTIALS=/secrets/sa.json   # only if you must use a key

How to diagnose

  1. Environment — Local, GCP or other?
  2. Variable — GOOGLE_APPLICATION_CREDENTIALS
  3. 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:

Where this error sits

Origin: Platform & cloud. Errors that are often confused with or caused by this one (click to open):

401 — HTTP 401 Unauthorized (HTTP)401AADSTS50076 — Azure AD (Entra ID): AADSTS50076 / AADSTS50079 — multi-factor authentication required (Azure)AADSTS50076AADSTS50126 — AADSTS50126: Error validating credentials due to invalid username or password (Azure)AADSTS50126AADSTS700016 — Azure AD (Entra ID): AADSTS700016 Application not found in the directory (Azure)AADSTS700016auth/invalid-credential — Firebase Auth: auth/invalid-credential (auth/wrong-password, auth/user-not-found, auth/invalid-login-credentials) (Authentication)auth/invalid-credenti…Authentication failed — fatal: Authentication failed for 'https://github.com/x/y.git/' (Git)Authentication failedAuthentication token manipulation error — passwd: Authentication token manipulation error (Linux)Authentication token …AuthenticationFailed — Azure Storage: Server failed to authenticate the request. Make sure the value of Authorization header is formed correctly including the signature (AuthenticationFailed) (Azure)AuthenticationFailedCould not…

Explore the map of this error Full error map →

🧠 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.

💬 What worked for others

No tips yet — did something else fix this for you?

Share what worked for you

Tips are checked by an editor before they appear. Links are removed.