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.63k stars 282 forks source link

Shell server terminated (code: 1, signal: null) #6708

Closed sfarkya closed 2 years ago

sfarkya commented 2 years ago

I have been trying to attach a Kubernetes pod to VSCode but it's unable to attach. Not sure if there's a problem with the version of Remote Containers?

Here's the connection log:

[27 ms] Remote-Containers 0.235.0 in VS Code 1.67.1 (da15b6fd3ef856477bf6f4fb29ba1b7af717770d).
[26 ms] Start: Resolving Remote
[32 ms] Start: Run: kubectl exec -it qed-pod-1 --context cvt --namespace bitnet --container qed-pod-1 -- /bin/sh -c VSCODE_REMOTE_CONTAINERS_SESSION='3577d596-0394-4a2d-ba2b-f34cc4e40e541652288362777' /bin/sh
[35 ms] Start: Run in container: echo $PATH
[914 ms] /opt/alias:/usr/local/nvidia/bin:/usr/local/cuda/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
[914 ms] Unable to use a TTY - input is not a terminal or the right kind of file
[915 ms] Start: Run in container: id -un
[963 ms] root
[963 ms] 
[964 ms] Start: Run in container: uname -m
[1019 ms] x86_64
[1019 ms] 
[1020 ms] Start: Run in container: (cat /etc/os-release || cat /usr/lib/os-release) 2>/dev/null
[1063 ms] NAME="Ubuntu"
VERSION="18.04.6 LTS (Bionic Beaver)"
ID=ubuntu
ID_LIKE=debian
PRETTY_NAME="Ubuntu 18.04.6 LTS"
VERSION_ID="18.04"
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"
VERSION_CODENAME=bionic
UBUNTU_CODENAME=bionic
[1064 ms] 
[1064 ms] Start: Run in container: cat /etc/passwd
[1117 ms] Start: Run in container: test -d /root/.vscode-server
[1148 ms] 
[1149 ms] 
[1149 ms] Exit code 1
[1149 ms] Start: Run in container: test -d /root/.vscode-remote
[1197 ms] 
[1197 ms] 
[1197 ms] Exit code 1
[1198 ms] Start: Run in container: test ! -f '/root/.vscode-server/data/Machine/.writeMachineSettingsMarker' && set -o noclobber && mkdir -p '/root/.vscode-server/data/Machine' && { > '/root/.vscode-server/data/Machine/.writeMachineSettingsMarker' ; } 2> /dev/null
[1263 ms] 
[1263 ms] 
[1264 ms] Start: Run in container: cat /root/.vscode-server/data/Machine/settings.json
[1334 ms] 
[1334 ms] cat: /root/.vscode-server/data/Machine/settings.json: No such file or directory
[1335 ms] Exit code 1
[1335 ms] Start: Run in container: test -d /root/.vscode-server/bin/da15b6fd3ef856477bf6f4fb29ba1b7af717770d
[1413 ms] 
[1413 ms] 
[1414 ms] Exit code 1
[1414 ms] Installing VS Code Server for commit da15b6fd3ef856477bf6f4fb29ba1b7af717770d
[1415 ms] Start: Installing VS Code Server
[1415 ms] Start: Run in container: mkdir -p /root/.vscode-server/bin/da15b6fd3ef856477bf6f4fb29ba1b7af717770d_1652288364931
[1472 ms] 
[1472 ms] 
[1514 ms] Start: Run in container: (dd iflag=fullblock bs=8192 count=6732 2>/dev/null; dd iflag=fullblock bs=1012 count=1 2>/dev/null) | tar --no-same-owner -xz -C /root/.vscode-server/bin/da15b6fd3ef856477bf6f4fb29ba1b7af717770d_1652288364931
[22616 ms] 
[22617 ms] 
[22617 ms] Start: Run in container: mv -n /root/.vscode-server/bin/da15b6fd3ef856477bf6f4fb29ba1b7af717770d_1652288364931/* /root/.vscode-server/bin/da15b6fd3ef856477bf6f4fb29ba1b7af717770d && rmdir /root/.vscode-server/bin/da15b6fd3ef856477bf6f4fb29ba1b7af717770d_1652288364931
[22667 ms] 
[22667 ms] 
[22668 ms] Start: Launching Remote-Containers helper.
[22669 ms] ssh-agent: SSH_AUTH_SOCK in container (/tmp/vscode-ssh-auth-99b35681e9e5f4faf3f5f7a10ebcdd9598479306.sock) forwarded to local host (/private/tmp/com.apple.launchd.E3B3G35oi5/Listeners).
[22669 ms] Start: Run: gpgconf --list-dir agent-extra-socket
[22672 ms] Start: Run: kubectl exec -it qed-pod-1 --context cvt --namespace bitnet --container qed-pod-1 -- /bin/sh
[22674 ms] userEnvProbe: loginInteractiveShell (default)
[22674 ms] Start: Run in container: echo ~
[22675 ms] userEnvProbe shell: /bin/zsh
[22676 ms] Start: Run in container: # Test for /root/.ssh/known_hosts and ssh
[22717 ms] 
[22718 ms] 
[22718 ms] Start: Run in container: # Copy /Users/e32615/.ssh/known_hosts to /root/.ssh/known_hosts
[22880 ms] 
[22881 ms] 
[22881 ms] Start: Run in container: command -v git >/dev/null 2>&1 && git config --system --replace-all credential.helper '!f() { /root/.vscode-server/bin/da15b6fd3ef856477bf6f4fb29ba1b7af717770d/node /tmp/vscode-remote-containers-99b35681e9e5f4faf3f5f7a10ebcdd9598479306.js $*; }; f' || true
[23020 ms] 
[23020 ms] 
[23021 ms] Start: Run in container: for pid in `cd /proc && ls -d [0-9]*`; do { echo $pid ; readlink /proc/$pid/cwd ; readlink /proc/$pid/ns/mnt ; cat /proc/$pid/stat | tr "
[23419 ms] Start: Run in container: cat '/root/.vscode-server/data/Machine/.connection-token-da15b6fd3ef856477bf6f4fb29ba1b7af717770d' 2>/dev/null || (umask 377 && echo '1df64020-2d0d-4aa3-a51a-cf980701c895' >'/root/.vscode-server/data/Machine/.connection-token-da15b6fd3ef856477bf6f4fb29ba1b7af717770d-0ccd1baa-dcf5-4b9a-95c6-dc42080a2886' && mv -n '/root/.vscode-server/data/Machine/.connection-token-da15b6fd3ef856477bf6f4fb29ba1b7af717770d-0ccd1baa-dcf5-4b9a-95c6-dc42080a2886' '/root/.vscode-server/data/Machine/.connection-token-da15b6fd3ef856477bf6f4fb29ba1b7af717770d' && rm -f '/root/.vscode-server/data/Machine/.connection-token-da15b6fd3ef856477bf6f4fb29ba1b7af717770d-0ccd1baa-dcf5-4b9a-95c6-dc42080a2886' && cat '/root/.vscode-server/data/Machine/.connection-token-da15b6fd3ef856477bf6f4fb29ba1b7af717770d')
[23771 ms] 1df64020-2d0d-4aa3-a51a-cf980701c895
[23771 ms] 
[23772 ms] Start: Starting VS Code Server
[23772 ms] Start: Preparing Extensions
[23772 ms] Start: Run in container: test ! -f '/root/.vscode-server/data/Machine/.installExtensionsMarker' && set -o noclobber && mkdir -p '/root/.vscode-server/data/Machine' && { > '/root/.vscode-server/data/Machine/.installExtensionsMarker' ; } 2> /dev/null
[24248 ms] 
[24249 ms] 
[24251 ms] Extensions cache, install extensions: None
[24251 ms] Start: Run in container: test -d /root/.vscode-server/extensionsCache && ls /root/.vscode-server/extensionsCache || true
[24630 ms] 
[24630 ms] 
[24631 ms] Extensions cache, copy to remote: None
[24632 ms] Start: Run: kubectl exec -it qed-pod-1 --context cvt --namespace bitnet --container qed-pod-1 -- /bin/sh -c cd '/root/.vscode-server/bin/da15b6fd3ef856477bf6f4fb29ba1b7af717770d' && SHELL='/bin/zsh' VSCODE_AGENT_FOLDER='/root/.vscode-server' /root/.vscode-server/bin/da15b6fd3ef856477bf6f4fb29ba1b7af717770d/bin/code-server '--log' 'debug' '--force-disable-user-env' '--server-data-dir' '/root/.vscode-server' '--use-host-proxy' '--telemetry-level' 'all' '--accept-server-license-terms' '--host' '127.0.0.1' '--port' '0' '--connection-token-file' '/root/.vscode-server/data/Machine/.connection-token-da15b6fd3ef856477bf6f4fb29ba1b7af717770d' '--extensions-download-dir' '/root/.vscode-server/extensionsCache' '--start-server' '--disable-websocket-compression'
[34681 ms] Extensions cache, remote removals: None
[94749 ms] Extensions cache, remote removals: None
[146475 ms] Error reading shell environment.
[148194 ms] Command failed: /root/.vscode-server/bin/da15b6fd3ef856477bf6f4fb29ba1b7af717770d/bin/code-server --log debug --force-disable-user-env --server-data-dir /root/.vscode-server --use-host-proxy --telemetry-level all --accept-server-license-terms --host 127.0.0.1 --port 0 --connection-token-file /root/.vscode-server/data/Machine/.connection-token-da15b6fd3ef856477bf6f4fb29ba1b7af717770d --extensions-download-dir /root/.vscode-server/extensionsCache --start-server --disable-websocket-compression
[148194 ms] Unable to use a TTY - input is not a terminal or the right kind of file
Error from server:
[148195 ms] Exit code 1
[154800 ms] Extensions cache, remote removals: None
[214925 ms] Extensions cache, remote removals: None

Here's the screenshot of the connection: Screen Shot 2022-05-11 at 1 02 05 PM

New to VSCode, it was working until two days ago, and not sure what changed.

chrmarti commented 2 years ago

@aeschli Any idea? The server (or server script) outputs Error from server: without additional details and then exits with code 1.

sfarkya commented 2 years ago

Please let me know if you need any logs or details from my side to resolve this issue. Thanks for helping!

aeschli commented 2 years ago

Sorry, no idea. Can you manually run the start server command from a terminal?

sfarkya commented 2 years ago

Not sure how to do that in a Kubernetes pod?

chrmarti commented 2 years ago

@sfarkya kubectl exec -it qed-pod-1 --context cvt --namespace bitnet --container qed-pod-1 -- /bin/bash (or similar) should give you a shell. In there try running (this assumes the server was installed by a previous attempt to connect with VS Code):

cd '/root/.vscode-server/bin/da15b6fd3ef856477bf6f4fb29ba1b7af717770d'
./bin/code-server '--log' 'debug' '--force-disable-user-env' '--server-data-dir' '/root/.vscode-server' '--use-host-proxy' '--telemetry-level' 'all' '--accept-server-license-terms' '--host' '127.0.0.1' '--port' '0' '--connection-token-file' '/root/.vscode-server/data/Machine/.connection-token-da15b6fd3ef856477bf6f4fb29ba1b7af717770d' '--extensions-download-dir' '/root/.vscode-server/extensionsCache' '--start-server' '--disable-websocket-compression'
github-actions[bot] commented 2 years ago

This issue has been closed automatically because it needs more information and has not had recent activity. See also our issue reporting guidelines.

Happy Coding!