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

build: remove legacy server support #235232

Draft
wants to merge 6 commits into
base: main
Choose a base branch
from

Conversation

deepak1556
Copy link
Collaborator

@deepak1556 deepak1556 commented Dec 4, 2024

Fixes #231623

DO NOT MERGE until March 2025

@deepak1556 deepak1556 added this to the Backlog milestone Dec 4, 2024
@deepak1556 deepak1556 self-assigned this Dec 4, 2024
@deepak1556

This comment was marked as outdated.

@deepak1556
Copy link
Collaborator Author

Behavior moving forward

  1. Server requirements check will fail with error code 99 on legacy systems, this code is already handled by devcontainers and wsl extension to surface appropriate error message to the users.
  2. Cli will also error on legacy systems and ssh extension should already be handling this error
  3. Existence of file /tmp/vscode-skip-server-requirements-check will skip the requirements check in both cases 1) and 2) as before, this will be preserved so that users can override with their custom build of Node.js binary

/cc @connor4312 @chrmarti @aeschli @joshspicer

@murkvin
Copy link

murkvin commented Dec 4, 2024

Thank you for your work on this. I appreciate your efforts to get this out early enough that we can build confidence in whatever workarounds we may choose to use.

@reukiodo
Copy link

reukiodo commented Dec 5, 2024

This Insiders build can't connect to any host, all with the same env as VSCode:

