docker-credential-helpers icon indicating copy to clipboard operation
docker-credential-helpers copied to clipboard

docker login Succeeded, docker pull failed

Open liaolinrong opened this issue 6 years ago • 32 comments

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

liaolinrong avatar Jul 16 '19 08:07 liaolinrong

I have been encountering the same issue for the past few days, I still can't figure out why.

fttriquet avatar Jul 23 '19 17:07 fttriquet

does your GPG key have a passphrase?

if so, can you try doing this first:

export GPG_TTY=$(tty)

maxthomas avatar Jul 31 '19 19:07 maxthomas

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

akazakou avatar Sep 03 '19 09:09 akazakou

Have the same problem, the workaround works, but not in all cases which I need

allertec avatar Dec 08 '19 07:12 allertec

@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 avatar Dec 13 '19 17:12 vindubeyama

@fttriquet Did you figure out the solutions to this?

vindubeyama avatar Dec 13 '19 17:12 vindubeyama

@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 :/

allertec avatar Dec 13 '19 17:12 allertec

Same issue for me on 19.03.5

maksokami avatar Jan 30 '20 19:01 maksokami

it worked for me after run apt-get update .

Anishmourya avatar Feb 19 '20 08:02 Anishmourya

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 -

theBigGron avatar Feb 23 '20 14:02 theBigGron

This is still an active issue, it completely prevents us of using this provider

WhoAteDaCake avatar Mar 01 '20 14:03 WhoAteDaCake

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.

scott-dunt avatar Jun 17 '20 17:06 scott-dunt

export GPG_TTY=$(tty)

This trick works on my Ubuntu 18.04 LTS.

leimao avatar Aug 08 '20 05:08 leimao

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.

mukteshkrmishra avatar Sep 03 '20 09:09 mukteshkrmishra

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.

farvashani avatar Oct 02 '20 00:10 farvashani

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?

svdHero avatar Nov 19 '20 14:11 svdHero

This solved it for me on ubuntu

userneeds-ahe avatar Nov 24 '20 09:11 userneeds-ahe

I encounter the issue on Amazon Linux 2. Does someone have solution for it?

dekelmidlink avatar Feb 03 '21 09:02 dekelmidlink

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

dekelmidlink avatar Feb 03 '21 10:02 dekelmidlink

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.

evakili avatar Apr 12 '21 12:04 evakili

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.

caspercasanova avatar May 20 '21 18:05 caspercasanova

FWIW, changing credentials to a new PAT did the trick for me.

lntsmn avatar Jan 19 '22 09:01 lntsmn

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

smallst avatar Nov 20 '22 10:11 smallst

I still get the same error on windows. even tried with PAT as well but not help

vijay-pandurangan avatar Nov 24 '22 15:11 vijay-pandurangan

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.

smallst avatar Nov 28 '22 06:11 smallst

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
  1. uninstall golang-docker-credential-helpers (the old docker-credential-pass version is 0.6.4)
  2. build the new docker-credential-pass (the new version is 0.7.0)
  3. copy docker-credential-pass to /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?

0xbillw avatar Dec 19 '22 10:12 0xbillw

The problem has been solved. Please refer to: #192

tsoftware-tedu avatar Feb 21 '23 09:02 tsoftware-tedu

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

cowlinator avatar Feb 02 '24 19:02 cowlinator

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/

oleksandrmilko avatar May 01 '24 17:05 oleksandrmilko