-
Notifications
You must be signed in to change notification settings - Fork 255
CLI issues with ZSH on OS X: "com.docker.cli: executable file not found" #754
Comments
@sergeyk @HannesOberreiter maybe you will have some useful information to help us investigate further.
Thanks for your feedback |
@gtardif I get the same error after activating "Enable cloud experience" again. > Executing task: docker run --rm -it -p 8888:8888/tcp hannesoberreiter/tug-python362:latest <
exec: "com.docker.cli": executable file not found in $PATH
The terminal process "/bin/zsh '-c', 'docker run --rm -it -p 8888:8888/tcp hannesoberreiter/tug-python362:latest'" failed to launch (exit code: 1).
Terminal will be reused by tasks, press any key to close it. Your test seems fine and the command > zsh -c 'which docker'
/usr/local/bin/docker
> zsh -c 'which com.docker.cli'
/usr/local/bin/com.docker.cli
> zsh -c 'echo $PATH' | grep "/usr/local/bin" -o
/usr/local/bin
> zsh -c 'docker ps'
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES Cheers |
This can be reproduced using konvoy. The source for that isn't public but I managed to see how they're shelling out to Docker using a script: #!/bin/sh
set -xe
env >&2
/usr/local/bin/docker "${@}" Running + env
KONVOY_EXECUTABLE_DIR=/opt/konvoy/artifacts
KUBECONFIG=/Users/chris/.kube/config
PWD=/private/tmp/konvoy/konvoy_v1.5.2
SHLVL=1
KONVOY_USER_OS=darwin
KONVOY_COMMAND_ARG=./konvoy
_=/usr/bin/env
+ /usr/local/bin/docker run --interactive --tty=true --rm --net=host -w /tmp/konvoy/konvoy_v1.5.2 -u 501:20 --group-add 0 -e KUBECONFIG -e SSH_AUTH_SOCK -e KONVOY_EXECUTABLE_DIR -e KONVOY_COMMAND_ARG -e KONVOY_USER_OS --mount type=volume,source=ssh-agent,target=/ssh-agent --mount type=bind,source=/tmp/konvoy/konvoy_v1.5.2,target=/tmp/konvoy/konvoy_v1.5.2 --mount type=bind,source=/var/run/docker.sock,target=/var/run/docker.sock --mount type=bind,source=/Users/chris,target=/Users/chris --mount type=bind,source=/tmp/konvoy/konvoy_v1.5.2/.konvoy-tmp954516335/passwd,target=/etc/passwd --mount type=bind,source=/tmp/konvoy/konvoy_v1.5.2/.konvoy-tmp954516335/group,target=/etc/group --mount type=bind,source=/tmp/konvoy/konvoy_v1.5.2/.konvoy-tmp954516335/ssh_config,target=/Users/chris/.ssh/config --mount type=bind,source=/tmp/konvoy/konvoy_v1.5.2/.konvoy-tmp954516335/ssh_known_hosts,target=/Users/chris/.ssh/known_hosts --mount type=bind,source=/tmp/konvoy/konvoy_v1.5.2,target=/opt/konvoy/artifacts mesosphere/konvoy:v1.5.2
Deploy and manage Kubernetes clusters
Usage:
konvoy [command] Possible workaround is for the Compose CLI to check if |
recently upgraded to 2.3.0.4 and facing same issue. Im on OSX + Zsh. Downgrading to 2.3.0.2 worked for me. |
I get the same error on macOS Catalina 10.15.7, VSCode 1.51.0, Docker extension 1.7.0, and Docker Desktop 2.5.0.1 (updated today). Disabling "cloud experience" also remedies the error (thanks for that). |
We're still struggling to reproduce this with VSCode. @jonathanhuston did you try restarting VSCode and/or your machine before deactivating the cloud experience? |
@chris-crone Rebooting Mac, VSCode, Docker extension had no effect. After disabling "cloud experience" (and restarting Docker Desktop), the problem disappeared immediately, even without restarting VSCode. |
@gtardif @chris-crone we had more users reporting that they still suffer from this issue, see microsoft/vscode-docker#2894 The workaround of disabling "cloud experience" (new CLI) is no longer viable because that option has been removed in recent Docker Desktop releases... 😔 |
@gtardif In the case of this error, could we print out the user's @karolz-ms I see that this occurs when triggering Docker commands from the VS Code plugin, what is happening under the hood? |
We launch @alexr00 would you be able to point Chris and Guillaume to the code that handles the process launch for |
VS Code shell execution tasks are launched with terminal with VS Code tries to improve this by copying VS Code's environment to the task shell. One thing to check: is the environment variable you care about set the way you'd expect for VS Code? You can check this by opening the dev tools in VS Code (command Developer: Toggle Developer Tools) and using the console to print There isn't one good place for me to point you at for how VS Code handles this process launch. |
printing out my process.env.PATH as described above includes ❯ which docker
/usr/local/bin/docker
❯ which com.docker.cli
/usr/local/bin/com.docker.cli
❯ docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES |
If I copy the command it says it couldn't run and paste it into the inbuilt terminal it runs fine:
I have to remove the comma between the zsh command and the docker build - I'm assuming that's just command and arguments. |
Are there any known workarounds for this and is this still being actively worked on? |
I've just started trying to use Docker and seem to have hit it. I can type
into the terminal in VSCode without a problem, but right click and
If I directly copy paste the entire line above into the terminal, still within VSCode it works.
Just putting this here in case another report helps. |
I have to downgrade to 3.1.0 to workaround this issue. This is sad. |
This issue has cleared up for me with the latest version of VSCode. I did nothing and now right click build Docker works.
|
Yep, working for me here too on the latest version of VSCode |
Anyone running at least Desktop 3.3.0 is still experiencing this issue? |
Yes, I am still experiencing it at I don't use VS Code, but IntelliJ. So I do not profit from the workaround the VS Code Team implemented. It is a big annoyance in my every day work. |
me too. Mac version: 11.4 |
Using MacOS 11.5.2. Ran diagnosis from support tab and the report shows: 2 failures detected 2 : is the VM networking working? Number two disappeared after I turned off Norton VPN and reinstalled. Just installed Docker Desktop on this machine. Created a debian containing and installed apache on it but then started getting "the executable file not found in $PATH" |
I'm using all the latest:
And I do have the same issue:
The only "workaround" I know is to start Absolutely annoying. |
@alanwilter VS COde docker extension now exposes |
Thanks a lot @karolz-ms ! For me it's a proper solution. |
Sorry again. But then I have tasks like:
that used to work just fine but now are failing with:
Why the |
@alanwilter this is because What might help, is that VS Code Docker extension provides its own task for Compose: https://code.visualstudio.com/docs/containers/reference#_docker-compose-task This task should respect |
Hm, actually I don't think it will use |
@karolz-ms Yep, I ended up using your first link. But for some more complex tasks I simply put the full path for docker... still, quite annoying to keep "hacking" VSCode. |
Description
Several users using ZSH on OS X have reported an error when running commands in VSCode (microsoft/vscode-docker#2366). The commands run are typically done with
zsh -c 'docker build ...'
internally by VSCode.Related:
docker/for-mac#4956
Steps to reproduce the issue:
zsh -c 'docker some command'
Describe the results you received:
"exec: "com.docker.cli": executable file not found in $PATH".
Describe the results you expected:
Successful execution of the command
Workaround:
Disabling the "Cloud Experience" in settings has worked for these users.
The text was updated successfully, but these errors were encountered: