cicd
authentication
ai_generated
true
Error: Username and password required. Error: Process completed with exit code 1.
ID: cicd/gha-docker-login-failed
90%Fix Rate
89%Confidence
50Evidence
2023-01-01First Seen
Version Compatibility
| Version | Status | Introduced | Deprecated | Notes |
|---|---|---|---|---|
| any | active | — | — | — |
Root Cause
Docker login fails in GitHub Actions when pushing images to a container registry. Usually caused by missing or incorrect registry credentials, expired tokens, or wrong registry URL.
genericWorkarounds
-
93% success Use docker/login-action with proper registry credentials stored as secrets
Add 'uses: docker/login-action@v3' with 'registry: ghcr.io' (or your registry), 'username: ${{ github.actor }}', and 'password: ${{ secrets.GITHUB_TOKEN }}' for ghcr.io, or appropriate secrets for other registries -
91% success Use GITHUB_TOKEN for GitHub Container Registry authentication
For ghcr.io, set 'permissions: packages: write' in the workflow and use 'password: ${{ secrets.GITHUB_TOKEN }}' with 'registry: ghcr.io'
Dead Ends
Common approaches that don't work:
-
Use docker login with plaintext password in a run step
70% fail
Password appears in workflow logs even with masking; insecure and often fails due to stdin issues in CI
-
Assume GITHUB_TOKEN works for Docker Hub pushes
95% fail
GITHUB_TOKEN only authenticates to ghcr.io (GitHub Container Registry), not Docker Hub or other registries
Error Chain
Leads to:
Preceded by:
Frequently confused with: