microsoft / vscode-docker

Docker Extension for Visual Studio Code
https://marketplace.visualstudio.com/items?itemName=ms-azuretools.vscode-docker
Other
1.21k stars 514 forks source link

Docker extension repeatedly uninstalls itself, then won't connect when installed #4389

Open mark-turner opened 2 days ago

mark-turner commented 2 days ago

I have repeatedly installed Docker extension version 1.29.2 in VS Code Version 1.93.1 on macOS Sonoma 14.6.1 on M1 hardware. It works for a short while (less than an hour), then at some point disappears from the VS Code sidebar and the following message reappears:

"Do you want to install the recommended 'Docker' extension from Microsoft for the Docker language?"

After agreeing to reinstall, I get the message "Docker is not installed. Would you like to learn more about installing Docker?" even though Docker is installed and running the whole while this is going on.

The issue sounds similar to https://github.com/microsoft/vscode-docker/issues/4317 and https://github.com/microsoft/vscode-docker/issues/4227 which were both closed without resolution.

I have tried manually setting the docker executable path as described here, but it makes no difference.

When the extension is reinstalled an running, I get this message, even though Docker Desktop is running and the container is running:

Screenshot 2024-09-24 at 16 33 34

Screenshot 2024-09-24 at 16 35 04

This is a new issue, as I have been running Docker and the Docker Extension without problems until recently.

bwateratmsft commented 2 days ago

The extension uninstalling itself is definitely a VSCode issue--that absolutely should not be happening. I'll file a VSCode issue for that one.

For the other issue--not detecting that Docker is installed even though it is--is there anything in the Output tab -> "Docker" output log?

bwateratmsft commented 2 days ago

Created https://github.com/microsoft/vscode/issues/229566 for the self-uninstall issue.

mark-turner commented 2 days ago

Hi @bwateratmsft thanks for your help! The Output tab is empty. So is the Problems tab. But the terminal tab is actually connected and logged in to the docker workspace volume. I can run commands there, even though the Docker extension thinks there is no connection.

Screenshot 2024-09-24 at 21 19 14

bwateratmsft commented 2 days ago

Is this using a remote connection like SSH remoting? Or Dev Containers?

mark-turner commented 2 days ago

No, the container is running locally on the same computer.

On Tue, Sep 24, 2024 at 21:30 Brandon Waterloo [MSFT] < @.***> wrote:

Is this using a remote connection like SSH remoting https://code.visualstudio.com/docs/remote/ssh?

— Reply to this email directly, view it on GitHub https://github.com/microsoft/vscode-docker/issues/4389#issuecomment-2372192042, or unsubscribe https://github.com/notifications/unsubscribe-auth/AFOPXATN3DCG5JNFNIEIGNTZYG4WJAVCNFSM6AAAAABOYPDAPSVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDGNZSGE4TEMBUGI . You are receiving this because you authored the thread.Message ID: @.***>

bwateratmsft commented 2 days ago

If you open a terminal in VSCode on the host machine (not the terminal attached to the container), and execute a Docker command like docker -v, what do you see?

mark-turner commented 1 day ago

I see this:

[Wed Sep 25 13:49] ~ $ docker -v
Docker version 27.2.0, build 3ab4256
bwateratmsft commented 1 day ago

This is probably the endless Mac PATH environment variable issue then. Can you try the following to see if the PATH contains what it's supposed to?

  1. In the terminal, run which docker and share the path that it says Docker is located at.

  2. In VSCode, go to the Output tab, and then to Docker's output log.

  3. Click the little gear icon next to the dropdown, and change Docker's output log level to Trace.Image

  4. This should output a bunch of information and environment variables, etc. Please redact whatever you need to but share what you can from that output.

mark-turner commented 1 day ago

Hi @bwateratmsft. My docker binary is located at /usr/local/bin/docker FYI, I changed the Docker Path setting to this (from just "docker") but it made no difference.

Screenshot 2024-09-25 at 18 41 12

Here is the trace output:

2024-09-24 14:32:52.377 [error] Failed to set up event listener: spawn docker ENOENT
2024-09-25 16:36:33.024 [debug] --- Process Environment (28) ---
2024-09-25 16:36:33.024 [debug] NODE_VERSION: 20.17.0
2024-09-25 16:36:33.024 [debug] HOSTNAME: xyz
2024-09-25 16:36:33.024 [debug] YARN_VERSION: 1.22.22
2024-09-25 16:36:33.024 [debug] HOME: /root
2024-09-25 16:36:33.024 [debug] NVM_SYMLINK_CURRENT: true
2024-09-25 16:36:33.024 [debug] NVM_DIR: /usr/local/share/nvm
2024-09-25 16:36:33.024 [debug] PATH: /usr/local/share/nvm/current/bin:/usr/local/share/nvm/versions/node/v20.17.0/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
2024-09-25 16:36:33.024 [debug] VSCODE_AGENT_FOLDER: /root/.vscode-server
2024-09-25 16:36:33.024 [debug] SHELL: /bin/bash
2024-09-25 16:36:33.024 [debug] PWD: xyz
2024-09-25 16:36:33.024 [debug] VSCODE_CWD: xyz
2024-09-25 16:36:33.024 [debug] VSCODE_NLS_CONFIG: {"userLocale":"en","osLocale":"en","resolvedLanguage":"en","defaultMessagesFile":"/vscode/vscode-server/bin/linux-arm64/xyz/out/nls.messages.json","locale":"en","availableLanguages":{}}
2024-09-25 16:36:33.024 [debug] VSCODE_HANDLES_SIGPIPE: true
2024-09-25 16:36:33.024 [debug] VSCODE_AMD_ENTRYPOINT: vs/workbench/api/node/extensionHostProcess
2024-09-25 16:36:33.024 [debug] VSCODE_HANDLES_UNCAUGHT_ERRORS: true
2024-09-25 16:36:33.024 [debug] NVM_INC: /usr/local/share/nvm/versions/node/v20.17.0/include/node
2024-09-25 16:36:33.024 [debug] REMOTE_CONTAINERS_IPC: /tmp/vscode-remote-containers-ipc-xyz.sock
2024-09-25 16:36:33.024 [debug] REMOTE_CONTAINERS_SOCKETS: ["/tmp/vscode-ssh-auth-xyz.sock"]
2024-09-25 16:36:33.024 [debug] SHLVL: 1
2024-09-25 16:36:33.024 [debug] NVM_CD_FLAGS: 
2024-09-25 16:36:33.025 [debug] NVM_BIN: /usr/local/share/nvm/versions/node/v20.17.0/bin
2024-09-25 16:36:33.025 [debug] _: /usr/bin/cat
2024-09-25 16:36:33.025 [debug] SSH_AUTH_SOCK: /tmp/vscode-ssh-auth-xyz.sock
2024-09-25 16:36:33.025 [debug] REMOTE_CONTAINERS: true
2024-09-25 16:36:33.025 [debug] BROWSER: /vscode/vscode-server/bin/linux-arm64/xyz40/bin/helpers/browser.sh
2024-09-25 16:36:33.025 [debug] ELECTRON_RUN_AS_NODE: 1
2024-09-25 16:36:33.025 [debug] VSCODE_IPC_HOOK_CLI: /tmp/vscode-ipc-xyz.sock
2024-09-25 16:36:33.025 [debug] VSCODE_L10N_BUNDLE_LOCATION: 
2024-09-25 16:36:33.025 [debug] --- Docker Environment (0) ---
danegsta commented 1 day ago

That particular setting only controls the behavior for the Dev Containers extension; can you try updating the docker.dockerPath setting as well and see if that works?

SusanWhiteUTK commented 18 hours ago

I am following this thread as I have the same issue. I have updated the docker.dockerPath everywhere it was showing as an option in vscode. My setup is an M1 ultra on Sonoma 14.6.1. Open to any additional suggestions please. To clarify, the inability to recognize docker inside the docker extension is the same. The docker extension doesn't reinstall itself as far as I can tell.