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.66k stars 286 forks source link

[Remote-SSH Bug]: remote.SSH.defaultExtensions preference is not taken into account when remote.downloadExtensionsLocally is set to true #9650

Closed Jokeswar closed 6 months ago

Jokeswar commented 7 months ago

Is there an existing issue for this bug?

Required Troubleshooting Steps

Connect Locally

It connects successfully

->

No response

Expected Behavior

I would expect that the extension would be installed even if my remote host does not have an internet connection

Steps To Reproduce

  1. Env:
    • Local machine: Mac Os (arm arch)
    • Remote machine: Linux (amd64 arch - no internet connection)
  2. Set the following preferences:
    "remote.SSH.localServerDownload": "always",
    "remote.downloadExtensionsLocally": true,
    "remote.SSH.defaultExtensions": [
    "dummy.id"
    ]
  3. Connect to a remote machine that does not have an internet connection
  4. Wait for the dummy.id extension to install
  5. The extension never gets installed

Remote-SSH Log

16:13:28.442] Log Level: 2 [16:13:28.451] SSH Resolver called for "ssh-remote+vm", attempt 1 [16:13:28.451] "remote.SSH.useLocalServer": true [16:13:28.452] "remote.SSH.useExecServer": false [16:13:28.452] "remote.SSH.path": undefined [16:13:28.452] "remote.SSH.configFile": undefined [16:13:28.452] "remote.SSH.useFlock": true [16:13:28.452] "remote.SSH.lockfilesInTmp": false [16:13:28.452] "remote.SSH.localServerDownload": always [16:13:28.453] "remote.SSH.remoteServerListenOnSocket": false [16:13:28.453] "remote.SSH.showLoginTerminal": false [16:13:28.453] "remote.SSH.defaultExtensions": ["ms-python.python"] [16:13:28.453] "remote.SSH.loglevel": 2 [16:13:28.455] "remote.SSH.enableDynamicForwarding": true [16:13:28.455] "remote.SSH.enableRemoteCommand": false [16:13:28.456] "remote.SSH.serverPickPortsFromRange": {} [16:13:28.456] "remote.SSH.serverInstallPath": {} [16:13:28.458] VS Code version: 1.87.1 [16:13:28.458] Remote-SSH version: remote-ssh@0.109.0 [16:13:28.459] darwin x64 [16:13:28.459] SSH Resolver called for host: vm [16:13:28.459] Setting up SSH remote "vm" [16:13:28.462] Acquiring local install lock: /var/folders/n6/9bkmr1897px27sh57gm1gykc0000gn/T/vscode-remote-ssh-4049c22c-install.lock [16:13:28.464] Looking for existing server data file at /Users/user/Library/Application Support/Code/User/globalStorage/ms-vscode-remote.remote-ssh/vscode-ssh-host-4049c22c-1e790d77f81672c49be070e04474901747115651-0.109.0-tr/data.json [16:13:28.464] Using commit id "1e790d77f81672c49be070e04474901747115651" and quality "stable" for server [16:13:28.468] Install and start server if needed [16:13:28.471] PATH: /usr/local/bin:/System/Cryptexes/App/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin:/opt/X11/bin:/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 [16:13:28.471] Checking ssh with "ssh -V" [16:13:28.476] > OpenSSH_9.0p1, LibreSSL 3.3.6

[16:13:28.478] askpass server listening on /var/folders/n6/9bkmr1897px27sh57gm1gykc0000gn/T/vscode-ssh-askpass-b9dd70b9d38f6d30327eb5e03162419cffc1fc1a.sock [16:13:28.478] Spawning local server with {"serverId":1,"ipcHandlePath":"/var/folders/n6/9bkmr1897px27sh57gm1gykc0000gn/T/vscode-ssh-askpass-4fd64b9fff48698caaf1dccfe7b0e787754e0af9.sock","sshCommand":"ssh","sshArgs":["-v","-T","-D","50572","-o","ConnectTimeout=15","vm"],"serverDataFolderName":".vscode-server","dataFilePath":"/Users/user/Library/Application Support/Code/User/globalStorage/ms-vscode-remote.remote-ssh/vscode-ssh-host-4049c22c-1e790d77f81672c49be070e04474901747115651-0.109.0-tr/data.json"} [16:13:28.479] Local server env: {"SSH_AUTH_SOCK":"/private/tmp/com.apple.launchd.2yhV6oXJ1w/Listeners","SHELL":"/bin/bash","DISPLAY":"/private/tmp/com.apple.launchd.ZLPfUUAu74/org.xquartz:0","ELECTRON_RUN_AS_NODE":"1","SSH_ASKPASS":"/Users/user/.vscode/extensions/ms-vscode-remote.remote-ssh-0.109.0/out/local-server/askpass.sh","VSCODE_SSH_ASKPASS_NODE":"/private/var/folders/n6/9bkmr1897px27sh57gm1gykc0000gn/T/AppTranslocation/964DA473-8C66-469B-BDD0-9BE88DA34D69/d/Visual Studio Code 5.app/Contents/Frameworks/Code Helper (Plugin).app/Contents/MacOS/Code Helper (Plugin)","VSCODE_SSH_ASKPASS_EXTRA_ARGS":"","VSCODE_SSH_ASKPASS_MAIN":"/Users/user/.vscode/extensions/ms-vscode-remote.remote-ssh-0.109.0/out/askpass-main.js","VSCODE_SSH_ASKPASS_HANDLE":"/var/folders/n6/9bkmr1897px27sh57gm1gykc0000gn/T/vscode-ssh-askpass-b9dd70b9d38f6d30327eb5e03162419cffc1fc1a.sock"} [16:13:28.479] Spawned 7314 [16:13:28.680] > local-server-1> Running ssh connection command: ssh -v -T -D 50572 -o ConnectTimeout=15 vm [16:13:28.681] > local-server-1> Spawned ssh, pid=7317 [16:13:28.687] stderr> OpenSSH_9.0p1, LibreSSL 3.3.6 [16:13:28.697] stderr> OpenSSH_9.0p1, LibreSSL 3.3.6 [16:13:28.772] stderr> debug1: Server host key: ssh-ed25519 SHA256:ZUr9RcgbNP7UFDTSfxGfN802mBmLAG/qUeCGlg+m6J4 [16:13:29.077] Got askpass request: {"request":" me@box's password:"} [16:13:29.078] Showing password prompt [16:13:29.080] Listening for interwindow password on /var/folders/n6/9bkmr1897px27sh57gm1gykc0000gn/T/vscode-ssh-askpass-6aaf01194d92ef789d02ccacb88a1f3256e14c83.sock [16:13:29.080] Writing password prompt to globalState [16:13:32.366] Got password response [16:13:32.366] Interactor gave response: **** [16:13:32.367] Cleaning up other-window auth server [16:13:32.445] stderr> Authenticated to box ([192.168.1.209]:22) using "password". [16:13:32.593] stderr> debug1: Server host key: ssh-ed25519 SHA256:CaQePAGRhKdAaVfqPEq7bJV8jGOUqRlo2RtFxyJnNF4 [16:13:32.854] Got askpass request: {"request":" vagrant@localhost's password:"} [16:13:32.855] Showing password prompt [16:13:32.855] Listening for interwindow password on /var/folders/n6/9bkmr1897px27sh57gm1gykc0000gn/T/vscode-ssh-askpass-0cdc91ba99fcbdc61ede899453c5948e3fa8a953.sock [16:13:32.855] Writing password prompt to globalState [16:13:35.701] Got password response [16:13:35.701] Interactor gave response: *** [16:13:35.702] Cleaning up other-window auth server [16:13:35.741] stderr> Authenticated to localhost (via proxy) using "password". [16:13:36.680] > Welcome to Ubuntu 22.04.3 LTS (GNU/Linux 5.15.0-92-generic x86_64)

This system is built by the Bento project by Chef Software More information can be found at https://github.com/chef/bento [16:13:36.705] > ready: d17973b4631f [16:13:36.713] > Linux 5.15.0-92-generic #102-Ubuntu SMP Wed Jan 10 09:33:48 UTC 2024 [16:13:36.713] Platform: linux [16:13:36.717] > /bin/bash [16:13:36.718] Shell: bash [16:13:36.718] Creating bash subshell inside "bash" [16:13:36.732] > bash version: 5.1.16(1)-release [16:13:36.951] > d17973b4631f: running [16:13:37.059] > Acquiring lock on /home/vagrant/.vscode-server/bin/1e790d77f81672c49be070e04474901747115651/vscode-remote-lock.vagrant.1e790d77f81672c49be070e04474901747115651 [16:13:37.074] > Installing to /home/vagrant/.vscode-server/bin/1e790d77f81672c49be070e04474901747115651... [16:13:37.078] > Trigger local server download d17973b4631f:trigger_server_download artifact==server-linux-x64== destFolder==/home/vagrant/.vscode-server/bin/== destFolder2==/1e790d77f81672c49be070e04474901747115651/vscode-server.tar.gz== d17973b4631f:trigger_server_download_end Waiting for client to transfer server archive... Waiting for /home/vagrant/.vscode-server/bin/1e790d77f81672c49be070e04474901747115651/vscode-server.tar.gz.done and vscode-server.tar.gz to exist [16:13:37.079] Got request to download on client for {"artifact":"server-linux-x64","destPath":"/home/vagrant/.vscode-server/bin//1e790d77f81672c49be070e04474901747115651/vscode-server.tar.gz"} [16:13:37.080] Downloading VS Code server locally... [16:13:37.081] >
[16:13:39.352] Downloaded VS Code server to /var/folders/n6/9bkmr1897px27sh57gm1gykc0000gn/T/96afe9e4-178c-42a7-93c6-9599c5460b8f [16:13:39.354] Renamed VS Code server to /var/folders/n6/9bkmr1897px27sh57gm1gykc0000gn/T/vscode_server_1710166419352/vscode-server.tar.gz [16:13:39.358] PATH: /usr/local/bin:/System/Cryptexes/App/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin:/opt/X11/bin:/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 [16:13:39.358] Checking ssh with "ssh -V" [16:13:39.366] > OpenSSH_9.0p1, LibreSSL 3.3.6

[16:13:39.368] Testing scp with "scp" [16:13:39.374] scp exited with code: 1 [16:13:39.374] Got stderr from scp: usage: scp [-346ABCOpqRrsTv] [-c cipher] [-D sftp_server_path] [-F ssh_config] [-i identity_file] [-J destination] [-l limit] [-o ssh_option] [-P port] [-S program] source ... target [16:13:39.375] Copying file to remote with scp -o ConnectTimeout=15 'vscode-server.tar.gz' 'vscode-server.tar.gz.done' vm:'/home/vagrant/.vscode-server/bin//1e790d77f81672c49be070e04474901747115651' [16:13:39.375] Using cwd: file:///var/folders/n6/9bkmr1897px27sh57gm1gykc0000gn/T/vscode_server_1710166419352 [16:13:39.720] > me@box's password: [16:13:39.722] Showing password prompt [16:13:40.082] >
[16:13:43.085] >
[16:13:43.493] Got password response [16:13:43.493] "Copy server to host" wrote data to terminal: "****" [16:13:43.514] > [16:13:43.770] > vagrant@localhost's password: [16:13:43.771] Showing password prompt [16:13:46.088] >
[16:13:46.455] Got password response [16:13:46.455] "Copy server to host" wrote data to terminal: "***" [16:13:46.473] > [16:13:46.669] > vscode-server.tar.gz 0% 0 0.0KB/s --:-- ETA [16:13:47.667] > vscode-server.tar.gz 16% 9152KB 8.9MB/s 00:05 ETA [16:13:48.668] > vscode-server.tar.gz 68% 38MB 10.9MB/s 00:01 ETA [16:13:49.077] > vscode-server.tar.gz 100% 55MB 22.7MB/s 00:02
[16:13:49.083] > vscode-server.tar.gz.done 0% 0 0.0KB/s --:-- ETAvscode-server.tar.gz.done 100% 9 3.9KB/s 00:00
[16:13:49.097] > Found flag and server on host [16:13:49.119] > d17973b4631f%%2%%

tar --version: [16:13:49.123] > 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. [16:13:49.339] "Copy server to host" terminal command done [16:13:51.004] > Checking /home/vagrant/.vscode-server/.1e790d77f81672c49be070e04474901747115651.log and /home/vagrant/.vscode-server/.1e790d77f81672c49be070e04474901747115651.pid for a running server [16:13:51.076] > WARNING: VS Code Server is running but its logfile is missing. Don't delete the VS Code Server manually, run the command 'Uninstall VS Code Server'. [16:13:51.077] > Starting VS Code Server... "/home/vagrant/.vscode-server/bin/1e790d77f81672c49be070e04474901747115651/bin/code-server" --start-server --host=127.0.0.1 --accept-server-license-terms --enable-remote-auto-shutdown --port=0 --telemetry-level all --install-extension ms-python.python &> "/home/vagrant/.vscode-server/.1e790d77f81672c49be070e04474901747115651.log" < /dev/null The VS Code Server log file is /home/vagrant/.vscode-server/.1e790d77f81672c49be070e04474901747115651.log printenv: [16:13:51.084] > SHELL=/bin/bash PWD=/home/vagrant LOGNAME=vagrant XDG_SESSION_TYPE=tty MOTD_SHOWN=pam HOME=/home/vagrant LANG=en_US.UTF-8 VSCODE_AGENT_FOLDER=/home/vagrant/.vscode-server SSH_CONNECTION=10.0.2.2 47088 10.0.2.15 22 XDG_SESSION_CLASS=user USER=vagrant SHLVL=1 XDG_SESSION_ID=8 XDG_RUNTIME_DIR=/run/user/1000 SSH_CLIENT=10.0.2.2 47088 22 XDG_DATA_DIRS=/usr/local/share:/usr/share:/var/lib/snapd/desktop PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin DBUS_SESSION_BUSADDRESS=unix:path=/run/user/1000/bus OLDPWD=/home/vagrant/.vscode-server/bin/1e790d77f81672c49be070e04474901747115651 =/usr/bin/printenv [16:13:51.099] stderr> rm: cannot remove '/home/vagrant/.vscode-server/.1e790d77f81672c49be070e04474901747115651.token' [16:13:51.100] stderr> : No such file or directory [16:13:51.112] > Spawned remote server: 3145 [16:13:51.133] > Waiting for server log... [16:13:51.194] > Waiting for server log... [16:13:51.255] > Waiting for server log... [16:13:51.311] > Waiting for server log... [16:13:51.368] > Waiting for server log... [16:13:51.430] > Waiting for server log... [16:13:51.486] > Waiting for server log... [16:13:51.545] > Waiting for server log... [16:13:51.602] > Waiting for server log... [16:13:51.679] >
*

[16:13:51.745] > Checking server status on port 35485 with wget [16:13:52.454] > d17973b4631f: start SSH_AUTH_SOCK==== DISPLAY==== webUiAccessToken==== listeningOn==35485== osReleaseId==ubuntu== arch==x86_64== vscodeArch==x64== bitness==64== tmpDir==/run/user/1000== platform==linux== unpackResult==success== didLocalDownload==1== downloadTime==== installTime==1865== extInstallTime==== serverStartTime==583== connectionToken==1111aa11-1a11-11aa-a1a1-a1a1aaaaaa11== d17973b4631f: end [16:13:52.455] Received install output: SSH_AUTH_SOCK==== DISPLAY==== webUiAccessToken==== listeningOn==35485== osReleaseId==ubuntu== arch==x86_64== vscodeArch==x64== bitness==64== tmpDir==/run/user/1000== platform==linux== unpackResult==success== didLocalDownload==1== downloadTime==== installTime==1865== extInstallTime==== serverStartTime==583== connectionToken==1111aa11-1a11-11aa-a1a1-a1a1aaaaaa11==

[16:13:52.456] Remote server is listening on port 35485 [16:13:52.457] Parsed server configuration: {"serverConfiguration":{"remoteListeningOn":{"port":35485},"osReleaseId":"ubuntu","arch":"x86_64","webUiAccessToken":"","sshAuthSock":"","display":"","tmpDir":"/run/user/1000","platform":"linux","connectionToken":"1111aa11-1a11-11aa-a1a1-a1a1aaaaaa11"},"installTime":1865,"serverStartTime":583,"didLocalDownload":true,"installUnpackCode":"success"} [16:13:52.458] Persisting server connection details to /Users/user/Library/Application Support/Code/User/globalStorage/ms-vscode-remote.remote-ssh/vscode-ssh-host-4049c22c-1e790d77f81672c49be070e04474901747115651-0.109.0-tr/data.json [16:13:52.462] Starting forwarding server. local port 50577 -> socksPort 50572 -> remotePort 35485 [16:13:52.463] Forwarding server listening on port 50577 [16:13:52.463] Waiting for ssh tunnel to be ready [16:13:52.465] [Forwarding server port 50577] Got connection 0 [16:13:52.466] Tunneled port 35485 to local port 50577 [16:13:52.466] Resolved "ssh-remote+vm" to "port 50577" [16:13:52.480] ------

[16:13:52.558] [Forwarding server port 50577] Got connection 1 [16:13:52.610] [Forwarding server port 50577] Got connection 2

Anything else?

No response

roblourens commented 6 months ago

https://github.com/microsoft/vscode-remote-release/issues/9090