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 exe missing from path issue (MacOS) (again) #2894

Closed
HannesOberreiter opened this issue Apr 23, 2021 · 26 comments
Closed

docker exe missing from path issue (MacOS) (again) #2894

HannesOberreiter opened this issue Apr 23, 2021 · 26 comments
Milestone

Comments

@HannesOberreiter
Copy link

Description:
Docker executable cannot be found. It throws following error:

exec: "com.docker.cli": executable file not found in $PATH

This problem was previously reported and fixed. It worked for me without any problems for a few weeks. Now it is broken again (at least for me).

Previous Discussion:
#2578

Discussion on Docker:
docker-archive/compose-cli#754

Discussion of possible fixed on Stackoverflow:
https://stackoverflow.com/questions/64120020/exec-com-docker-cli-executable-file-not-found-in-path


What I tried so far to fix it again:

  • reinstall docker and cli
  • reinstall vscode-docker
  • (rebooting)

Versions:

vscode-Docker: 1.12.1
Docker Engie: 20.10.5
Docker Desktop: 3.3.1
macOS Big Sur, 11.2.3 (Intel)

My results from PATH Checking:

PATHS

Cheers
Hannes

@karolz-ms
Copy link
Contributor

@HannesOberreiter sorry to hear that. Did you try disabling "cloud experience" in Docker Desktop, as described by docker-archive/compose-cli#754 (comment). ?

@HannesOberreiter
Copy link
Author

@karolz-ms the option was removed I think with version 3.2.x.

Cheers
Hannes

@karolz-ms
Copy link
Contributor

I see. Hmm. Bummer.

Could you do us a favor and do the following troubleshooting:

  1. Try to reproduce the issue. Do not close the VS Code terminal that reports Docker exe not found error.
  2. Find the PID of the terminal process that reported the error (it will be one of the VS Code processes that has --type=ptyHost argument applied)
  3. Do ps eww <PID> on that process and report if the PATH environment variable contains /usr/local/bin.

Thank you!

@HannesOberreiter
Copy link
Author

HannesOberreiter commented Apr 23, 2021

@karolz-ms sure.

It is included in the PATH env.

image

@LeaveMyYard
Copy link

I can confirm to have the same issue, both on macOS Big Sur on Intel chip and on macOS Big Sur on Apple chip.

Maybe it is possible to disable "cloud experience" from terminal?

@karolz-ms
Copy link
Contributor

@HannesOberreiter @LeaveMyYard thank you Could you also please share the exact repro steps so we can be sure we are all looking at the same codepath?

@HannesOberreiter
Copy link
Author

HannesOberreiter commented Apr 26, 2021

@karolz-ms is this video sufficient or you need more?

repo.mp4

@karolz-ms
Copy link
Contributor

@HannesOberreiter thank you, yes, that is very clear

I have found several VS Code issues that look similar, although do not involve Docker microsoft/vscode#107169 microsoft/vscode#108003 dotnet/vscode-csharp#4037 Someone mentioned that Developer: reload window gesture seems to fix at least some extension. Can you try and report whether that is a good workaround?

@HannesOberreiter
Copy link
Author

@karolz-ms, thanks for your research. The mentioned Developer: reload window did not help. Opening VSCode from Application and not via Terminal did also not help.

@RobYed
Copy link

RobYed commented Apr 27, 2021

I stumbled across this issue by accident. I can add to this discussion that this problem also exists in IntelliJ on MacOS Big Sur (Intel) with Docker Desktop since version 3.3.1. So maybe this is a Docker CLI issue and not vscode related?

@LeaveMyYard
Copy link

@HannesOberreiter @LeaveMyYard thank you Could you also please share the exact repro steps so we can be sure we are all looking at the same codepath?

Also, docker-compose is working fine (except starting containers, because at some points it seems to run a docker command, that ends up in an error). Hope it will help.

bug.report.mov

@karolz-ms
Copy link
Contributor

Thank you @RobYed and @LeaveMyYard

I am pretty sure this is not a VS Code Docker extension issue, and the fact that disabling "cloud experience" in Docker Desktop used to be a viable workaround makes me think it is not a VS Code core issue either. Unfortunately the workaround we added earlier this year #2619 does not seem to help

I have pinged my buddies at Docker, will see what they say. We might need to consider some other workarounds in our code as proposed in #2578 ...

@alanmazuco
Copy link

alanmazuco commented Apr 28, 2021

The problem also exists with git Bash:
"com.docker.cli": executable file not found in %PATH%
On Windows Power Shell it works fine.

@dbreshears dbreshears added this to the 1.13.0 milestone Apr 28, 2021
@dbreshears dbreshears modified the milestones: 1.13.0, 1.14.0 May 12, 2021
@abhishekdubey94
Copy link

The problem also exists with git Bash:
"com.docker.cli": executable file not found in %PATH%
On Windows Power Shell it works fine.

I also faced the same issue on some other machine, where I can run the docker command on windows cmd or PowerShell,
but not on git bash.
But I found that we can run the docker commands with com.docker.cli on git bash.. it is working.. for example
docker ps was giving me an error while com.docker.cli ps was running fine on git bash...
Surprisingly, I am running the same docker-desktop version but I am not facing that issue... but some on some other machine I faced.

@rtmulpuri
Copy link

rtmulpuri commented May 25, 2021

I am facing similar situation as well. When I try to attach to docker shell through vscode, I get the following error message

Executing task: docker exec -it docker_hash bash <

exec: "com.docker.cli": executable file not found in $PATH
The terminal process "/bin/zsh '-c', 'docker exec -it docker_hash bash'" terminated with exit code: 1.

@jtinsky
Copy link

jtinsky commented Jun 1, 2021

+1 on this issue.

@imranblugate
Copy link

Same issue when trying to run the docker image from VSCode.

Executing task: docker run --rm -d -p 8000:8000/tcp dockervscode:latest <

exec: "com.docker.cli": executable file not found in $PATH
The terminal process "/bin/zsh '-c', 'docker run --rm -d -p 8000:8000/tcp dockervscode:latest'" terminated with exit code: 1.

Terminal will be reused by tasks, press any key to close it.

@ghost
Copy link

ghost commented Jun 2, 2021

same issue here

@karolz-ms karolz-ms self-assigned this Jun 2, 2021
@dstran
Copy link

dstran commented Jun 3, 2021

The workaround for me is to use the Mac Terminal instead of the integrated terminal in VS Code.

macOS Big Sur version 11.4, Intel
docker desktop version 3.3.3 (64133)
VS Code Version: 1.56.2

@karolz-ms
Copy link
Contributor

I am planning to add a setting (docker.dockerPath) that will allow one to specify where exactly VS Code should look for Docker CLI executable. It is a workaround, but hopefully one that is not too cumbersome. If anyone has thoughts on this, please share!

@HannesOberreiter
Copy link
Author

I would be fine with this "workaround" as I also need to set the locations for other extensions in VSCode (e.g R and LaTeX). That means for Docker I would simply set the bin location, for example in my case /usr/local/bin/Docker

Just curious if you were able to test if the workaround does work? As the error message indicates that the docker command is found but not the connection to com.docker.cli? Which seems strange for me on the first glance, but I also don't understand how everything works, so it could be nothing.

Cheers
Hannes

@karolz-ms
Copy link
Contributor

Hi Hannes, we have implemented similar workarounds for other VS Code extensions that my team owns (e.g. Dapr), so I am quite certain it will work for this extension too.

karolz-ms added a commit that referenced this issue Jun 3, 2021
Provides a workaround for [issue 2894](#2894)
@karolz-ms karolz-ms removed their assignment Jun 3, 2021
@HannesOberreiter
Copy link
Author

@karolz-ms for me and another user (docker-archive/compose-cli#754 (comment)) the issue seems to be fixed with the newest VSCode update.

It could have something to do with following fix (but thats only a rough guess)? microsoft/vscode#108804

Version: 1.57.0
Commit: b4c1bd0a9b03c749ea011b06c6d2676c8091a70c
Date: 2021-06-09T17:22:31.215Z (4 days ago)
Electron: 12.0.9
Chrome: 89.0.4389.128
Node.js: 14.16.0
V8: 8.9.255.25-electron.0
OS: Darwin x64 20.3.0

Cheers
Hannes

@karolz-ms
Copy link
Contributor

@HannesOberreiter possibly. Thanks for letting us know. We will keep the "Docker CLI path" setting just in case.

@karolz-ms
Copy link
Contributor

Workaround has shipped in 1.14 release

@HannesOberreiter
Copy link
Author

@karolz-ms thanks a lot for your work!

@vscodebot vscodebot bot locked and limited conversation to collaborators Aug 5, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests