docker login Succeeded, docker pull failed
I use pass
docker login Succeeded:
# docker login
Login with your Docker ID to push and pull images from Docker Hub. If you don't have a Docker ID, head over to https://hub.docker.com to create one.
Username: liaolinrong
Password:
Login Succeeded
but when docker pull a private image, is error:
docker pull liaolinrong/centos:7.3.1611
Error response from daemon: pull access denied for liaolinrong/centos, repository does not exist or may require 'docker login'
/root/.docker/config.json :
# cat /root/.docker/config.json
{
"auths": {
"https://index.docker.io/v1/": {}
},
"HttpHeaders": {
"User-Agent": "Docker-Client/18.09.7 (linux)"
},
"credsStore": "pass"
}
os:
# cat /etc/redhat-release
CentOS Linux release 7.5.1804 (Core)
# uname -a
Linux VM_0_6_centos 3.10.0-862.el7.x86_64 #1 SMP Fri Apr 20 16:44:24 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux
docker version:
# docker -v
Docker version 18.09.7, build 2d0083d
I have been encountering the same issue for the past few days, I still can't figure out why.
does your GPG key have a passphrase?
if so, can you try doing this first:
export GPG_TTY=$(tty)
The same issue for me. @maxthomas workaround with
export GPG_TTY=$(tty)
not working on Ubuntu 18.04. It starts after my GPG key expired. I've updated it in pass configuration and removed all stored data, but it still login success, but can't pull images.
$ docker -v
Docker version 18.09.7, build 2d0083d
$ cat ~/.docker/config.json
{
"auths": {
"xxxxxxxxxxxx.dkr.ecr.us-east-1.amazonaws.com": {}
},
"HttpHeaders": {
"User-Agent": "Docker-Client/18.09.7 (linux)"
},
"credsStore": "pass"
}
$ uname -a
Linux zx386 4.15.0-60-generic #67-Ubuntu SMP Thu Aug 22 16:55:30 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux
Have the same problem, the workaround works, but not in all cases which I need
@allertec Is there any workaround for this? I am facing the same issue and I have tried all the credsStore but nothing seems to be working. Login is success but pull fails.
@fttriquet Did you figure out the solutions to this?
@allertec Is there any workaround for this? I am facing the same issue and I have tried all the credsStore but nothing seems to be working. Login is success but pull fails.
@vindubeyama nope, there is no workaound yet, however I have been using version 0.6.3, maybe using some old one will work, as you can see that some people around the internet are actually using it fine.
For me the only workaround is to keep password as a environment variable, and then use it when pulling something :/
Same issue for me on 19.03.5
it worked for me after run apt-get update .
Login successful, pull access denied. Using repository.gitlab So for people with a similar problem using deploy keys: I allowed access to the repository only (Scope: read_repository). However for docker containers it is necessary to allow access to the registry (Scope: read_registry) .
Original text:
Same issue here. Using gitlabs docker registry.
abc@server:~$ docker login registry.gitlab.company.tld/<user>/<project>/
Authenticating with existing credentials...
WARNING! Your password will be stored unencrypted in /home/abc/snap/docker/423/.docker/config.json.
Configure a credential helper to remove this warning. See
https://docs.docker.com/engine/reference/commandline/login/#credentials-store
Login Succeeded
abc@server:~$ docker run registry.gitlab.company.tld/<user>/<project>/<container>:latest
Unable to find image 'registry.gitlab.company.tld/<user>/<project>/<container>:latest' locally
docker: Error response from daemon: pull access denied for registry.gitlab.company.tld/<user>/<project>/<container>, repository does not exist or may require 'docker login'.
See 'docker run --help'.
Docker running on ubuntu:
Distributor ID: Ubuntu
Description: Ubuntu 18.04.4 LTS
Release: 18.04
Codename: bionic
Running as snap. So just in case you need it:
services:
docker.dockerd: simple, enabled, active
snap-id: sLCsFAO8PKM5Z0fAKNszUOX0YASjQfeZ
tracking: latest/stable
refresh-date: today at 13:39 UTC
installed: 18.09.9 (423) 126MB -
This is still an active issue, it completely prevents us of using this provider
Experiencing same - similar issue. Docker login to Gitlab registry works fine, push to same fails, Access Denied.
The GitLab side error logs are saying: msg="error authorizing context: authorization token required"
Traced my issue to docker-credentials-helper and 'pass' package.. I had installed them because of warning message; WARNING! Using --password via the CLI is insecure. Use --password-stdin. WARNING! Your password will be stored unencrypted in /home/ubuntu/.docker/config.json. Configure a credential helper to remove this warning. See https://docs.docker.com/engine/reference/commandline/login/#credentials-store
BUT with the credential helper installed, I cannot push to Gitlab registry..
When I disabled and removed "apt remove golang-docker-credential-helpers pass" Now I can successfully push to the registry..
Which makes me wonder if Docker version 19.03.2, build 6a30dfc is storing the password in the credential helper, but its not retrieving it?
Also tried this on Docker version 19.03.8, build afacb8b7f0 - same issue.
export GPG_TTY=$(tty)
This trick works on my Ubuntu 18.04 LTS.
This still exists in Server Version: 19.03.13-beta2
I was able to resolve this by changing my credentials-store in docker config. Also, had to reinstall docker-credentials-helper. docker logout and docker login.
if you are using "hub.docker.com" make sure to have enough private docker repository in your docker hub account. it seems you can create a private image but you can not pull the image when you exceed the private repository limits.
I have a similar issue as @scott-dunt . With docker-credentials-helpers and pass I can login successfully, but a subsequent push fails with: unauthorized to access repository: my-test-project/foo, action: push:.
This is when trying to access an on-premise Harbor container registry (no hub.docker.com). I first suspected Harbor and opened an Issue with them (https://github.com/goharbor/harbor/issues/13553), but then I noticed that once I uninstall pass and get rid of the credential helpers then everything worked fine and I could push. Also see #154.
What's the matter here?
This solved it for me on ubuntu
I encounter the issue on Amazon Linux 2. Does someone have solution for it?
I encounter the issue on Amazon Linux 2. Does someone have solution for it?
Ok I fixed it with uninstalling everything including docker (don't forget /etc/docker folder) removing all the associated data that harbor created and the reinstalling everything
export GPG_TTY=$(tty)
This works for me.
I get pull rate limit error when pulling images from docker hub, even after login. But this workaround works for me.
I still get this error on Windows. I can login Successfully and the when I inspect the docker/config.json I see the Auths object but no password within it.
FWIW, changing credentials to a new PAT did the trick for me.
same here. Docker version 20.10.21 cannot pull. but docker 20.10.17 can. Not sure what happens. login normally
also export GPG_TTY=$(tty) doesn't work. from docker-desktop
I still get the same error on windows. even tried with PAT as well but not help
okay if someone meets this bug in WSL. try to remove "credsStore": "desktop.exe" line in your .docker/config.json in wsl. it makes sense.
Similar issue. Docker login to private harbor registry works fine, but push encounter error: unauthorized.
I fixed this issue. The reason for my problem is not pass or gpg2, but golang-docker-credential-helpers (I had installed docker-desktop before, and then uninstalled it).
My environment:
- Ubuntu 22.04
- Docker-Engine 20.10.21
- uninstall
golang-docker-credential-helpers(the olddocker-credential-passversion is 0.6.4) - build the new
docker-credential-pass(the new version is 0.7.0) - copy
docker-credential-passto/usr/local/bin/
I noticed that the golang-docker-credential-helpers package includes two binaries: docker-credential-pass, docker-credential-secretservice.
I'm not sure if the real cause of the problem is a docker-credential-pass version issue, or a docker-credential-secretservice issue. Their functions seem to be the same, so why are there two programs with the same function? What is the role of docker-credential-secretservice? Is it only useful for docker-desktop programs?
The problem has been solved. Please refer to: #192
Here's how to check which credsStore you're using: cat /root/.docker/config.json.
If you're using pass, here's how to tell if your GPG key requires a password:
pass
pass show docker-credential-helpers/"<your_credential_hash>/username"
If it then prompts you for a password, your GPG key requires a password.
When using docker pull or docker push, the gpg2 private key management password prompt does not pop up correctly
I had a problem that docker login succeeded, but accessing private repo failed.
For me worked: uninstall completely Docker Engine and then install it again.
https://askubuntu.com/questions/935569/how-to-completely-uninstall-docker
https://docs.docker.com/desktop/uninstall/