# Error response from daemon: unauthorized: incorrect username or password

- **ID:** `docker/registry-unauthorized-401`
- **Domain:** docker
- **Category:** auth_error
- **Error Code:** `401`
- **Verification:** ai_generated
- **Fix Rate:** 90%

## Root Cause

Docker credentials for a private registry are invalid, expired, or not provided, causing authentication to fail during push/pull.

## Version Compatibility

| Version | Status | Introduced | Deprecated |
|---------|--------|------------|------------|
| Docker 24.0.6 | active | — | — |
| Docker 25.0.1 | active | — | — |
| Docker Hub | active | — | — |

## Workarounds

1. **Re-authenticate with correct credentials: docker login registry.example.com -u username -p new_password** (95% success)
   ```
   Re-authenticate with correct credentials: docker login registry.example.com -u username -p new_password
   ```
2. **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** (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
   ```
3. **Check credential store: cat ~/.docker/config.json and verify credsStore or auths. If using credential helper, ensure it's configured correctly.** (80% success)
   ```
   Check credential store: cat ~/.docker/config.json and verify credsStore or auths. If using credential helper, ensure it's configured correctly.
   ```

## Dead Ends

- **docker logout && docker login** — Logging out and logging in again with same credentials does not fix incorrect password. (80% fail)
- **sudo docker login** — Using sudo docker login changes the context but not the credential validity. (70% fail)
- **rm ~/.docker/config.json** — Deleting ~/.docker/config.json removes all credentials, but re-login with wrong password still fails. (60% fail)