1.96.0-insider Version: 1.96.0-insider (Universal) Commit: 785c2b4 Date: 2024-12-04T09:42:59.065Z Electron: 32.2.6 ElectronBuildId: 10629634 Chromium: 128.0.6613.186 Node.js: 20.18.1 V8: 12.8.374.38-electron.0 OS: Darwin arm64 24.1.0
[10:27:47.148] Log Level: 2
[10:27:47.159] SSH Resolver called for "ssh-remote+ansible", attempt 1
[10:27:47.160] remote.SSH.useLocalServer = true
[10:27:47.160] remote.SSH.useExecServer = true
[10:27:47.160] remote.SSH.path = 
[10:27:47.160] remote.SSH.configFile = 
[10:27:47.160] remote.SSH.useFlock = true
[10:27:47.161] remote.SSH.lockfilesInTmp = false
[10:27:47.161] remote.SSH.localServerDownload = auto
[10:27:47.161] remote.SSH.remoteServerListenOnSocket = false
[10:27:47.161] remote.SSH.defaultExtensions = []
[10:27:47.161] remote.SSH.loglevel = 2
[10:27:47.161] remote.SSH.enableDynamicForwarding = true
[10:27:47.161] remote.SSH.enableRemoteCommand = false
[10:27:47.161] remote.SSH.serverPickPortsFromRange = {}
[10:27:47.161] remote.SSH.serverInstallPath = {}
[10:27:47.161] remote.SSH.permitPtyAllocation = false
[10:27:47.161] remote.SSH.preferredLocalPortRange = undefined
[10:27:47.161] remote.SSH.useCurlAndWgetConfigurationFiles = false
[10:27:47.161] remote.SSH.experimental.chat = false
[10:27:47.161] remote.SSH.experimental.enhancedSessionLogs = false
[10:27:47.167] VS Code version: 1.96.0-insider
[10:27:47.167] Remote-SSH version: [email protected]
[10:27:47.167] darwin arm64
[10:27:47.171] SSH Resolver called for host: ansible
[10:27:47.171] Setting up SSH remote "ansible"
[10:27:47.175] Acquiring local install lock: /var/folders/2s/w13hx5rs7tl7f_3smhps86780000gn/T/vscode-remote-ssh-d82c32c3-install.lock
[10:27:47.176] Looking for existing server data file at /Users/reukiodo/Library/Application Support/Code - Insiders/User/globalStorage/ms-vscode-remote.remote-ssh/vscode-ssh-host-d82c32c3-785c2b4845191d65e2d4a5f6b4e2601e82a8cec7-0.116.2024120517-es/data.json
[10:27:47.176] No existing data file
[10:27:47.176] Using commit id "785c2b4845191d65e2d4a5f6b4e2601e82a8cec7" and quality "insider" for server
[10:27:47.177] Script variables:
 {
  "ExitCode.0": "OK",
  "ExitCode.64": "LinuxPrereqs",
  "ExitCode.65": "ProxyAuthenticationRequired",
  "ExitCode.128": "UnparsableOutput",
  "ExitCode.129": "EmptyOutput",
  "ExitCode.131": "UnhandledResolverExitCode",
  "ExitCode.132": "OfflineError",
  "ExitCode.133": "SshInstall",
  "ExitCode.134": "FindLocalPort",
  "ExitCode.135": "Timeout",
  "ExitCode.136": "ExhaustedRetries",
  "ExitCode.137": "PermissionDenied",
  "ExitCode.138": "MitmPortForwardingDisabled",
  "ExitCode.139": "Canceled",
  "ExitCode.140": "BadLocalDownloadRequest",
  "ExitCode.141": "LocalDownloadFailed",
  "ExitCode.142": "LocalLockTimeout",
  "ExitCode.143": "NoBash",
  "ExitCode.144": "InvalidHostName",
  "ExitCode.145": "BadInstallScriptResult",
  "ExitCode.146": "ShellRequestFailedOnChannel",
  "ExitCode.147": "InvalidPortRange",
  "ExitCode.148": "SendDisconnectBrokenPipe",
  "ExitCode.149": "LocalServerCrashed",
  "ExitCode.150": "NoFreePortInRange",
  "ExitCode.151": "InvalidCustomServerPath",
  "ExitCode.192": "AlreadyInProgress",
  "ExitCode.193": "ServerDownloadFailed",
  "ExitCode.194": "NoDownloaderAvailable",
  "ExitCode.195": "NoDownloaderAvailableForStatusCheck",
  "ExitCode.196": "UnsupportedArch",
  "ExitCode.197": "StatusCheckFailed",
  "ExitCode.198": "NeedInsidersArch",
  "ExitCode.199": "ServerTransferFailed",
  "ExitCode.200": "ServerFailedToStart",
  "ExitCode.201": "NeedInsidersWindows",
  "ExitCode.202": "CreateInstallDirFailed",
  "ExitCode.203": "UnsupportedPlatform",
  "ExitCode.204": "ServerTerminatedCVE20201416",
  "ExitCode.205": "UnpackFailed",
  "ExitCode.206": "ChangeDirFailed",
  "ExitCode.1023": "UnclassifiedError",
  "ExitCode.OK": "0",
  "ExitCode.LinuxPrereqs": "64",
  "ExitCode.ProxyAuthenticationRequired": "65",
  "ExitCode.UnparsableOutput": "128",
  "ExitCode.EmptyOutput": "129",
  "ExitCode.UnhandledResolverExitCode": "131",
  "ExitCode.OfflineError": "132",
  "ExitCode.SshInstall": "133",
  "ExitCode.FindLocalPort": "134",
  "ExitCode.Timeout": "135",
  "ExitCode.ExhaustedRetries": "136",
  "ExitCode.PermissionDenied": "137",
  "ExitCode.MitmPortForwardingDisabled": "138",
  "ExitCode.Canceled": "139",
  "ExitCode.BadLocalDownloadRequest": "140",
  "ExitCode.LocalDownloadFailed": "141",
  "ExitCode.LocalLockTimeout": "142",
  "ExitCode.NoBash": "143",
  "ExitCode.InvalidHostName": "144",
  "ExitCode.BadInstallScriptResult": "145",
  "ExitCode.ShellRequestFailedOnChannel": "146",
  "ExitCode.InvalidPortRange": "147",
  "ExitCode.SendDisconnectBrokenPipe": "148",
  "ExitCode.LocalServerCrashed": "149",
  "ExitCode.NoFreePortInRange": "150",
  "ExitCode.InvalidCustomServerPath": "151",
  "ExitCode.AlreadyInProgress": "192",
  "ExitCode.ServerDownloadFailed": "193",
  "ExitCode.NoDownloaderAvailable": "194",
  "ExitCode.NoDownloaderAvailableForStatusCheck": "195",
  "ExitCode.UnsupportedArch": "196",
  "ExitCode.StatusCheckFailed": "197",
  "ExitCode.NeedInsidersArch": "198",
  "ExitCode.ServerTransferFailed": "199",
  "ExitCode.ServerFailedToStart": "200",
  "ExitCode.NeedInsidersWindows": "201",
  "ExitCode.CreateInstallDirFailed": "202",
  "ExitCode.UnsupportedPlatform": "203",
  "ExitCode.ServerTerminatedCVE20201416": "204",
  "ExitCode.UnpackFailed": "205",
  "ExitCode.ChangeDirFailed": "206",
  "ExitCode.UnclassifiedError": "1023",
  "InstallUnpackCode.Success": "success",
  "InstallUnpackCode.Error": "error",
  "InstallUnpackCode.MissingFiles": "missingFiles",
  "uuid": "8c4fe0a1a2b8",
  "startMarker": "8c4fe0a1a2b8: running",
  "commitId": "785c2b4845191d65e2d4a5f6b4e2601e82a8cec7",
  "quality": "insider",
  "token": "11a1a111-a111-111a-1111-aa11a11a11a1",
  "vscodeAgentFolder": "$HOME/.vscode-server-insiders",
  "allowClientDownload": "1",
  "forceClientDownload": "0",
  "cliNameInArchive": "code-insiders",
  "ignoreWgetConfigFlag": " --no-config ",
  "ignoreCurlConfigFlag": " --disable ",
  "wgetTriesSegment": "--tries=1",
  "listenArgs": "--on-host=127.0.0.1 --on-port",
  "getDownloadServerStartTrigger": "8c4fe0a1a2b8:trigger_server_download",
  "getDownloadServerEndTrigger": "8c4fe0a1a2b8:trigger_server_download_end",
  "getProgressDownloading": "8c4fe0a1a2b8%%1%%",
  "getProgressInstalling": "8c4fe0a1a2b8%%2%%",
  "printVars": "echo \"SSH_AUTH_SOCK==$SSH_AUTH_SOCK==\"\necho \"DISPLAY==$DISPLAY==\""
}
[10:27:47.179] Install and start server if needed
[10:27:47.181] PATH: /usr/local/bin:/System/Cryptexes/App/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/local/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/appleinternal/bin:/opt/X11/bin:/Library/Apple/usr/bin:/Applications/Wireshark.app/Contents/MacOS:/Applications/VMware Fusion.app/Contents/Public
[10:27:47.181] Checking ssh with "ssh -V"
[10:27:47.190] > OpenSSH_9.8p1, LibreSSL 3.3.6

