Docker Error Guide: 'error getting credentials - err: exit status 1' — Fix Credential Helpers
Fix Docker 'error getting credentials err exit status 1 out': repair a broken credsStore helper, install docker-credential binaries, and clear corrupt entries in config.json.
- #docker
- #troubleshooting
- #errors
- #credentials
Stuck on this Docker with AI error? Get the free incident triage checklist
A one-page PDF — the exact steps to isolate, fix, and verify a production error like this one. No spam, unsubscribe anytime.
Overview
Docker fails before it even contacts a registry when it cannot retrieve stored credentials from its configured credential helper:
error getting credentials - err: exit status 1, out: ''
This is a client-side failure. The Docker CLI reads ~/.docker/config.json, sees a credsStore or credHelpers entry, and tries to run an external docker-credential-<name> binary to fetch the login. When that helper is missing, not on PATH, or errors out (often because there is no desktop keychain/secret service available), you get this message — with an empty out: '' because the helper produced nothing.
Symptoms
- Every
docker pull,push, orloginfails instantly witherror getting credentials - err: exit status 1, out: ''. - It started after installing Docker Desktop,
pass, or a keychain integration. - It happens in CI or over SSH where no graphical keyring/secret service is running.
docker loginitself fails the same way, so you cannot even re-authenticate.
Common Root Causes
- Missing credential helper binary —
config.jsonnames acredsStore(e.g.desktop,secretservice,pass) whosedocker-credential-*binary is not installed or not onPATH. - Helper backend unavailable —
secretservicewith no D-Bus/keyring running (headless server), orpasswith no initialized GPG store. - Corrupt
config.json— malformed JSON or stale entries the helper chokes on. - PATH not set for non-interactive shells — CI/cron runs where the helper exists but is not on the reduced
PATH. - Wrong
credsStorename after copying a config between machines (e.g.desktopon a server without Docker Desktop).
Diagnostic Workflow
Read the config to find which helper Docker is trying to invoke:
cat ~/.docker/config.json
# look for "credsStore": "..." and/or "credHelpers": { ... }
Check whether the corresponding binary actually exists on PATH:
credsStore=$(grep -o '"credsStore" *: *"[^"]*"' ~/.docker/config.json | cut -d'"' -f4)
echo "helper: docker-credential-$credsStore"
which docker-credential-$credsStore
If which finds nothing, that is the problem. Test the helper directly to see the real error it emits:
echo "https://registry.example.com" | docker-credential-$credsStore get
Confirm the config is valid JSON:
python3 -m json.tool ~/.docker/config.json >/dev/null && echo "valid JSON"
Example Root Cause Analysis
After a laptop’s ~/.docker/config.json was copied to a headless build server, every Docker command there failed with error getting credentials - err: exit status 1, out: ''.
The config named the Docker Desktop helper, which does not exist on a plain Linux server:
grep credsStore ~/.docker/config.json
# "credsStore": "desktop"
which docker-credential-desktop
# (nothing)
The server had no docker-credential-desktop binary, so the CLI’s attempt to fetch credentials failed immediately. Two valid fixes exist. The simplest on a server is to remove the credsStore line so Docker stores credentials (base64) directly in config.json:
# edit ~/.docker/config.json and delete the "credsStore": "desktop" line, then:
docker login registry.example.com
Alternatively, install and configure a helper that fits the environment (for example docker-credential-pass with an initialized GPG/pass store) and set credsStore to pass. After removing the invalid desktop helper and logging in again, all registry operations worked.
Prevention Best Practices
- Do not copy
~/.docker/config.jsonbetween machines with different helpers; thecredsStorevalue is host-specific. - On headless servers and CI, prefer no
credsStore(plain config storage) or a helper that works without a GUI keyring, such aspass. - Ensure
docker-credential-*binaries are installed and on thePATHused by non-interactive shells and cron. - Validate
config.jsonis well-formed JSON after manual edits. - Keep credential handling consistent across environments using the Docker stack guide, and lint image builds with the Dockerfile validator.
Quick Command Reference
cat ~/.docker/config.json # find credsStore / credHelpers
which docker-credential-desktop docker-credential-pass # is the helper installed?
echo "https://registry.example.com" | docker-credential-pass get # test helper directly
python3 -m json.tool ~/.docker/config.json >/dev/null && echo OK # valid JSON?
# Fix on a server: remove the "credsStore" line, then:
docker login registry.example.com
Conclusion
error getting credentials - err: exit status 1, out: '' is a broken credential-helper problem, not a registry problem. Docker is trying to run a docker-credential-* binary that is missing, not on PATH, or backed by an unavailable keyring. Read config.json to find the named helper, test it directly, and either install/configure the right one or remove the credsStore entry so Docker stores credentials in the config file. Then docker login again and your registry commands will flow.
Fixed it? Get 500 Docker with AI & DevOps AI prompts — free
500 battle-tested, copy-paste AI prompts engineered by a senior systems engineer — every one with fill-in placeholders and safety/back-out notes. Drop your email and it's yours.
- 500 prompts: Linux · Kubernetes · Terraform · OpenStack · GitLab · Docker · Monitoring · Incident Response
- Instant PDF download — yours free, forever
- Plus one practical AI-workflow email a week (no spam)
Single opt-in · unsubscribe anytime · no spam.
Stuck on this? Start guided troubleshooting
Open an interactive diagnostic session with this error already loaded. Work a step-by-step plan, record what each check returns, land on a root cause, and export a clean incident summary — no account needed to start.
Did this fix your issue?
Solved it a different way?
Share the fix that worked for you — reviewed, then published to help the next engineer.
That looks like it may contain a secret (key, token, password, or connection string). Please remove it — a note with a detected secret can’t be published.
Thanks — that helps. Published notes appear after a quick review.
Trending errors this week
The error guides other engineers are actually reading right now.
- 1mount: wrong fs type, bad option, bad superblock
- 2Docker 'failed to set up container networking': Fix the Bridge and IP Pool
- 3Docker 'failed to create shim task': How to Fix the containerd Runtime Error
- 4Transport endpoint is not connected
- 5modprobe: FATAL: Module not found
- 6mount: wrong fs type, bad option, bad superblock
Get 500 Battle-Tested DevOps AI Prompts — Free
500 battle-tested, copy-paste AI prompts engineered by a senior systems engineer — every one with fill-in placeholders and safety/back-out notes. Drop your email and it's yours.
- 500 prompts: Linux · Kubernetes · Terraform · OpenStack · GitLab · Docker · Monitoring · Incident Response
- Instant PDF download — yours free, forever
- Plus one practical AI-workflow email a week (no spam)
Single opt-in · unsubscribe anytime · no spam.