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.64k stars 285 forks source link

Hang while trying to attach to a remote kubernetes pod #10390

Open puchupala opened 2 days ago

puchupala commented 2 days ago

I'm trying to attach VSCode to my dev pod in a remote K8S cluster but it hang during the following step and eventually error (see logs below).

[18 ms] Dev Containers 0.388.0 in VS Code 1.94.2 (384ff7382de624fb94dbaf6da11977bba1ecd427).
[18 ms] Start: Resolving Remote
[23 ms] Start: Run: kubectl exec -it mncore-dev --context mnjg2 --namespace user-puchupala --container main -- env VSCODE_REMOTE_CONTAINERS_SESSION=9bc01ad3-ffa4-4ed3-a411-8d3e17dcb0521729052253008 /bin/sh
[26 ms] Start: Run in container: echo $PATH
[424 ms] /app/wrapper/bin:/usr/local/nvidia/bin:/usr/local/cuda/bin:/usr/local/nvidia/bin:/usr/local/cuda/bin:/usr/local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/local/in1/bin:/opt/gpfn2-smi/bin
[424 ms] Unable to use a TTY - input is not a terminal or the right kind of file
[424 ms] Start: Run in container: id -un
[456 ms] puchupala
[456 ms] 
[456 ms] Start: Run in container: uname -m
[486 ms] x86_64
[486 ms] 
[486 ms] Start: Run in container: (cat /etc/os-release || cat /usr/lib/os-release) 2>/dev/null
[518 ms] PRETTY_NAME="Ubuntu 22.04.3 LTS"
NAME="Ubuntu"
VERSION_ID="22.04"
VERSION="22.04.3 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
[518 ms] 
[518 ms] Start: Run in container:  (command -v getent >/dev/null 2>&1 && getent passwd 'puchupala' || grep -E '^puchupala|^[^:]*:[^:]*:puchupala:' /etc/passwd || true)
[549 ms] Start: Run in container: test -d '/mnt/nfs-mnj-home-43/puchupala/.vscode-server'
[580 ms] 
[581 ms] 
[581 ms] Start: Run in container: test ! -f '/mnt/nfs-mnj-home-43/puchupala/.vscode-server/data/Machine/.writeMachineSettingsMarker' && set -o noclobber && mkdir -p '/mnt/nfs-mnj-home-43/puchupala/.vscode-server/data/Machine' && { > '/mnt/nfs-mnj-home-43/puchupala/.vscode-server/data/Machine/.writeMachineSettingsMarker' ; } 2> /dev/null
[612 ms] 
[613 ms] 
[613 ms] Exit code 1
[613 ms] Start: Run in container: cat /mnt/nfs-mnj-home-43/puchupala/.vscode-server/data/Machine/settings.json
[644 ms] 
[644 ms] cat: /mnt/nfs-mnj-home-43/puchupala/.vscode-server/data/Machine/settings.json: No such file or directory
[644 ms] Exit code 1
[644 ms] Start: Run in container: test -d '/mnt/nfs-mnj-home-43/puchupala/.vscode-server/bin/384ff7382de624fb94dbaf6da11977bba1ecd427'
[674 ms] 
[674 ms] 
[674 ms] Exit code 1
[675 ms] Installing VS Code Server for commit 384ff7382de624fb94dbaf6da11977bba1ecd427
[675 ms] Start: Installing VS Code Server
[675 ms] Start: Run in container: mkdir -p /mnt/nfs-mnj-home-43/puchupala/.vscode-server/bin/384ff7382de624fb94dbaf6da11977bba1ecd427_1729052254142
[710 ms] 
[711 ms] 
[721 ms] Start: Run in container: (dd iflag=fullblock bs=8192 count=7283; dd iflag=fullblock bs=5187 count=1) | tar --no-same-owner -xz -C /mnt/nfs-mnj-home-43/puchupala/.vscode-server/bin/384ff7382de624fb94dbaf6da11977bba1ecd427_1729052254142
[1441009 ms] E1016 13:41:34.476127   24653 v2.go:104] write tcp 172.27.44.5:62512->10.192.13.192:16443: write: broken pipe
E1016 13:41:34.476222   24653 websocket.go:499] Websocket Ping failed: write tcp 172.27.44.5:62512->10.192.13.192:16443: write: broken pipe
E1016 13:41:34.476129   24653 v2.go:150] next reader: read tcp 172.27.44.5:62512->10.192.13.192:16443: read: can't assign requested address
E1016 13:41:34.476137   24653 v2.go:167] next reader: read tcp 172.27.44.5:62512->10.192.13.192:16443: read: can't assign requested address
E1016 13:41:34.476235   24653 v2.go:129] next reader: read tcp 172.27.44.5:62512->10.192.13.192:16443: read: can't assign requested address
[1441014 ms] error: error reading from error stream: next reader: read tcp 172.27.44.5:62512->10.192.13.192:16443: read: can't assign requested address
[1441018 ms] Start: Run in container: rm -rf /mnt/nfs-mnj-home-43/puchupala/.vscode-server/bin/384ff7382de624fb94dbaf6da11977bba1ecd427_1729052254142
[1441018 ms] Stdin closed!
[1441021 ms] Shell server terminated (code: 1, signal: null)

Does this issue occur when you try this locally?: No (creating a new dev container locally works fine) Does this issue occur when you try this locally and all extensions are disabled?: No

puchupala commented 2 days ago

Manually installing VS Code Server using the following command prior to connecting make it works. Note that I was using the script from https://github.com/b01/dl-vscode-server/tree/main

curl -L https://raw.githubusercontent.com/b01/dl-vscode-server/main/download-vs-code-server.sh | BUILD=stable bash -s -- "linux"
puchupala commented 2 days ago

Random guess: This might be related to the fact that the home dir inside the pod is nfs-mounted shared dir.