microsoft / vscode-remote-release

Visual Studio Code Remote Development: Open any folder in WSL, in a Docker container, or on a remote machine using SSH and take advantage of VS Code's full feature set.
https://aka.ms/vscode-remote
Other
3.67k stars 293 forks source link

Dev Containers: Clone repository in container volume fails on ssh remote host #9249

Closed KlausPopp closed 11 months ago

KlausPopp commented 11 months ago

Type: Bug

Steps to reproduce:

Setup:

Execute the following steps:

Results in: Failed to connect to the remote extension host server (Error: Cannot read properties of undefined (reading 'closeRemote'))

Note: It works when I do the "clone repo command" on the local machine.

Terminal log:

[2415 ms] Dev Containers 0.321.0 in VS Code 1.84.2 (1a5daa3a0231a0fbba4f14db7ec463cf99d7768e).
[2415 ms] Start: Resolving Remote
[2434 ms] Start: Run: /bin/sh 
[2458 ms] Start: Run in host: echo ~
[2470 ms] /home/klaus
[2470 ms] 
[2471 ms] Start: Run in host: id -un
[2484 ms] klaus
[2484 ms] 
[2485 ms] Start: Run in host:  (command -v getent >/dev/null 2>&1 && getent passwd 'klaus' || grep -E '^klaus|^[^:]*:[^:]*:klaus:' /etc/passwd || true)
[2499 ms] userEnvProbe: loginInteractiveShell (default)
[2499 ms] userEnvProbe: not found in cache
[2499 ms] userEnvProbe shell: /bin/bash
[2580 ms] userEnvProbe PATHs:
Probe:     '/home/klaus/.local/bin:/home/klaus/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin'
Container: None
[2636 ms] Start: Run: wsl -l -v
[2897 ms] Start: Run: wsl -d Ubuntu -e /bin/sh -c echo ~
[3304 ms] Start: Run: wsl -d Ubuntu -e /bin/sh -c cd '/home/klaus' && /bin/sh
[3325 ms] Start: Run in host: id -un
[3527 ms] klaus
[3528 ms] 
[3528 ms] Start: Run in host:  (command -v getent >/dev/null 2>&1 && getent passwd 'klaus' || grep -E '^klaus|^[^:]*:[^:]*:klaus:' /etc/passwd || true)
[3532 ms] Start: Run in host: echo ~
[3533 ms] /home/klaus
[3534 ms] 
[3534 ms] Start: Run in host: test -x '/home/klaus/.vscode-remote-containers/bin/1a5daa3a0231a0fbba4f14db7ec463cf99d7768e/node'
[3536 ms] 
[3536 ms] 
[3536 ms] Start: Run in host: test -f '/home/klaus/.vscode-remote-containers/dist/vscode-remote-containers-server-0.321.0.js'
[3538 ms] 
[3539 ms] 
[3544 ms] userEnvProbe: loginInteractiveShell (default)
[3544 ms] userEnvProbe: not found in cache
[3545 ms] userEnvProbe shell: /usr/bin/zsh
[5402 ms] userEnvProbe PATHs:
Probe:     '/home/klaus/bin:/home/klaus/go/bin/:usr/local/bin:/usr/local/go/bin:/home/klaus/.local/bin:/home/klaus/.nsc/bin:/home/klaus/.krew/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/usr/lib/wsl/lib:/mnt/c/Python39/Scripts/:/mnt/c/Python39/:/mnt/c/Users/KlausPopp/OpenSSH-Win64:/mnt/c/Program Files (x86)/Common Files/Oracle/Java/javapath:/mnt/c/windows/system32:/mnt/c/windows:/mnt/c/windows/System32/Wbem:/mnt/c/windows/System32/WindowsPowerShell/v1.0/:/mnt/c/WINDOWS/system32:/mnt/c/WINDOWS:/mnt/c/WINDOWS/System32/Wbem:/mnt/c/WINDOWS/System32/WindowsPowerShell/v1.0/:/mnt/c/Program Files (x86)/GitExtensions/:/mnt/c/Program Files/dotnet/:/mnt/c/Program Files/nodejs/:/mnt/c/ProgramData/chocolatey/bin:/mnt/c/Program Files/WireGuard/:/mnt/c/Program Files/PuTTY/:/mnt/c/WINDOWS/System32/OpenSSH/:/mnt/c/Program Files/usbipd-win/:/mnt/c/Program Files/Go/bin:/mnt/c/Program Files (x86)/IVI Foundation/VISA/WinNT/Bin/:/mnt/c/Program Files/IVI Foundation/VISA/Win64/Bin/:/Docker/host/bin:/mnt/c/Program Files (x86)/Tailscale IPN/:/mnt/c/Program Files/Git/cmd:/mnt/c/Users/KlausPopp/AppData/Local/Microsoft/WindowsApps:/mnt/c/Program Files/CMake/bin:/mnt/c/Users/KlausPopp/AppData/Roaming/npm:/mnt/c/Users/KlausPopp/AppData/Local/gitkraken/bin:/mnt/c/Users/KlausPopp/bin:/mnt/c/Users/KlausPopp/AppData/Roaming/Code/User/globalStorage/ms-vscode-remote.remote-containers/cli-bin:/mnt/c/Program Files/heroku/bin:/mnt/c/Users/KlausPopp/go/bin:/mnt/c/Program Files (x86)/Nmap:/mnt/c/Users/KlausPopp/AppData/Local/Programs/Microsoft VS Code/bin:/mnt/c/Users/KlausPopp/AppData/Local/Microsoft/WindowsApps'
Container: None
[5410 ms] Start: Check Docker is running
[5411 ms] Start: Run: docker version --format {{.Server.APIVersion}}
[5480 ms] Server API version: 1.41
[5482 ms] Start: Run: docker volume ls -q
[5551 ms] Start: Run: docker volume create --label vsch.local.repository=https://github.com/devcontainers/templates.git/tree/main --label vsch.local.repository.unique=true --label vsch.local.repository.branch=main templates-main-6164be1c42d15429ad32b7ddaa760f05c5fbe81b8db09b768cc6fa36334f8d03
[5675 ms] Start: Run: docker build -f /tmp/vsch-klaus/bootstrap-image/0.321.0/bootstrap.Dockerfile -t vsc-volume-bootstrap /tmp/vsch-klaus/bootstrap-image/0.321.0
Sending build context to Docker daemon  1.837MB
Step 1/5 : FROM mcr.microsoft.com/devcontainers/base:0-alpine-3.16
                 ---> 2d5db24ffc06
                                  Step 2/5 : RUN echo "@old https://dl-cdn.alpinelinux.org/alpine/v3.15/main" >> /etc/apk/repositories
                                   ---> Using cache
  ---> 993bda88177d
                   Step 3/5 : RUN apk add --no-cache      git-lfs         nodejs  python3         npm       make    g++     docker-cli      docker-cli-buildx         docker-cli-compose      openssh-client-default@old        ;
                          ---> Using cache
                                           ---> b95b79a067fa
          Step 4/5 : RUN cd && npm i node-pty
                                              ---> Using cache
             ---> bee5fd92bc39
                              Step 5/5 : COPY .vscode-remote-containers /root/.vscode-remote-containers
    ---> Using cache
                     ---> 0ecafc743432
                                      Successfully built 0ecafc743432
                   Successfully tagged vsc-volume-bootstrap:latest
                [5813 ms] Cloning Github repository: devcontainers/templates into /workspaces/templates

[5813 ms] Start: Run: docker run -d --mount type=volume,src=templates-main-6164be1c42d15429ad32b7ddaa760f05c5fbe81b8db09b768cc6fa36334f8d03,dst=/workspaces -v /var/run/docker.sock:/var/run/docker.sock vsc-volume-bootstrap sleep infinity
[6227 ms] Start: Run in container: /bin/sh
[6251 ms] Start: Launching Dev Containers helper.
[6268 ms] ssh-agent: SSH_AUTH_SOCK not set on remote host.
[6269 ms] ssh-agent: SSH_AUTH_SOCK not set on local host.
[6269 ms] ssh-agent: SSH_AUTH_SOCK in container (/tmp/vscode-ssh-auth-c9335ea4-d941-4fe9-a123-8d458d5a3c11.sock) forwarded to local host (\\.\pipe\openssh-ssh-agent).
[6269 ms] X11 forwarding: DISPLAY not set on remote host.
[6270 ms] X11 forwarding: DISPLAY not set on local host.
[6270 ms] Start: Run in container: test -e /tmp/.X11-unix/X0
[6372 ms] 
[6372 ms] 
[6373 ms] Exit code 1
[6373 ms] Start: Run in container: mkdir -p '/tmp/.X11-unix'
[6387 ms] 
[6387 ms] 
[6388 ms] X11 forwarding: DISPLAY in container (:0) forwarded to wsl host (:0).
[6388 ms] Start: Run in container: gpgconf --list-dir agent-socket
[6439 ms] /root/.gnupg/S.gpg-agent
[6439 ms] 
[6440 ms] Start: Run in container: gpgconf --list-dir homedir
[6451 ms] /root/.gnupg
[6452 ms] 
[6452 ms] Start: Run in container: ls '/root/.gnupg/private-keys-v1.d' 2>/dev/null
[6467 ms] 
[6467 ms] 
[6468 ms] Exit code 2
[6468 ms] Start: Run: gpgconf --list-dir agent-extra-socket
[6495 ms] /run/user/1002/gnupg/S.gpg-agent.extra
[6496 ms] 
[6496 ms] Start: Run in container: mkdir -p -m 700 '/root/.gnupg'
[6496 ms] gpg-agent: Socket in container (/root/.gnupg/S.gpg-agent) forwarded to remote host (/run/user/1002/gnupg/S.gpg-agent.extra).
[6550 ms] 
[6550 ms] 
[6550 ms] Start: Run in container: command -v docker >/dev/null 2>&1
[6551 ms] Start: Run: gpgconf --list-dir homedir
[6561 ms] 
[6561 ms] 
[6562 ms] Start: Run in container: /bin/sh
[6575 ms] /home/klaus/.gnupg
[6576 ms] 
[6576 ms] Start: Run in container: gpgconf --list-dir homedir
[6584 ms] Start: Run in container: echo ~
[6588 ms] /root/.gnupg
[6588 ms] 
[6642 ms] Start: Run in container: # Test for /root/.gnupg/pubring.kbx and gpg
[6680 ms] 
[6681 ms] 
[6681 ms] Start: Run in container: # Copy /home/klaus/.gnupg/pubring.kbx to /root/.gnupg/pubring.kbx
[6701 ms] 
[6702 ms] 
[6703 ms] /root
[6703 ms] 
[6704 ms] Start: Run in container: cat <<'EOF-/tmp/vscode-remote-containers-c9335ea4-d941-4fe9-a123-8d458d5a3c11.js' >/tmp/vscode-remote-containers-c9335ea4-d941-4fe9-a123-8d458d5a3c11.js
[6714 ms] Start: Run in container: # Test for /root/.gnupg/pubring.gpg and gpg
[6725 ms] 
[6725 ms] 
[6726 ms] Start: Run in container: cat ~/.docker/config.json || echo "{
[6736 ms] 
[6736 ms] 
[6736 ms] Start: Run in container: # Copy /home/klaus/.gnupg/pubring.gpg to /root/.gnupg/pubring.gpg
[6747 ms] {
}
[6748 ms] cat: /root/.docker/config.json: No such file or directory
[6791 ms] 
[6791 ms] 
[6792 ms] Exit code 1
[6792 ms] Start: Run in container: mkdir -p /usr/local/bin && cat <<'EOF-/usr/local/bin/docker-credential-dev-containers-c9335ea4-d941-4fe9-a123-8d458d5a3c11' >/usr/local/bin/docker-credential-dev-containers-c9335ea4-d941-4fe9-a123-8d458d5a3c11
[6807 ms] 
[6807 ms] 
[6808 ms] Start: Run in container: # Test for /root/.gnupg/trustdb.gpg and gpg
[6821 ms] 
[6822 ms] 
[6822 ms] Start: Run in container: chmod +x /usr/local/bin/docker-credential-dev-containers-c9335ea4-d941-4fe9-a123-8d458d5a3c11
[6874 ms] 
[6875 ms] 
[6875 ms] Start: Run in container: # Copy /home/klaus/.gnupg/trustdb.gpg to /root/.gnupg/trustdb.gpg
[6876 ms] Start: Run in container: mkdir -p ~/.docker && cat <<'EOF-/usr/local/bin/docker-credential-dev-containers-c9335ea4-d941-4fe9-a123-8d458d5a3c11' >~/.docker/config.json
[6893 ms] 
[6893 ms] 
[6893 ms] Exit code 1
[6894 ms] 
[6894 ms] 
[6894 ms] Start: Run: gpg-connect-agent updatestartuptty /bye
[6895 ms] Start: Run in container: cat <<'EOF-/tmp/vscode-remote-containers-server-c9335ea4-d941-4fe9-a123-8d458d5a3c11.js' >/tmp/vscode-remote-containers-server-c9335ea4-d941-4fe9-a123-8d458d5a3c11.js_1701113779984
[6921 ms] 
[6921 ms] 
[7000 ms] Start: Run in container: # Test for /root/.gitconfig and git
[7013 ms] 
[7014 ms] 
[7014 ms] Start: Run in container: # Copy /home/klaus/.gitconfig to /root/.gitconfig
[7078 ms] 
[7078 ms] 
[7090 ms] Start: Run in container: # Cleaning up git config
[7110 ms] 
[7111 ms] 
[7111 ms] Start: Run in container: command -v git >/dev/null 2>&1 && git config --global --replace-all credential.helper '!f() { node /tmp/vscode-remote-containers-c9335ea4-d941-4fe9-a123-8d458d5a3c11.js git-credential-helper $*; }; f' || true
[7123 ms] 
[7124 ms] 
[7188 ms] Start: Run in container: # Test for /root/.ssh/known_hosts and ssh
[7201 ms] 
[7202 ms] 
[7202 ms] Start: Run in container: # Copy /home/klaus/.ssh/known_hosts to /root/.ssh/known_hosts
[7229 ms] 
[7229 ms] 
[7334 ms] Start: Run in container: git clone --depth 1 --branch main https://github.com/devcontainers/templates.git .
the input device is not a TTY
                             [7391 ms] Start: Run: docker rm -f ac84138c21d23a47d4f84e099790aa652dac85fa2f67cf220f2c0af6850553c7
[7524 ms] Container server terminated (code: 137, signal: null).

VS Code version: Code 1.84.2 (1a5daa3a0231a0fbba4f14db7ec463cf99d7768e, 2023-11-09T10:51:52.184Z) OS version: Windows_NT x64 10.0.22621 Modes: Remote OS version: Linux x64 5.7.19-050719-generic Remote OS version: Linux x64 5.15.133.1-microsoft-standard-WSL2 Remote OS version: Linux x64 5.7.19-050719-generic Connection to 'Dev Container' could not be established Cannot read properties of undefined (reading 'closeRemote')

System Info |Item|Value| |---|---| |CPUs|Intel(R) Core(TM) i7-10510U CPU @ 1.80GHz (8 x 2304)| |GPU Status|2d_canvas: enabled
canvas_oop_rasterization: enabled_on
direct_rendering_display_compositor: disabled_off_ok
gpu_compositing: enabled
multiple_raster_threads: enabled_on
opengl: enabled_on
rasterization: enabled
raw_draw: disabled_off_ok
video_decode: enabled
video_encode: enabled
vulkan: disabled_off
webgl: enabled
webgl2: enabled
webgpu: enabled| |Load (avg)|undefined| |Memory (System)|31.84GB (6.84GB free)| |Process Argv|--crash-reporter-id 6463a3d8-f7d2-4e1f-8e62-b9b8b0afaa1f| |Screen Reader|no| |VM|0%| |Item|Value| |---|---| |Remote|SSH: devserver2.ci4rail.com| |OS|Linux x64 5.7.19-050719-generic| |CPUs|AMD EPYC 7502P 32-Core Processor (64 x 1520)| |Memory (System)|125.74GB (104.39GB free)| |VM|0%| |Item|Value| |---|---| |Remote|WSL: Ubuntu| |OS|Linux x64 5.15.133.1-microsoft-standard-WSL2| |CPUs|Intel(R) Core(TM) i7-10510U CPU @ 1.80GHz (8 x 2304)| |Memory (System)|15.54GB (11.97GB free)| |VM|0%| |Item|Value| |---|---| |Remote|Dev Container @ devserver2.ci4rail.com| |OS|Linux x64 5.7.19-050719-generic| |CPUs|AMD EPYC 7502P 32-Core Processor (64 x 1497)| |Memory (System)|125.74GB (104.39GB free)| |VM|0%| Connection to 'Dev Container' could not be established Cannot read properties of undefined (reading 'closeRemote')
Extensions (54) Extension|Author (truncated)|Version ---|---|--- systemd-unit-file|coo|1.0.6 mustache|daw|1.1.1 vscode-backstage|Int|0.0.4 kconfig|luv|1.0.3 jupyter-keymap|ms-|1.1.2 remote-containers|ms-|0.321.0 remote-ssh|ms-|0.108.2023110315 remote-ssh-edit|ms-|0.86.0 remote-wsl|ms-|0.81.8 vscode-remote-extensionpack|ms-|0.24.0 remote-explorer|ms-|0.4.1 remote-server|ms-|1.5.0 devicetree|plo|0.1.1 avro|str|0.5.0 tilt|Tch|1.0.9 mako|tom|0.2.0 vscode-icons|vsc|12.6.0 wavetrace|wav|1.1.2 vscode-todo-highlight|way|1.0.5 vscode-openapi|42C|4.18.6 robotcode|d-b|0.66.1 bitbake|Eug|1.1.2 copilot|Git|1.138.0 copilot-chat|Git|0.10.2 vscode-github-actions|git|0.26.2 vscode-pull-request-github|Git|0.76.1 go|gol|0.40.0 todo-tree|Gru|0.0.226 plantuml|jeb|2.17.5 l13-diff|L13|1.3.4 git-graph|mhu|1.30.0 vscode-docker|ms-|1.28.0 vscode-kubernetes-tools|ms-|1.3.15 black-formatter|ms-|2023.6.0 isort|ms-|2023.10.1 python|ms-|2023.20.0 vscode-pylance|ms-|2023.11.10 jupyter|ms-|2023.10.1100000000 jupyter-keymap|ms-|1.1.2 jupyter-renderers|ms-|1.0.17 vscode-jupyter-cell-tags|ms-|0.1.8 vscode-jupyter-slideshow|ms-|0.1.5 hexeditor|ms-|1.9.12 makefile-tools|ms-|0.7.0 vsliveshare|ms-|1.0.5892 vscode-yaml|red|1.14.0 shopify-liquid|sis|4.0.1 helm-intellisense|Tim|0.14.3 cmake|twx|0.0.17 vscode-ltex|val|13.1.0 docker|vsc|1.0.0 yaml|vsc|1.0.0 markdown-all-in-one|yzh|3.5.1 vscode-proto3|zxh|0.5.5
A/B Experiments ``` vsliv368:30146709 vsreu685:30147344 python383:30185418 vspor879:30202332 vspor708:30202333 vspor363:30204092 vslsvsres303:30308271 vserr242cf:30382550 pythontb:30283811 vsjup518:30340749 pythonptprofiler:30281270 vshan820:30294714 vstes263:30335439 vscoreces:30445986 vscod805cf:30301675 binariesv615:30325510 bridge0708:30335490 bridge0723:30353136 vsaa593cf:30376535 pythonvs932:30410667 py29gd2263:30880072 vsclangdc:30486549 c4g48928:30535728 dsvsc012cf:30540253 pynewext54:30695312 azure-dev_surveyone:30548225 282f8724:30602487 f6dab269:30613381 vscrpc:30673769 2i9eh265:30646982 showlangstatbar:30737416 pythonfmttext:30731395 fixshowwlkth:30771522 showindicator:30805244 pythongtdpath:30769146 i26e3531:30792625 welcomedialogc:30887144 pythonnosmt12:30797651 pythonidxpt:30866567 pythonnoceb:30805159 asynctok:30898717 dsvsc013:30795093 dsvsc014:30804076 dsvsc015:30845448 pythontestfixt:30871694 pythonregdiag2:30871582 pyreplss1:30897532 pythonmypyd1:30879173 pythoncet0:30885854 h48ei257:30885898 pythontbext0:30879054 dsvsc016cf:30886111 dsvsc017cf:30886113 dsvsc018:30886114 aa_t_chat:30882232 ```
chrmarti commented 11 months ago

To verify in the upcoming Dev Containers 0.326.0-pre-release:

KlausPopp commented 11 months ago

I verified with Dev Containers 0.326.0-pre-release and it works! Thx