401
docker
auth_error
ai_generated
true
Error response from daemon: unauthorized: incorrect username or password
ID: docker/registry-unauthorized-401
90%Fix Rate
87%Confidence
1Evidence
2024-02-28First Seen
Version Compatibility
| Version | Status | Introduced | Deprecated | Notes |
|---|---|---|---|---|
| Docker 24.0.6 | active | — | — | — |
| Docker 25.0.1 | active | — | — | — |
| Docker Hub | active | — | — | — |
Root Cause
Docker credentials for a private registry are invalid, expired, or not provided, causing authentication to fail during push/pull.
generic中文
Docker 私有仓库的凭据无效、过期或未提供,导致推送/拉取时身份验证失败。
Official Documentation
https://docs.docker.com/engine/reference/commandline/login/Workarounds
-
95% success Re-authenticate with correct credentials: docker login registry.example.com -u username -p new_password
Re-authenticate with correct credentials: docker login registry.example.com -u username -p new_password
-
90% success If using access tokens (e.g., GitHub Container Registry), generate a new token and use it: docker login ghcr.io -u username --password-stdin < token.txt
If using access tokens (e.g., GitHub Container Registry), generate a new token and use it: docker login ghcr.io -u username --password-stdin < token.txt
-
80% success Check credential store: cat ~/.docker/config.json and verify credsStore or auths. If using credential helper, ensure it's configured correctly.
Check credential store: cat ~/.docker/config.json and verify credsStore or auths. If using credential helper, ensure it's configured correctly.
中文步骤
Re-authenticate with correct credentials: docker login registry.example.com -u username -p new_password
If using access tokens (e.g., GitHub Container Registry), generate a new token and use it: docker login ghcr.io -u username --password-stdin < token.txt
Check credential store: cat ~/.docker/config.json and verify credsStore or auths. If using credential helper, ensure it's configured correctly.
Dead Ends
Common approaches that don't work:
-
docker logout && docker login
80% fail
Logging out and logging in again with same credentials does not fix incorrect password.
-
sudo docker login
70% fail
Using sudo docker login changes the context but not the credential validity.
-
rm ~/.docker/config.json
60% fail
Deleting ~/.docker/config.json removes all credentials, but re-login with wrong password still fails.