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
sirviot opened this issue Aug 2, 2019 · 21 comments

Comments

@sirviot
Copy link

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

This comment has been minimized.

Copy link
Author

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

This comment has been minimized.

Copy link
Author

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

This comment has been minimized.

Copy link
Author

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

This comment has been minimized.

Copy link
Author

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

This comment has been minimized.

Copy link

commented Aug 2, 2019

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

@sirviot

This comment has been minimized.

Copy link
Author

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

This comment has been minimized.

Copy link

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

This comment has been minimized.

Copy link

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

This comment has been minimized.

Copy link

commented Aug 5, 2019

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

@Chinow

This comment has been minimized.

Copy link

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

This comment has been minimized.

Copy link

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

This comment has been minimized.

Copy link

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" }%

@gdemacedo

This comment has been minimized.

Copy link

commented Aug 6, 2019

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

This comment has been minimized.

Copy link

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 Aug 6, 2019

@davidpelayo

This comment has been minimized.

Copy link

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

This comment has been minimized.

Copy link

commented Aug 7, 2019

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

This comment has been minimized.

Copy link

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

This comment has been minimized.

Copy link

commented Aug 8, 2019

2.1.0.1 seems to fix the problem for me.

@guillaumerose

This comment has been minimized.

Copy link
Member

commented Aug 8, 2019

Yes, this is fixed in 2.1.0.1.

@markpradhan

This comment has been minimized.

Copy link

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

This comment has been minimized.

Copy link

commented Aug 14, 2019

@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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
You can’t perform that action at this time.