[10:27:47.192] askpass server listening on /var/folders/2s/w13hx5rs7tl7f_3smhps86780000gn/T/vscode-ssh-askpass-4be6248db8c06f10a861a6284acc09df90564a56.sock
[10:27:47.193] Spawning local server with {"serverId":1,"ipcHandlePath":"/var/folders/2s/w13hx5rs7tl7f_3smhps86780000gn/T/vscode-ssh-askpass-5ab33238f1b22d9971741c0b02dc0b3bdba34502.sock","sshCommand":"ssh","sshArgs":["-v","-T","-D","53177","-o","ConnectTimeout=15","ansible"],"serverDataFolderName":".vscode-server-insiders","dataFilePath":"/Users/reukiodo/Library/Application Support/Code - Insiders/User/globalStorage/ms-vscode-remote.remote-ssh/vscode-ssh-host-d82c32c3-785c2b4845191d65e2d4a5f6b4e2601e82a8cec7-0.116.2024120517-es/data.json"}
[10:27:47.193] Local server env: {"SSH_AUTH_SOCK":"/private/tmp/com.apple.launchd.Dm9zCDlSqQ/Listeners","SHELL":"/bin/bash","DISPLAY":"/private/tmp/com.apple.launchd.GxZf01izDF/org.xquartz:0","ELECTRON_RUN_AS_NODE":"1","SSH_ASKPASS":"/Users/reukiodo/.vscode-insiders/extensions/ms-vscode-remote.remote-ssh-0.116.2024120517/out/local-server/askpass.sh","VSCODE_SSH_ASKPASS_NODE":"/private/var/folders/2s/w13hx5rs7tl7f_3smhps86780000gn/T/AppTranslocation/C96A5733-EC31-4CB2-ABF9-D1D08CB2F5CF/d/Visual Studio Code - Insiders.app/Contents/Frameworks/Code - Insiders Helper (Plugin).app/Contents/MacOS/Code - Insiders Helper (Plugin)","VSCODE_SSH_ASKPASS_EXTRA_ARGS":"","VSCODE_SSH_ASKPASS_MAIN":"/Users/reukiodo/.vscode-insiders/extensions/ms-vscode-remote.remote-ssh-0.116.2024120517/out/askpass-main.js","VSCODE_SSH_ASKPASS_HANDLE":"/var/folders/2s/w13hx5rs7tl7f_3smhps86780000gn/T/vscode-ssh-askpass-4be6248db8c06f10a861a6284acc09df90564a56.sock"}
[10:27:47.194] Spawned 61774
[10:27:47.194] Using connect timeout of 17 seconds
[10:27:47.280] > local-server-1> Running ssh connection command: ssh -v -T -D 53177 -o ConnectTimeout=15 ansible
[10:27:47.281] > local-server-1> Spawned ssh, pid=61777
[10:27:47.288] stderr> OpenSSH_9.8p1, LibreSSL 3.3.6
[10:27:47.300] stderr> OpenSSH_9.8p1, LibreSSL 3.3.6
[10:27:47.493] stderr> debug1: Server host key: ecdsa-sha2-nistp256 SHA256:HbTPCN+8/AsisXTGnceU8rGx4zEelJo0FMt2bKAhXzs
[10:27:47.597] stderr> Authenticated to remote.rit.uw.edu ([128.208.119.4]:22) using "publickey".
[10:27:47.954] stderr> \S
[10:27:47.954] stderr> Kernel \r on an \m
[10:27:47.954] stderr> 
[10:27:48.016] stderr> Authenticated to ansible.rit.uw.edu (via proxy) using "publickey".
[10:27:48.104] > Activate the web console with: systemctl enable --now cockpit.socket
[10:27:48.308] > ready: 8c4fe0a1a2b8
[10:27:48.330] > Linux 5.14.0-362.8.1.el9_3.x86_64 #1 SMP PREEMPT_DYNAMIC Tue Oct 3 11:12:36 EDT 2023
[10:27:48.331] Platform: linux
[10:27:48.344] > /bin/bash
[10:27:48.344] Parent Shell: bash
[10:27:48.344] Parent Shell pid: 61774
[10:27:48.361] > 1532058
[10:27:48.361] Waiting for pid of spawned 'sh' subshell: '1532058'...
[10:27:48.395] > 8c4fe0a1a2b8: running
> Script executing under PID: 1532058
[10:27:48.492] > Installing to /root/.vscode-server-insiders...
[10:27:48.501] > 8c4fe0a1a2b8%%1%%
[10:27:48.528] > Downloading with wget
[10:27:48.538] > wget is from busybox: no
[10:27:48.672] stderr> Program 'wget' appears to support flag '--no-config'
[10:27:49.381] > Download complete
[10:27:49.389] > 8c4fe0a1a2b8%%2%%
> tar --version: tar (GNU tar) 1.34
> Copyright (C) 2021 Free Software Foundation, Inc.
> License GPLv3+: GNU GPL version 3 or later <https://gnu.org/licenses/gpl.html>.
> This is free software: you are free to change and redistribute it.
> There is NO WARRANTY, to the extent permitted by law.
> 
> Written by John Gilmore and Jay Fenlason.
[10:27:49.599] > code-insiders 1.96.0 (commit 785c2b4845191d65e2d4a5f6b4e2601e82a8cec7)
[10:27:49.608] > Starting VS Code CLI...
> printenv:
[10:27:49.618] >     SHELL=/bin/bash
>     HISTCONTROL=ignoredups
>     HOSTNAME=ansible.rit.uw.edu
>     HISTSIZE=1000
>     HISTTIMEFORMAT=%F %T 
>     PWD=/root
>     LOGNAME=root
>     XDG_SESSION_TYPE=tty
>     MOTD_SHOWN=pam
>     HOME=/root
>     LANG=en_US.UTF-8
>     TIME_STYLE=long-iso
>     SSH_CONNECTION=10.159.248.212 42996 10.159.248.214 22
>     XDG_SESSION_CLASS=user
>     SELINUX_ROLE_REQUESTED=
>     LESSOPEN=||/usr/bin/lesspipe.sh %s
>     USER=root
>     SELINUX_USE_CURRENT_RANGE=
>     SHLVL=2
>     XDG_SESSION_ID=1140
>     XDG_RUNTIME_DIR=/run/user/0
>     SSH_CLIENT=10.159.248.212 42996 22
>     LC_TIME=en_DK.UTF-8
>     which_declare=declare -f
>     PATH=/root/.local/bin:/root/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin
>     SELINUX_LEVEL_REQUESTED=
>     DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/0/bus
>     MAIL=/var/spool/mail/root
>     BASH_FUNC_which%%=() {  ( alias;
>      eval ${which_declare} ) | /usr/bin/which --tty-only --read-alias --read-functions --show-tilde --show-dot $@
>     }
>     _=/usr/bin/printenv
>     OLDPWD=/root/.vscode-server-insiders
[10:27:49.645] > Spawned remote CLI: 1532104
[10:27:49.654] > Waiting for server log...
[10:27:49.712] > Waiting for server log...
[10:27:49.755] > Waiting for server log...
[10:27:49.791] > Exec server process not found
[10:27:49.791] stderr> main: line 412: kill: (1532104) - No such process
[10:27:49.800] > [2024-12-05 10:27:49] error This machine does not meet Visual Studio Code Server's prerequisites, expected either...
>   - find /lib/ld-musl-x86_64.so.1, which is required to run the Visual Studio Code Server in musl environments
> 8c4fe0a1a2b8: start
> listeningOn====
> osReleaseId==rhel==
> arch==x86_64==
> vscodeArch==x64==
> bitness==64==
> tmpDir==/run/user/0==
> platform==linux==
> unpackResult==success==
> didLocalDownload==0==
> downloadTime==844==
> installTime==231==
> serverStartTime==174==
> execServerToken==11a1a111-a111-111a-1111-aa11a11a11a1==
> platformDownloadPath==cli-alpine-x64==
> SSH_AUTH_SOCK====
> DISPLAY====
> 8c4fe0a1a2b8: end
[10:27:49.800] Received install output: 
listeningOn====
osReleaseId==rhel==
arch==x86_64==
vscodeArch==x64==
bitness==64==
tmpDir==/run/user/0==
platform==linux==
unpackResult==success==
didLocalDownload==0==
downloadTime==844==
installTime==231==
serverStartTime==174==
execServerToken==11a1a111-a111-111a-1111-aa11a11a11a1==
platformDownloadPath==cli-alpine-x64==
SSH_AUTH_SOCK====
DISPLAY====

[10:27:49.800] Failed to parse remote port from server output
[10:27:49.800] Terminating local server
[10:27:49.802] Resolver error: Error: 
	at v.Create (/Users/reukiodo/.vscode-insiders/extensions/ms-vscode-remote.remote-ssh-0.116.2024120517/out/extension.js:2:696303)
	at t.handleInstallOutput (/Users/reukiodo/.vscode-insiders/extensions/ms-vscode-remote.remote-ssh-0.116.2024120517/out/extension.js:2:694384)
	at e (/Users/reukiodo/.vscode-insiders/extensions/ms-vscode-remote.remote-ssh-0.116.2024120517/out/extension.js:2:748331)
	at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
	at async /Users/reukiodo/.vscode-insiders/extensions/ms-vscode-remote.remote-ssh-0.116.2024120517/out/extension.js:2:770795
	at async t.withShowDetailsEvent (/Users/reukiodo/.vscode-insiders/extensions/ms-vscode-remote.remote-ssh-0.116.2024120517/out/extension.js:2:774472)
	at async /Users/reukiodo/.vscode-insiders/extensions/ms-vscode-remote.remote-ssh-0.116.2024120517/out/extension.js:2:745043
	at async P (/Users/reukiodo/.vscode-insiders/extensions/ms-vscode-remote.remote-ssh-0.116.2024120517/out/extension.js:2:743098)
	at async t.resolveWithLocalServer (/Users/reukiodo/.vscode-insiders/extensions/ms-vscode-remote.remote-ssh-0.116.2024120517/out/extension.js:2:744595)
	at async x (/Users/reukiodo/.vscode-insiders/extensions/ms-vscode-remote.remote-ssh-0.116.2024120517/out/extension.js:2:767790)
	at async t.resolve (/Users/reukiodo/.vscode-insiders/extensions/ms-vscode-remote.remote-ssh-0.116.2024120517/out/extension.js:2:771887)
	at async /Users/reukiodo/.vscode-insiders/extensions/ms-vscode-remote.remote-ssh-0.116.2024120517/out/extension.js:2:1054601
[10:27:49.806] ------




[10:27:49.806] Enhanced session logs are disabled.
[10:27:49.810] Local server exit: 15
1.95.3 (Universal) Version: 1.95.3 (Universal) Commit: f1a4fb1 Date: 2024-11-13T14:50:04.152Z Electron: 32.2.1 ElectronBuildId: 10427718 Chromium: 128.0.6613.186 Node.js: 20.18.0 V8: 12.8.374.38-electron.0 OS: Darwin arm64 24.1.0

there is no output, it just connects:

2024-12-05 10:38:09 root@ansible:~# 

@deepak1556 deepak1556 force-pushed the robo/rm_legacy_server_support branch 2 times, most recently from f9ac576 to 33f45d6 Compare January 16, 2025 11:51
@deepak1556
Copy link
Collaborator Author

We are exploring an option for Remote SSH that allows providing a custom glibc path to the vscode server which could serve as a temporary workaround, this mode will be tagged as unsupported but provides a way to not disable vscode updates until your system can be transitioned. The flow would be as follows,

  1. User attempts to connect to a legacy system with remote ssh
  2. Server checks the prerequisites and bails out with error message, it will point out to our website docs that has instructions to create the custom glibc (using crosstool-ng) that is required for the specific version of vscode server
  3. User creates the custom glibc and sets the following 3 environment variables to the login profile,
VSCODE_SERVER_CUSTOM_GLIBC_LINKER -> path to the dynamic linker in the sysroot (used for --set-interpreter with patchelf)
VSCODE_SERVER_CUSTOM_GLIBC_PATH -> path to the library locations in the sysroot (used as --set-rpath with patchelf)
VSCODE_SERVER_PATHELF_PATH -> path to the patchelf binary
  1. User re-attempts to connect with remote ssh
  2. Dialog prompted to confirm connection to unsupported system (choice will be persisted per remote authority)
  3. Connection successful

Here is a quick demo of the above, @murkvin and others please provide feedback if this helps your case. I will provide links to the builds once they are ready later today.

Screen.Recording.2025-01-16.at.23.29.01.mov

@deepak1556 deepak1556 force-pushed the robo/rm_legacy_server_support branch from 9da9d68 to 05e3e50 Compare January 22, 2025 06:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Allow connecting to unsupported Linux remotes, by use of custom glibc and stdc++ libraries
5 participants