Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docker login Succeeded, docker pull failed #158

Open
liaolinrong opened this issue Jul 16, 2019 · 30 comments
Open

docker login Succeeded, docker pull failed #158

liaolinrong opened this issue Jul 16, 2019 · 30 comments

Comments

@liaolinrong
Copy link

liaolinrong commented Jul 16, 2019

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
@fttriquet
Copy link

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

@maxthomas
Copy link

does your GPG key have a passphrase?

if so, can you try doing this first:

export GPG_TTY=$(tty)

@akazakou
Copy link

akazakou commented Sep 3, 2019

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

@allertec
Copy link

allertec commented Dec 8, 2019

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

@vindubeyama
Copy link

@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
Copy link

@fttriquet Did you figure out the solutions to this?

@allertec
Copy link

allertec commented Dec 13, 2019

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

@maksokami
Copy link

Same issue for me on 19.03.5

@Anishmourya
Copy link

it worked for me after run apt-get update .

@theBigGron
Copy link

theBigGron commented Feb 23, 2020

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 -

@WhoAteDaCake
Copy link

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

@scott-dunt
Copy link

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.

@leimao
Copy link

leimao commented Aug 8, 2020

export GPG_TTY=$(tty)

This trick works on my Ubuntu 18.04 LTS.

@mukteshkrmishra
Copy link

mukteshkrmishra commented Sep 3, 2020

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.

@farvashani
Copy link

farvashani commented Oct 2, 2020

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.

@svdHero
Copy link

svdHero commented Nov 19, 2020

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 (goharbor/harbor#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?

@userneeds-ahe
Copy link

This solved it for me on ubuntu

@dekelmidlink
Copy link

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

@dekelmidlink
Copy link

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

@evakili
Copy link

evakili commented Apr 12, 2021

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.

@caspercasanova
Copy link

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.

@lntsmn
Copy link

lntsmn commented Jan 19, 2022

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

@smallst
Copy link

smallst commented Nov 20, 2022

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

@vijay-pandurangan
Copy link

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

@smallst
Copy link

smallst commented Nov 28, 2022

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.

@0xbillw
Copy link

0xbillw commented Dec 19, 2022

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?

@tsoftware-tedu
Copy link

tsoftware-tedu commented Feb 21, 2023

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

@cowlinator
Copy link

cowlinator commented Feb 2, 2024

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

@AlexandrMilko
Copy link

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/

@Dovchik
Copy link

Dovchik commented May 24, 2024

Still encountering the same issue with Docker version 26.1.3, build b72abbb

Update: fixed with doing docker login with sudo

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests