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

Error with docker-compose: docker-credential-desktop not installed or not available in PATH #3785

Closed
2 tasks done
sirviot opened this issue Aug 2, 2019 · 45 comments
Closed
2 tasks done

Comments

@sirviot
Copy link

sirviot commented Aug 2, 2019

Cannot start containers any more after update. I don't know how the error docker-credential-desktop not installed or not available in PATH should be fixed.

I tried to remove the whole ~/.docker directory and restart the Docker Desktop, but it didn't help.

  • I have tried with the latest version of my channel (Stable or Edge)
  • I have uploaded Diagnostics
  • Diagnostics ID: 86EC26ED-0429-4F94-8758-A71185F63B59/20190802103144

Expected behavior

Should start to build image and start a container with docker-compose up

Actual behavior

Starts the build but fails

Building server
Traceback (most recent call last):
  File "docker-compose", line 6, in <module>
  File "compose/cli/main.py", line 71, in main
  File "compose/cli/main.py", line 127, in perform_command
  File "compose/cli/main.py", line 1085, in up
  File "compose/cli/main.py", line 1081, in up
  File "compose/project.py", line 527, in up
  File "compose/service.py", line 360, in ensure_image_exists
  File "compose/service.py", line 1084, in build
  File "site-packages/docker/api/build.py", line 260, in build
  File "site-packages/docker/api/build.py", line 307, in _set_auth_headers
  File "site-packages/docker/auth.py", line 301, in get_all_credentials
  File "site-packages/docker/auth.py", line 287, in _get_store_instance
  File "site-packages/dockerpycreds/store.py", line 25, in __init__
dockerpycreds.errors.InitializationError: docker-credential-desktop not installed or not available in PATH
[8929] Failed to execute script docker-compose

Information

Problems started after updating

  • Docker Desktop 2.1.0.0 (36874)
  • macOS Version: macOS Mojave 10.14.5
@sirviot sirviot changed the title docker-credential-desktop not installed or not available in PATH Error with docker-compose: docker-credential-desktop not installed or not available in PATH Aug 2, 2019
@sirviot
Copy link
Author

sirviot commented Aug 2, 2019

Where/how on earth can I install the docker-credential-desktop?
Shouldn't it be part of the update?
On terminal

$ docker [tab]
docker          docker-compose  docker-machine 

@sirviot
Copy link
Author

sirviot commented Aug 2, 2019

The files can be found under /Applications

$ find /Applications/Docker.app/Contents/ -name 'docker-credential-desktop'
/Applications/Docker.app/Contents//Resources/bin/docker-credential-desktop

For some reason the file was not linked in the /usr/local/bin like other files.

@sirviot
Copy link
Author

sirviot commented Aug 2, 2019

I figured that maybe a reinstall would be in place here. So I proceeded to uninstalled the whole Docker-thing. Did not know that in order to download the latest Docker these days one needs to create a user account to Docker Hub.

@sirviot
Copy link
Author

sirviot commented Aug 2, 2019

After furious account creating, downloading, installing and proxy-configuring the latest version of Docker was once again setup on my mac.

docker-compose up worked without any issues.

I thing the problem was (or is) that my installment of Docker dated back to times when it was called Docker Toolbox (and did not include the docker-credential-desktop). After several updates on top of one another, things started to turn south.

Should I mark this as closed now? Should the Docker Desktop be fixed to include required links when updated on top of Docker Toolbox?

@justinappler
Copy link

Try including "credsStore": "osxkeychain" or "credsStore": "desktop" in ~/.docker/config.json. For some reason it got misspelled for me.

@sirviot
Copy link
Author

sirviot commented Aug 5, 2019

The uninstallation of Docker and re-installing the latest one fixed the problem, so I'm not anymore able to test this workaround.

I think that the source of this problem was that the necessary links hadn't been created in the /usr/local/bin directory during some update.

@JamesGuthrie
Copy link

JamesGuthrie commented Aug 5, 2019

I seem to be running into the same issue. It looks like I had the same typo in ~/.docker/config.json, but fixing it doesn't resolve the docker-credential-desktop not installed or not available in PATH.

Interestingly enough it does seem to be available on my path:

> which docker-credential-desktop
/usr/local/bin/docker-credential-desktop

> ls -l $(which docker-credential-desktop)
lrwxr-xr-x  1 root  admin  73 Jul 31 16:05 /usr/local/bin/docker-credential-desktop -> /Applications/Docker.app/Contents/Resources/bin/docker-credential-desktop

I also tried uninstalling and reinstalling docker for mac but that didn't seem to help.

@ulrich
Copy link

ulrich commented Aug 5, 2019

@sirviot thank you for your feedback.
I can reproduce this issue by updating Docker Desktop stable/2.0.0.2 version to stable/2.1.0.0 version, but the problem seems that the shell context is not refresh. To fix that I updated my shell environment with the source shell command (e.g. : source ~/.zshrc) to have the path refreshed.

@JamesGuthrie
Copy link

@ulrich I just tried running source ~/.bash_profile, but it didn't make a difference for me.

@Chinow
Copy link

Chinow commented Aug 5, 2019

I had the same issue and noticed that there was a typo in the ~/.docker/config.json :
credSstore instead of credsStore not sure where it was coming from though.

@virgil9306
Copy link

virgil9306 commented Aug 6, 2019

Indeed @Chinow has the right solution. Somehow there is a typo in that file. Note I am running Docker Desktop Version 2.0.0.3 (31259).

@ulrich
Copy link

ulrich commented Aug 6, 2019

I tried to find the misconfiguration in the config.json file.

The file content under Docker Desktop stable/2.0.0.3 (31259) is:
{ "auths": { "https://index.docker.io/v1/": {} }, "HttpHeaders": { "User-Agent": "Docker-Client/18.09.2 (darwin)" }, "credsStore": "osxkeychain", "stackOrchestrator": "swarm" }%

The file content under Docker Desktop stable/2.1.0.0 (36876) is:
{ "auths": { "https://index.docker.io/v1/": {} }, "HttpHeaders": { "User-Agent": "Docker-Client/19.03.1 (darwin)" }, "credsStore": "desktop", "stackOrchestrator": "swarm" }%

@gmcestari
Copy link

for me the fix was a combination of @Chinow's post and creating the link with the following command:

ln -s "/Applications/Docker.app/Contents//Resources/bin/docker-credential-desktop" "/usr/local/bin/docker-credential-desktop"

after that the issue was resolved.

@ulrich
Copy link

ulrich commented Aug 6, 2019

Thank you for your feedbacks all. We did investigate for finding the related issue for this trouble and we are working to improve the behavior of our migration tooling.

I opened an issue in the Docker Desktop issues tracker for the next release stable/edge releases.

@ulrich ulrich closed this as completed Aug 6, 2019
@davidpelayo
Copy link

davidpelayo commented Aug 7, 2019

What @ulrich says is in fact what just happened to me a few minutes ago.

Still without solution. Exactly in the same situation as @JamesGuthrie posted here.

Versions:

  • Docker Desktop 2.1.0.0 (36874) Stable.
  • macOS 10.14.6.

FYI: Related to #3805 & this one.

@davidpelayo
Copy link

Downgrading is how I made it work.

  1. Close any terminal you had opened.
  2. Delete your previous Docker for Desktop from your system (by simply removing it from your Applications).
  3. Download the latest stable release Docker Community Edition 2.0.0.3 2019-02-15: https://download.docker.com/mac/stable/31259/Docker.dmg.
  4. (Be careful not to delete unwanted info from your config) Initialize your credentials configuration by running: docker-credential-gcr configure-docker

@lmakarov
Copy link

lmakarov commented Aug 7, 2019

In my case, this issue was likely the result of upgrading to Docker Desktop 2.1.0.0 and then downgrading back to 2.0.0.3.

As @ulrich mentioned here, the two versions use different credsStore values: "credsStore": "desktop" in 2.1.0.0 vs "credsStore": "osxkeychain" in prior versions.

2.1.0.0 comes with the /Applications/Docker.app/Contents/Resources/bin/docker-credential-desktop binary, while 2.0.0.3 only has /Applications/Docker.app/Contents/Resources/bin/docker-credential-osxkeychain.

Downgrading from 2.1.0.0 to 2.0.0.3 does not revert the changes in ~/.docker/config.json, so you have to do this manually. Here's a one-liner for that:

sed -i~ 's/"desktop"/"osxkeychain"/g' ~/.docker/config.json

@mbode
Copy link

mbode commented Aug 8, 2019

2.1.0.1 seems to fix the problem for me.

@guillaumerose
Copy link
Contributor

Yes, this is fixed in 2.1.0.1.

@markpradhan
Copy link

markpradhan commented Aug 9, 2019

Manually replacing the executable and running docker login fixed it for me:
https://github.com/docker/docker-credential-helpers/releases

The executable was located in /usr/local/bin. (echo $PATH)

@amodsrivastava
Copy link

@Chinow's post is working from me.
There was a typo in the ~/.docker/config.json :
credSstore instead of credsStore not sure where it was coming from though.

@danieleascione
Copy link

danieleascione commented Oct 2, 2019

I have faced the same issue with docker desktop 2.1.0.3. In this version there is no typo in the ~/.docker/config.json. The problem occured during the execution of some tests written with test-container that were spinning up some docker-compose only if the user is loggedin in the DockerHub. So, in my case the solution was simply logging out.

@john-n-smith
Copy link

Manually replacing the executable and running docker login fixed it for me:

The binary was missing for me too. This was a fresh install of Docker Toolbox using DockerToolbox-19.03.1.pkg

@deveweber
Copy link

I had the same issue with docker-toolbox under Windows 10 (I am using the toolbox because I have to run VirtualBox for another project).

The workaround I found:

Everything should work fine now :)

@devinbost
Copy link

I just got this issue after upgrading to 2.2.0.0, but I don't see any typos in my ~/.docker/config.json file. The contents of that file are:

{
  "stackOrchestrator" : "swarm",
  "auths" : {

  },
  "credsStore" : "desktop"
}

I'm not sure if auths is supposed to be empty like that though.

@qnub
Copy link

qnub commented Feb 1, 2020

try to replace desktop with osxkeychain

@Goffen
Copy link

Goffen commented Feb 2, 2020

For me using docker-toolbox, changing to osxkeychain and linking it as gdemacedo said worked

@philippefutureboy
Copy link

philippefutureboy commented Apr 25, 2020

For all of those falling on this in 2020 I got this resolved by doing the total opposite of the above - I remove the "credsStore": ... line from my config and then it started working.
(MacOS 10.13.6, Docker Desktop 2.2.0.5)

@chadfrost
Copy link

Big thanks to @philippefutureboy as his solution solved my frustration (docker-toolbox, on Mac Mojave).

@rb-mica
Copy link

rb-mica commented May 13, 2020

I found the typo in my ~/.docker/config.json and the links for docker-credential-osxkeychain was correct, still getting

fatal error: Unable to locate credentials

(MacOS 10.15.4, Docker Desktop 2.3.0.2)

@Hawkzed
Copy link

Hawkzed commented Jun 1, 2020

Deleting config.json worked for me. Running docker in Windows and a WSL2 ubuntu environment.

@grottah
Copy link

grottah commented Jun 2, 2020

Hi, today is my first day into docker, i need to run some test using TestContainer.
I don't have the typo in ~/.docker/config.json and the link for docker-credential-desktop was correct. After delete the line "credsStore" : "desktop", i don't have the error.

Also the install from eclipse of TestContainer is not working, some timeout. Only "docker pull localstack/localstack:0.9.4" from command line works properly.

(MacOS 10.13.6, Docker Desktop 2.3.0.3, eclipse 202003)

@mohammedabdulmajid
Copy link

mohammedabdulmajid commented Jun 4, 2020

Try including "credsStore": "osxkeychain" or "credsStore": "desktop" in ~/.docker/config.json. For some reason it got misspelled for me.

It worked for me by including "credsStore": "desktop" in ~/.docker/config.json.
Thank you.

@sshniro
Copy link

sshniro commented Jun 10, 2020

For me removing the old config file worked.

docker logout
mv ~/.docker/config.json ~/.docker/config_old.json
docker login

@alex-gru
Copy link

☝️ this approach fixed it for me as well, thanks @sshniro. ✌️

@fathanpranaya
Copy link

Deleting config.json worked for me. Running docker in Windows and a WSL2 ubuntu environment.

this is the solution for WSL2 case

@oliver-com
Copy link

Deleting config.json worked for me. Running docker in Windows and a WSL2 ubuntu environment.

Works for me too

@riteshpuj2013
Copy link

Deleting config.json worked for me.
Mac OS Catalina 10.15.6
Docker version: 2.3.0.4

@marleyjaffe
Copy link

Signing out of Docker Hub in the app seems to have solved the issue for me... I also changed to credsStore": "osxkeychain"

Mac OS Catalina 10.15.6
Docker version: 2.3.0.4

@mike-boost
Copy link

I use WSL ubuntu, and install docker desktop in windows 10.
Then I uninstall docker desktop, and then install docker-ce in Ubuntu. Then same issue happended.
So I delete the folder ~/.docker, then everything ok.

@jeetpatel
Copy link

The problem resolved after running the following command:
sudo apt install golang-docker-credential-helpers

@krumware
Copy link

did the same thing as @mike-boost on windows 10 with wsl. Everything ran fine from powershell, but not from within WSL.
ran mv ~/.docker ~/.docker_old and everything worked fine, without a restart.

tomtau pushed a commit to crypto-org-chain/chain-main that referenced this issue Nov 6, 2020
Solution:
* test ledger device manually on windows with the binary build by the goreleaser , it works fine.
* integration test can not run on windows for the following reason:
    * nix does not support the windows platform
    * supervisor does not work fine on windows in my test
* Currently, [WSL does not have USB pass-through access](microsoft/WSL#5158), so can't use ledger device on WSL.
* integration test works fine on windows WSL 2, if get an error like `docker-credential-desktop.exe not installed or not available in PATH`,  see [here](docker/for-mac#3785)
* can not expose the container's port outside using the host network mode on WSL 2, so change to container link mode.
@rolandma
Copy link

I ran into the same problem in Windows 10 WSL 2 integration docker-desktop for windows.
I tried the suggested to rename ~/.docker/config.json , the error of can't find credential went away but I actually lost credential to the repository, did the docker login from windows powershell won't help, but in the wsl, I did a docker login, and it worked.

@krumware
Copy link

It may be worth mentioning that this is happening regularly in WSL 2, and needs to be re-done occasionally. Hopefully a permanent solution is found soon.

@docker-robott
Copy link
Collaborator

Closed issues are locked after 30 days of inactivity.
This helps our team focus on active issues.

If you have found a problem that seems similar to this, please open a new issue.

Send feedback to Docker Community Slack channels #docker-for-mac or #docker-for-windows.
/lifecycle locked

@docker docker locked and limited conversation to collaborators Dec 18, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests