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

Version 1.95 does not connect to the container with distrobox #10426

Closed
devaex opened this issue Oct 30, 2024 · 11 comments
Closed

Version 1.95 does not connect to the container with distrobox #10426

devaex opened this issue Oct 30, 2024 · 11 comments
Assignees
Labels
containers Issue in vscode-remote containers info-needed Issue requires more information from poster new release

Comments

@devaex
Copy link

devaex commented Oct 30, 2024

Does this issue occur when all extensions are disabled?: Yes/No

  • VS Code Version: 1.95
  • OS Version: Linux Mint 22 Cinnamon
  • Distrobox with Podman

Steps to Reproduce:

  1. Start ubuntu container with Distrobox
  2. Start VS Code and try to Attach to running container
  3. The vscode dropdown menu list runing "ubuntu" container as always
  4. But dont connect and displays a message stating that the "ubuntu" container does not exist.

It worked perfectly until version 1.94.

Nothing was done other than updating vscode to 1.95

What was attempted to solve:

  • Uninstall and install version 1.95 again.
  • Uninstall and install the Dev Container extension.
  • Tried with pre-release version of Dev Container

Finally I uninstalled version 1.95 and installed version 1.94 and it worked as usual again.

@chrmarti
Copy link
Contributor

Please append the Dev Containers log from when this happens. (F1 > Dev Containers: Show Container Log)

@chrmarti chrmarti added the info-needed Issue requires more information from poster label Oct 31, 2024
@chrmarti chrmarti transferred this issue from microsoft/vscode Oct 31, 2024
@chrmarti chrmarti added the containers Issue in vscode-remote containers label Oct 31, 2024
@devaex
Copy link
Author

devaex commented Nov 1, 2024

Updated to last version and same error.

Version: 1.95.1
Commit: 65edc4939843c90c34d61f4ce11704f09d3e5cb6
Date: 2024-10-31T05:14:54.222Z
Electron: 32.2.1
ElectronBuildId: 10427718
Chromium: 128.0.6613.186
Node.js: 20.18.0
V8: 12.8.374.38-electron.0
OS: Linux x64 6.8.0-47-generic

Dev container settings pointing to podman:

Image

Try to Attach to running container, it lists ubuntu container:

Image

But inform that ubuntu container not exists:

Image

Dev container logs

[47 ms] Dev Containers 0.389.0 in VS Code 1.95.1 (65edc4939843c90c34d61f4ce11704f09d3e5cb6).
[47 ms] Start: Resolving Remote
[49 ms] Setting up container: ubuntu
[57 ms] Start: Run: docker inspect --type container ubuntu
[22875 ms] Getting Docker parameters for own remote.
[22928 ms] Start: Run: podman version --format {{json .}}
[22967 ms] {"Client":{"APIVersion":"4.9.3","Version":"4.9.3","GoVersion":"go1.22.2","GitCommit":"","BuiltTime":"Wed Dec 31 21:00:00 1969","Built":0,"OsArch":"linux/amd64","Os":"linux"}}
[22975 ms] Start: Run: podman ps -q
[23025 ms] Start: Run: podman inspect --type container 71da887f2f6e

The logs stop at this point and no new feedback is returned.

@devaex
Copy link
Author

devaex commented Nov 1, 2024

Some more info:

  • I don't have docker installed, only podman.
  • The image used to create the container is "docker.io/library/ubuntu..." it always worked with distrobox + podman.
  • Works normally when going back to version 1.94

@devaex
Copy link
Author

devaex commented Nov 1, 2024

Logs of version 1.94 that connect with success.

[56 ms] Dev Containers 0.389.0 in VS Code 1.94.2 (384ff7382de624fb94dbaf6da11977bba1ecd427).
[54 ms] Start: Resolving Remote
[59 ms] Setting up container: ubuntu
[68 ms] Start: Run: podman inspect --type container ubuntu
[149 ms] Start: Check Docker is running
[150 ms] Start: Run: podman version
[179 ms] Client:       Podman Engine
Version:      4.9.3
API Version:  4.9.3
Go Version:   go1.22.2
Built:        Wed Dec 31 21:00:00 1969
OS/Arch:      linux/amd64
[183 ms] Running Dev Containers CLI:   set-up --container-id 71da887f2f6e60f5dead7ad76d39e0c14f68c8fe39c3c4da868d52c2a2bdb26f --user-data-folder /home/******/.config/Code/User/globalStorage/ms-vscode-remote.remote-containers/data --docker-path podman --container-session-data-folder /tmp/devcontainers-f014c4fb-52e8-43cd-a4e8-e63ef78f75091730469247094 --log-level debug --log-format json --config /home/******/.config/Code/User/globalStorage/ms-vscode-remote.remote-containers/imageConfigs/docker.io%2flibrary%2fubuntu%3a22.04.json --default-user-env-probe loginInteractiveShell --skip-post-create --include-configuration --include-merged-configuration
[184 ms] Start: Run: /usr/share/code/code /home/******/.vscode/extensions/ms-vscode-remote.remote-containers-0.389.0/dist/spec-node/devContainersSpecCLI.js set-up --container-id 71da887f2f6e60f5dead7ad76d39e0c14f68c8fe39c3c4da868d52c2a2bdb26f --user-data-folder /home/******/.config/Code/User/globalStorage/ms-vscode-remote.remote-containers/data --docker-path podman --container-session-data-folder /tmp/devcontainers-f014c4fb-52e8-43cd-a4e8-e63ef78f75091730469247094 --log-level debug --log-format json --config /home/******/.config/Code/User/globalStorage/ms-vscode-remote.remote-containers/imageConfigs/docker.io%2flibrary%2fubuntu%3a22.04.json --default-user-env-probe loginInteractiveShell --skip-post-create --include-configuration --include-merged-configuration
[482 ms] @devcontainers/cli 0.71.0. Node.js v20.16.0. linux 6.8.0-47-generic x64.
[482 ms] Start: Run: podman buildx version
[567 ms] buildah 1.33.7
[568 ms] 
[568 ms] Start: Run: podman -v
[596 ms] Start: Run: podman inspect --type container 71da887f2f6e60f5dead7ad76d39e0c14f68c8fe39c3c4da868d52c2a2bdb26f
[653 ms] Start: Inspecting container
[653 ms] Start: Run: podman inspect --type container 71da887f2f6e60f5dead7ad76d39e0c14f68c8fe39c3c4da868d52c2a2bdb26f
[713 ms] Start: Run in container: /bin/sh
[716 ms] Start: Run in container: uname -m
[802 ms] x86_64
[802 ms] 
[802 ms] Start: Run in container: (cat /etc/os-release || cat /usr/lib/os-release) 2>/dev/null
[804 ms] PRETTY_NAME="Ubuntu 22.04.5 LTS"
NAME="Ubuntu"
VERSION_ID="22.04"
VERSION="22.04.5 LTS (Jammy Jellyfish)"
VERSION_CODENAME=jammy
ID=ubuntu
ID_LIKE=debian
HOME_URL="https://www.ubuntu.com/"
SUPPORT_URL="https://help.ubuntu.com/"
BUG_REPORT_URL="https://bugs.launchpad.net/ubuntu/"
PRIVACY_POLICY_URL="https://www.ubuntu.com/legal/terms-and-policies/privacy-policy"
UBUNTU_CODENAME=jammy
[804 ms] 
[805 ms] Start: Run in container:  (command -v getent >/dev/null 2>&1 && getent passwd 'root' || grep -E '^root|^[^:]*:[^:]*:root:' /etc/passwd || true)
[811 ms] Start: Run in container: test -f '/var/devcontainer/.patchEtcEnvironmentMarker'
[814 ms] 
[814 ms] 
[814 ms] Start: Run in container: test -f '/var/devcontainer/.patchEtcProfileMarker'
[815 ms] 
[815 ms] 
[830 ms] Start: Inspecting container
[831 ms] Start: Run: podman inspect --type container 71da887f2f6e60f5dead7ad76d39e0c14f68c8fe39c3c4da868d52c2a2bdb26f
[918 ms] Start: Run in container: /bin/sh
[927 ms] Start: Run in container: uname -m
[1034 ms] x86_64
[1035 ms] 
[1035 ms] Start: Run in container: (cat /etc/os-release || cat /usr/lib/os-release) 2>/dev/null
[1037 ms] PRETTY_NAME="Ubuntu 22.04.5 LTS"
NAME="Ubuntu"
VERSION_ID="22.04"
VERSION="22.04.5 LTS (Jammy Jellyfish)"
VERSION_CODENAME=jammy
ID=ubuntu
ID_LIKE=debian
HOME_URL="https://www.ubuntu.com/"
SUPPORT_URL="https://help.ubuntu.com/"
BUG_REPORT_URL="https://bugs.launchpad.net/ubuntu/"
PRIVACY_POLICY_URL="https://www.ubuntu.com/legal/terms-and-policies/privacy-policy"
UBUNTU_CODENAME=jammy
[1037 ms] 
[1038 ms] Start: Run in container:  (command -v getent >/dev/null 2>&1 && getent passwd 'root' || grep -E '^root|^[^:]*:[^:]*:root:' /etc/passwd || true)
[1043 ms] Start: Run in container: test -d '/home/******/distrobox/ubuntu/.vscode-server'
[1045 ms] 
[1046 ms] 
[1046 ms] Start: Run in container: test ! -f '/home/******/distrobox/ubuntu/.vscode-server/data/Machine/.writeMachineSettingsMarker' && set -o noclobber && mkdir -p '/home/******/distrobox/ubuntu/.vscode-server/data/Machine' && { > '/home/******/distrobox/ubuntu/.vscode-server/data/Machine/.writeMachineSettingsMarker' ; } 2> /dev/null
[1048 ms] 
[1048 ms] 
[1048 ms] Exit code 1
[1048 ms] Start: Run in container: cat /home/******/distrobox/ubuntu/.vscode-server/data/Machine/settings.json
[1049 ms] 
[1050 ms] cat: /home/******/distrobox/ubuntu/.vscode-server/data/Machine/settings.json: No such file or directory
[1050 ms] Exit code 1
[1050 ms] Start: Run in container: test -d '/home/******/distrobox/ubuntu/.vscode-server/bin/384ff7382de624fb94dbaf6da11977bba1ecd427'
[1051 ms] 
[1051 ms] 
[1051 ms] Start: Run in container: test -x '/home/******/distrobox/ubuntu/.vscode-server/bin/384ff7382de624fb94dbaf6da11977bba1ecd427/bin/helpers/check-requirements.sh'
[1052 ms] 
[1052 ms] 
[1052 ms] Start: Run in container: '/home/******/distrobox/ubuntu/.vscode-server/bin/384ff7382de624fb94dbaf6da11977bba1ecd427/bin/helpers/check-requirements.sh'
[1100 ms] 
[1101 ms] 
[1101 ms] Start: Launching Dev Containers helper.
[1102 ms] ssh-agent: SSH_AUTH_SOCK in container (/tmp/vscode-ssh-auth-ab974463-e99d-49e5-a7e8-939a3e92bad6.sock) forwarded to local host (/run/user/1000/keyring/ssh).
[1103 ms] Start: Run in container: test -e /tmp/.X11-unix/X0
[1105 ms] 
[1105 ms] 
[1106 ms] Start: Run in container: test -e /tmp/.X11-unix/X1
[1108 ms] 
[1108 ms] 
[1108 ms] Start: Run in container: test -e /tmp/.X11-unix/X2
[1109 ms] 
[1110 ms] 
[1110 ms] Start: Run in container: test -e /tmp/.X11-unix/X3
[1111 ms] 
[1112 ms] 
[1112 ms] Exit code 1
[1113 ms] Start: Run in container: mkdir -p '/tmp/.X11-unix'
[1117 ms] 
[1117 ms] 
[1117 ms] X11 forwarding: DISPLAY in container (:3) forwarded to local host (:0).
[1118 ms] Start: Run in container: gpgconf --list-dirs
[1119 ms] sysconfdir:/etc/gnupg
bindir:/usr/bin
libexecdir:/usr/lib/gnupg
libdir:/usr/lib/x86_64-linux-gnu/gnupg
datadir:/usr/share/gnupg
localedir:/usr/share/locale
socketdir:/home/******/distrobox/ubuntu//.gnupg
dirmngr-socket:/home/******/distrobox/ubuntu//.gnupg/S.dirmngr
agent-ssh-socket:/home/******/distrobox/ubuntu//.gnupg/S.gpg-agent.ssh
agent-extra-socket:/home/******/distrobox/ubuntu//.gnupg/S.gpg-agent.extra
agent-browser-socket:/home/******/distrobox/ubuntu//.gnupg/S.gpg-agent.browser
agent-socket:/home/******/distrobox/ubuntu//.gnupg/S.gpg-agent
homedir:/home/******/distrobox/ubuntu//.gnupg
[1119 ms] 
[1120 ms] Start: Run in container: ls '/home/******/distrobox/ubuntu//.gnupg/private-keys-v1.d' 2>/dev/null
[1123 ms] 
[1123 ms] 
[1123 ms] Exit code 2
[1124 ms] Start: Run: gpgconf --list-dirs
[1132 ms] sysconfdir:/etc/gnupg
bindir:/usr/bin
libexecdir:/usr/lib/gnupg
libdir:/usr/lib/x86_64-linux-gnu/gnupg
datadir:/usr/share/gnupg
localedir:/usr/share/locale
socketdir:/run/user/1000/gnupg
dirmngr-socket:/run/user/1000/gnupg/S.dirmngr
keyboxd-socket:/run/user/1000/gnupg/S.keyboxd
agent-ssh-socket:/run/user/1000/gnupg/S.gpg-agent.ssh
agent-extra-socket:/run/user/1000/gnupg/S.gpg-agent.extra
agent-browser-socket:/run/user/1000/gnupg/S.gpg-agent.browser
agent-socket:/run/user/1000/gnupg/S.gpg-agent
homedir:/home/******/.gnupg
[1132 ms] 
[1132 ms] Start: Run in container: test -f '/home/******/distrobox/ubuntu/.gnupg/pubring.kbx'
[1133 ms] 
[1133 ms] 
[1133 ms] Exit code 1
[1133 ms] Start: Run in container: test -f '/home/******/distrobox/ubuntu/.gnupg/pubring.gpg'
[1134 ms] 
[1134 ms] 
[1134 ms] Exit code 1
[1134 ms] Start: Run in container: test -f '/home/******/distrobox/ubuntu/.gnupg/trustdb.gpg'
[1135 ms] 
[1135 ms] 
[1135 ms] Exit code 1
[1136 ms] Start: Run in container: mkdir -p -m 700 '/home/******/distrobox/ubuntu//.gnupg'
[1136 ms] gpg-agent: Socket in container (/home/******/distrobox/ubuntu//.gnupg/S.gpg-agent) forwarded to local host (/run/user/1000/gnupg/S.gpg-agent.extra).
[1137 ms] 
[1137 ms] 
[1137 ms] Start: Run in container: command -v docker >/dev/null 2>&1
[1138 ms] 
[1139 ms] 
[1139 ms] Exit code 127
[1141 ms] Start: Run in container: /bin/sh
[1153 ms] userEnvProbe: loginInteractiveShell (default)
[1153 ms] Start: Run in container: test -f '/tmp/devcontainers-f014c4fb-52e8-43cd-a4e8-e63ef78f75091730469247094/env-loginInteractiveShell.json'
[1153 ms] Start: Run in container: echo ~
[1154 ms] Start: Run: gpg-connect-agent updatestartuptty /bye
[1169 ms] 
[1170 ms] 
[1170 ms] Exit code 1
[1170 ms] userEnvProbe: not found in cache
[1171 ms] userEnvProbe shell: bash
[1175 ms] Start: Run in container: # Test for /home/******/distrobox/ubuntu/.ssh/known_hosts and ssh
[1176 ms] /home/******/distrobox/ubuntu/.ssh/known_hosts exists
[1177 ms] 
[1177 ms] Exit code 1
[1179 ms] Start: Run in container: command -v git >/dev/null 2>&1 && git config --system --replace-all credential.helper '!f() { /home/******/distrobox/ubuntu/.vscode-server/bin/384ff7382de624fb94dbaf6da11977bba1ecd427/node /tmp/vscode-remote-containers-ab974463-e99d-49e5-a7e8-939a3e92bad6.js git-credential-helper $*; }; f' || true
[1181 ms] 
[1182 ms] 
[1183 ms] Start: Run in container: for pid in `cd /proc && ls -d [0-9]*`; do { echo $pid ; readlink /proc/$pid/cwd || echo ; readlink /proc/$pid/ns/mnt || echo ; cat /proc/$pid/stat | tr "
[1288 ms] /home/******/distrobox/ubuntu/
[1291 ms] 
[1291 ms] Start: Run in container: cat <<'EOF-/tmp/vscode-remote-containers-ab974463-e99d-49e5-a7e8-939a3e92bad6.js' >/tmp/vscode-remote-containers-ab974463-e99d-49e5-a7e8-939a3e92bad6.js
[1296 ms] 
[1297 ms] 
[1297 ms] Start: Run in container: cat <<'EOF-/tmp/vscode-remote-containers-server-ab974463-e99d-49e5-a7e8-939a3e92bad6.js' >/tmp/vscode-remote-containers-server-ab974463-e99d-49e5-a7e8-939a3e92bad6.js_1730469249585
[1302 ms] 
[1302 ms] 
[1964 ms] userEnvProbe PATHs:
Probe:     '/home/******/distrobox/ubuntu//.config/nvm/versions/node/v23.0.0/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin'
Container: '/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin'
Merged:    '/home/******/distrobox/ubuntu//.config/nvm/versions/node/v23.0.0/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin'
[3020 ms] Start: Run in container: mkdir -p '/tmp/devcontainers-f014c4fb-52e8-43cd-a4e8-e63ef78f75091730469247094' && cat > '/tmp/devcontainers-f014c4fb-52e8-43cd-a4e8-e63ef78f75091730469247094/env-loginInteractiveShell.json' << 'envJSON'
[3024 ms] 
[3024 ms] 
[3024 ms] Start: Run in container: cat '/home/******/distrobox/ubuntu/.vscode-server/bin/384ff7382de624fb94dbaf6da11977bba1ecd427/product.json'
[3030 ms] Extension host agent is already running.
[3030 ms] Start: Run in container: cat '/home/******/distrobox/ubuntu/.vscode-server/data/Machine/.devport-384ff7382de624fb94dbaf6da11977bba1ecd427' 2>/dev/null
[3032 ms] 41755
[3032 ms] 
[3032 ms] Start: Run in container: cat '/home/******/distrobox/ubuntu/.vscode-server/data/Machine/.connection-token-384ff7382de624fb94dbaf6da11977bba1ecd427'
[3033 ms] 1378e5b2-6634-40e4-842b-4d6c47aa8e72
[3033 ms] 
[3033 ms] Port forwarding for container port 41755 starts listening on local port.
[3034 ms] Port forwarding local port 34969 to container port 41755
[3034 ms] Start: Run in container: /bin/sh -c # Watch installed extensions
[3034 ms] Start: Run in container: /bin/sh -c # Watch machine settings
[3054 ms] Initializing configuration support...
[3054 ms] Internal initialization of dev container support package...
[3066 ms] Start: Run in container: command -v git >/dev/null 2>&1 && git config --global --replace-all credential.helper '!f() { /home/******/distrobox/ubuntu/.vscode-server/bin/384ff7382de624fb94dbaf6da11977bba1ecd427/node /tmp/vscode-remote-containers-ab974463-e99d-49e5-a7e8-939a3e92bad6.js git-credential-helper $*; }; f' || true
[3077 ms] 
[3077 ms] 
[3084 ms] Port forwarding connection from 48702 > 34969 > 41755 in the container.
[3086 ms] Start: Run in container: /home/******/distrobox/ubuntu/.vscode-server/bin/384ff7382de624fb94dbaf6da11977bba1ecd427/node -e 
[3268 ms] Port forwarding 48702 > 34969 > 41755 stderr: Connection established
[3282 ms] Port forwarding connection from 48710 > 34969 > 41755 in the container.
[3283 ms] Start: Run in container: /home/******/distrobox/ubuntu/.vscode-server/bin/384ff7382de624fb94dbaf6da11977bba1ecd427/node -e 
[3492 ms] Port forwarding 48710 > 34969 > 41755 stderr: Connection established
[5713 ms] Start: Run in container: cat /proc/23585/environ

@mlawson27
Copy link

mlawson27 commented Nov 4, 2024

Mentioned this in a comment on an issue in the main VSCode GitHub, but do you have a profile enabled? For me this issue appears to be because the “applies to all profile” settings appear to not be getting applied across profiles in 1.95, so 1.95 tries to take your docker path from the profile (which is empty, so it defaults to docker) and not the top level.

If this applies to you as well, switching back to the default profile works around the issue (at least it does for me), and editing the profile’s .json file and putting the relevant top-level settings in there also works (you just have to remember to take them back out once the issue is fixed).

@devaex
Copy link
Author

devaex commented Nov 4, 2024

@mlawson27

Great find. I confirm that this solves the problem and it must certainly be something related to the scope of the settings.

What I did:

  • I didn't change the profile to the default. I continued on my profile.
  • F1 -> Preferences: Open User settings (JSON).
  • Put "dev.containers.dockerPath": "podman" in settings.
  • Vscode warned that this configuration is out of scope but I ignored it.
  • Try to attach to the container, and the connection was made as always.

Thank you for mentioning the answer in this issue.

@joshspicer
Copy link
Member

I am able to repro a similar settings issue in the Remote - SSH extension (doesn't repro in 1.94.2). See microsoft/vscode#232602 (comment)

@chrmarti
Copy link
Contributor

@devaex @mlawson27 The fix for microsoft/vscode#232602 is available in today's VS Code Insiders (https://code.visualstudio.com/insiders/). Could you give that a try and let us know if it fixes the problem? Thanks!

/cc @sandy081

@devaex
Copy link
Author

devaex commented Nov 12, 2024

@chrmarti I confirm that the Insiders version fixed the problem.

Thanks for attention.

@devaex devaex closed this as completed Nov 12, 2024
@devaex
Copy link
Author

devaex commented Dec 13, 2024

This error returned in version 1.96.
Very frustrating.

The same workarround can be used:

  • F1 -> Preferences: Open User settings (JSON).
  • Put "dev.containers.dockerPath": "podman" in settings.
  • Vscode warned that this configuration is out of scope but I ignored it.
  • Try to attach to the container, and the connection was made as always.

@devaex devaex reopened this Dec 13, 2024
@devaex devaex changed the title Version 1.95 does not connect to the container with distrobox Version 1.96 does not connect to the container with distrobox Dec 13, 2024
@devaex devaex changed the title Version 1.96 does not connect to the container with distrobox Version 1.95 does not connect to the container with distrobox Dec 13, 2024
@devaex
Copy link
Author

devaex commented Dec 13, 2024

Opened new one:
#10562

And closing this.

@devaex devaex closed this as completed Dec 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
containers Issue in vscode-remote containers info-needed Issue requires more information from poster new release
Projects
None yet
Development

No branches or pull requests

4 participants