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 returns "error getting credentials - err: exit status 1 ..." #60

Closed
BradleyA opened this issue Apr 29, 2017 · 50 comments
Closed

Comments

@BradleyA
Copy link

BradleyA commented Apr 29, 2017

The docker login command is returning the following error for two users out of three users on the same physical host using docker-credential-secretservice Release v0.5.0. The user that can login to docker hub does not have any issue pushing or pulling. All users have the same docker environment variable settings, path, file permissions and content for $HOME/.docker/config.json, run the same shell /bin/bash, same .profile and .bashrc. All users were able to connect to Docker Hub before installing docker-credential-secretservice.
When I delete the $HOME/.docker/config.json file from a user that is receiving the error message, the user continues receiving the same error message when entering docker login until I removed /usr/local/bin/docker-credential-secretservice from the host. Then the user can login to docker hub without the use of docker-credential-secretservice without any incident. It is like docker is looking for docker-credential-secretservice in the PATH before it is checking $HOME/.docker/config.json to see if the user is going to use it. If this assumption is correct then there would be a line added to docker.log unless the error is coming from something docker is calling. Either way what is creating the error message, error getting credentials - err: . . .?
When I re-download and install docker-credential-secretservice onto the host in /usr/local/bin the user again receives the error message. If I remove /usr/local/bin/docker-credential-secretservice but leave $HOME/.docker/config.json as shown below I receive an error that I would expect; error getting credentials - err: exec: "docker-credential-secretservice": executable file not found in $PATH, out: ``

$ docker login
error getting credentials - err: exit status 1, out: Error spawning command line 'dbus-launch --autolaunch=d7159335070ef1c0854c75de55c8f588 --binary-syntax --close-stderr': Child process exited with code 1

Any help will be appreciated:

Expected all users on the same physical host to receive a login prompt from docker hub.

This incident is also effecting other accounts on other hosts (running Docker 17.04.0-ce, 17.05.0-ce-rc2, and 1.13.1) with similar but different error messages
$ docker login
error getting credentials - err: exit status 127, out: ``

$ cat $HOME/.docker/config.json
{
"auths": {},
"credsStore": "secretservice"
}

$ ls -l $HOME/.docker/config.json
-rw------- 1 uadmin uadmin 49 Apr 29 08:20 /home/uadmin/.docker/config.json

$ echo $PATH
/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin

$ ls -l /usr/local/bin/docker-credential-secretservice
-rwxr-xr-x 1 root root 2382344 Mar 14 05:20 /usr/local/bin/docker-credential-secretservice

$ env | grep -i docker
DOCKER_HOST=tcp://three.cptx86.com:2376
DOCKER_TLS_VERIFY=1
PWD=/home/uadmin/.docker
DOCKER_CERT_PATH=/home/uadmin/.docker
DOCKER_CONTENT_TRUST=1

OS: Ubuntu 14.04.5 LTS

$ docker version
Client:
Version: 17.03.0-ce
API version: 1.26
Go version: go1.7.5
Git commit: 60ccb22
Built: Thu Feb 23 10:57:47 2017
OS/Arch: linux/amd64

Server:
Version: 17.03.0-ce
API version: 1.26 (minimum version 1.12)
Go version: go1.7.5
Git commit: 60ccb22
Built: Thu Feb 23 10:57:47 2017
OS/Arch: linux/amd64
Experimental: false

$ cat /etc/default/docker
DOCKER_OPTS="
--graph=/usr/local/docker
--dns 192.168.1.202
--dns 8.8.8.8
--dns 8.8.4.4
--host=hostname -f:2376
--label XHOST=hostname -f
--label XIPADDRESS=hostname -i
--label XOS=lsb_release -d | awk '{ print $2"-"$3"-"$4 }'
--label XRELEASE=docker version | grep -m 1 Version: | awk '{ print $2 }'
--label XSECURITY=namespace-control
--log-level warn
--log-driver=json-file
--log-opt max-size=5m
--log-opt max-file=7
--log-opt labels=host,ip,gateway,id
--tlsverify
--tlscacert=/etc/docker/certs.d/daemon/ca.pem
--tlscert=/etc/docker/certs.d/daemon/hostname -f-cert.pem
--tlskey=/etc/docker/certs.d/daemon/hostname -f-priv-key.pem
--userns-remap=default
"

$ docker info
Containers: 0
Running: 0
Paused: 0
Stopped: 0
Images: 2
Server Version: 17.03.0-ce
Storage Driver: aufs
Root Dir: /usr/local/docker/362144.362144/aufs
Backing Filesystem: extfs
Dirs: 2
Dirperm1 Supported: true
Logging Driver: json-file
Cgroup Driver: cgroupfs
Plugins:
Volume: local
Network: bridge host macvlan null overlay
Swarm: active
NodeID: 6hkwnobu6t374trqoaosx2wbg
Is Manager: true
ClusterID: fphwipe950p46noadhkzjci06
Managers: 1
Nodes: 1
Orchestration:
Task History Retention Limit: 5
Raft:
Snapshot Interval: 10000
Number of Old Snapshots to Retain: 0
Heartbeat Tick: 1
Election Tick: 3
Dispatcher:
Heartbeat Period: 5 seconds
CA Configuration:
Expiry Duration: 3 months
Node Address: 192.168.1.203
Manager Addresses:
192.168.1.203:2377
Runtimes: runc
Default Runtime: runc
Init Binary: docker-init
containerd version: 977c511eda0925a723debdc94d09459af49d082a
runc version: a01dafd48bc1c7cc12bdb01206f9fea7dd6feb70
init version: 949e6fa
Security Options:
apparmor
userns
Kernel Version: 4.4.0-75-generic
Operating System: Ubuntu 14.04.5 LTS
OSType: linux
Architecture: x86_64
CPUs: 8
Total Memory: 11.72 GiB
Name: three
ID: KIKV:2ITY:O5GF:5JEA:O5F6:GKKS:DYGG:NUMO:UTYK:B6ZR:OKB7:BECJ
Docker Root Dir: /usr/local/docker/362144.362144
Debug Mode (client): false
Debug Mode (server): false
Registry: https://index.docker.io/v1/
WARNING: No swap limit support
Labels:
XHOST=three.cptx86.com
XIPADDRESS=192.168.1.203
XOS=Ubuntu-14.04.5-LTS
XRELEASE=17.03.0-ce
XSECURITY=namespace-control
Experimental: false
Insecure Registries:
127.0.0.0/8
Live Restore Enabled: false

$ tail /var/log/upstart/docker.log
No error found in /var/log/upstart/docker.log

Daemon debug mode: The daemon output with debug set is the same for all three users.
$ tail /var/log/upstart/docker.log
time="2017-04-29T11:30:51.531218145-05:00" level=debug msg="Calling GET /_ping"
time="2017-04-29T11:30:51.531554559-05:00" level=debug msg="Calling GET /v1.26/info"

@chandanpasunoori
Copy link

any update?

@vdemeester
Copy link
Collaborator

@runcom ^^

@cuiweiqiang
Copy link

The same situation before.
If you use iTerm 2 & macOS 10.13, please try command like 'sudo ls', it might be say "sudo: unknown uid 501: who are you", you can restart iTerm can resolve this problem.

@GodOfCrimson
Copy link

This solved my problem @cuiweiqiang.
I had the same issue as mentioned above. Thanks a lot!

@yuliyanm
Copy link

I had kind of similar issue, just remove
"credsStore": "secretservice" line from the docker config file, if you do not need it. Then the login should go smoothly. I found the answer here: #24

@yassermog
Copy link

yassermog commented Nov 16, 2017

after I update to Mac OS 10.13.1 (17B48) this problem appears and It solved by removing "credsStore":
from
~/.docker/config.json

@mauscoelho
Copy link

+1

@westberliner
Copy link

After removing credsStore in the config.json I got still an error. By disabling the checkbox "securely save docker logins in macOS keychain" in the docker preferences I could finally access my registry.

@horia8n
Copy link

horia8n commented Jan 3, 2018

mac OS 10.13.2
lunch keychaine access
right click login, lock then unlock
That's it!

@Dean-Christian-Armada
Copy link

just lock and unlock again the KeyChain Acess in Mac

@ibuler
Copy link

ibuler commented Jan 22, 2018

@Dean-Christian-Armada solved

@n4ss
Copy link
Contributor

n4ss commented Jan 26, 2018

I'll submit a fix to get the command to prompt the keychain password in order to unlock it if needed before trying to access elements.

Thanks for submitting the issue and the solution.

@n4ss n4ss closed this as completed Jan 26, 2018
@RyanRamchandar
Copy link

RyanRamchandar commented May 17, 2018

For me I had to remove the package golang-docker-credential-helpers which somehow got installed on my headless Ubuntu 18.04 device. This package is installed with docker-compose.

@extraymond
Copy link

@RyanRamchandar I tried removing the above package but docker-compose got removed too...

@RyanRamchandar
Copy link

@extraymond Just tried it. Running apt-get remove golang-docker-credential-helpers also removes docker-compose for some reason. Hmm...

@Megachill
Copy link

Megachill commented May 29, 2018

@RyanRamchandar it removes docker-compose as well which I cannot afford to lose on my headless Ubuntu 18.04. Any other ideas anyone?

So for now i switched my scripts to do what compose would have done for me, but like this there is no point to continue using aws ecr for me now since I won't be able to docker login on any host that has docker-compose installed, which in turn defeats the whole purpose..

I could of course just totally packer everything into AMIs and spool these up but cmon.. this annoys me seriously

@RyanRamchandar
Copy link

@Megachill I'd like to preserve docker-compose too. Still investigating.

@tkunic
Copy link

tkunic commented May 30, 2018

If you'd like to keep docker-compose on Ubuntu while removing the golang-docker-credential-helpers package, you can apt remove, and then just install the docker-compose binary manually: https://docs.docker.com/compose/install/#install-compose

@nyetwurk
Copy link

nyetwurk commented Oct 4, 2018

The real problem is that golang-docker-credential-helpers should not be a requirement for the ubuntu/debian docker-compose package. Closing this bug does nothing to address that fundamental issue.

@nyetwurk
Copy link

nyetwurk commented Oct 4, 2018

The correct workaround should be

  1. do not automatically install golang-docker-credential-helpers when installing docker-compose
  2. allow the user to apt remove golang-docker-credential-helpers without removing docker-compose

This is actually a packaging issue. I will open the appropriate debian and ubuntu bugs time permitting.

@nyetwurk
Copy link

nyetwurk commented Oct 4, 2018

@abidulrmdn
Copy link

Ubuntu 18.0.1 when installing docker-compose (apt install docker-compose) it comes with golang-docker-credential-helpers
quick solution is to apt remove golang-docker-credential-helpers => docker login => then apt install docker-compose back

@RyanRamchandar
Copy link

@abdrmdn Tried that but didn't work. See #60 (comment)

@c9s
Copy link

c9s commented Oct 22, 2018

You can do rm /usr/bin/docker-credential-secretservice after you installed docker-compose since removing golang-docker-credential-helpers will remove the entire docker-compose

@arvindpathare
Copy link

@extraymond Just tried it. Running apt-get remove golang-docker-credential-helpers also removes docker-compose for some reason. Hmm...

It worked Thanks

@rkbrent
Copy link

rkbrent commented Aug 26, 2019

I had kind of similar issue, just remove
"credsStore": "secretservice" line from the docker config file, if you do not need it. Then the login should go smoothly. I found the answer here: #24

Be aware that if you do this your docker login password may be stored in the clear in your config.json file.

@Newlife0810
Copy link

Ubuntu 18.0.1 when installing docker-compose (apt install docker-compose) it comes with golang-docker-credential-helpers
quick solution is to apt remove golang-docker-credential-helpers => docker login => then apt install docker-compose back

thanks for your answer

@nicholasbernstein
Copy link

You can remove the package and ignore the dependency. I did the following and it fixed the problem:

dpkg -r --ignore-depends=golang-docker-credential-helpers golang-docker-credential-helpers
(Reading database ... 92450 files and directories currently installed.)
Removing golang-docker-credential-helpers (0.5.0-2) ...

@im-n1
Copy link

im-n1 commented Oct 26, 2019

@nicholasbernstein if I do so I get

dockerpycreds.errors.InitializationError: docker-credential-secretservice not installed or not available in PATH

@sharksforarms
Copy link

sharksforarms commented Jan 7, 2020

@nicholasbernstein if I do so I get

dockerpycreds.errors.InitializationError: docker-credential-secretservice not installed or not available in PATH

Also getting this.

Edit: Instead of removing golang-docker-credential-helpers I did rm /usr/bin/docker-credential-secretservice and then a docker login, this forces the auth to be stored in ~/.docker/config.json instead of the secretservice

@SuperSandro2000
Copy link

rm /usr/bin/docker-credential-secretservice

This is not a great solution cause apt will think this package is still install and this could lead to strange errros.

Use this sudo dpkg --remove --force-depends golang-docker-credential-helpers

@vladox
Copy link

vladox commented May 23, 2020

Try this: https://hackernoon.com/getting-rid-of-docker-plain-text-credentials-88309e07640d
https://github.com/docker/docker-credential-helpers/releases

@DanieleB89
Copy link

Why this is closed?

The error is not solved...

@rainman0607
Copy link

Not resolved! Come on !

@florinutz
Copy link

just started getting this out of the blue in ubuntu 22.04

@tungduonginforma
Copy link

tungduonginforma commented Jul 25, 2022

just started getting this out of the blue in ubuntu 22.04

Same with me on Ubuntu 22.04 LTS

The most voted answer in this Stackoverflow help me solve the issue
https://stackoverflow.com/questions/50151833/cannot-login-to-docker-account

@MuktadirHassan
Copy link

For anyone using docker-desktop on ubuntu 20.04 and facing this issue.

  • Make sure you have pass and gpg installed. Then Follow this page: https://docs.docker.com/desktop/get-started/ to initialize pass.
  • Install the docker credential helper. sudo apt install golang-docker-credential-helpers
  • Initialize helper pass: pass insert docker-credential-helpers/docker-pass-initialized-check and set your password.
  • edit the ~/.docker/.config.json (create one if needed) and insert
{
 "credsStore": "pass"
}
  • docker logout
  • docker login

@jackthenewbie
Copy link

jackthenewbie commented Nov 11, 2022

it seems like when you pull image from public hub, it docker automatically make you need to login, just do as #60 (comment) in ~/.docker/config.json or C:\Users\<UserNameHere>\.docker\config.json. It's work for me tho. My case is win10 pro + wsl. Both run docker compose up fine after do as above

@hayjay
Copy link

hayjay commented Dec 5, 2022

after I update to Mac OS 10.13.1 (17B48) this problem appears and It solved by removing "credsStore": from ~/.docker/config.json

This works for me.

I followed these steps:

  1. cd ~/.docker/
  2. run sudo nano config.json
  3. you will see an object like: { "credsStore" : desktop } just remove the content of the object and have an empty object { }
  4. type control + o to save what you have just edited in the config.json file.
  5. press control + x key to exit from the terminal
  6. go back to rerun your docker command and it should work

@hpsaturn
Copy link

Only with run the first two points here, worked for me on Debian 11:

* Make sure you have `pass` and `gpg` installed. Then Follow this page: https://docs.docker.com/desktop/get-started/ to initialize `pass`.

* Install the docker credential helper. `sudo apt install golang-docker-credential-helpers`

@dioptre
Copy link

dioptre commented Apr 14, 2023

Still a bug

@coetzeexu
Copy link

same question, fixed by:

  1. open ~/.docker/config.json
  2. remove "credsStore": "desktop"

@ReeceJones
Copy link

For those on MacOS, I've noticed that docker will add "credsStore": "desktop" back to the config whenever it starts up and will crash if you change the config permissions to read-only. I was able to fix this by updating ~/.docker/config.json to have "credsStore": "osxkeychain".

Now, whenever I restart docker I no longer need to edit the config file.

@ionansantos
Copy link

@MuktadirHassan funcionou pra mim , muito obrigado !! <3 🇧🇷 🇧🇷 🇧🇷

@untalsanders
Copy link

For those on Archlinux, docker add "credsStore": "desktop" on ~/.docker/config.json file. Updating this to removing this key works for me.

@leiflundberg
Copy link

I ran into this issue using Ubuntu WSL and Rancher Desktop. I had previously (a couple weeks ago) logged into my registry, but my solution was to simply log in again using:
docker login <your.registry.url>

@seba1rx
Copy link

seba1rx commented Jan 23, 2024

In my case I use WSL2 Debian and I had this issue, and I solved it by using

rm ~/.docker/config.json

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