vscode-remote-release icon indicating copy to clipboard operation
vscode-remote-release copied to clipboard

SCP unable to copy vscode to server

Open naveace opened this issue 2 years ago • 14 comments

  • VSCode Version: Version: 1.66.2 (Universal)
  • Local OS Version: MacOS Monterey 12.3.1
  • Remote OS Version: darwin x64
  • Remote Extension/Connection Type: SSH
  • Logs: (See below)

Steps to Reproduce:

  1. Try to connect to server via the Remote-SSH extension

Does this issue occur when you try this locally?: N/A Does this issue occur when you try this locally and all extensions are disabled?: N/A, using SSH extension

[18:35:34.863] Log Level: 2
[18:35:34.864] [email protected]
[18:35:34.864] darwin x64
[18:35:34.880] SSH Resolver called for "ssh-remote+txe1-login.mit.edu", attempt 1
[18:35:34.880] "remote.SSH.useLocalServer": true
[18:35:34.880] "remote.SSH.path": undefined
[18:35:34.880] "remote.SSH.configFile": undefined
[18:35:34.880] "remote.SSH.useFlock": false
[18:35:34.881] "remote.SSH.lockfilesInTmp": true
[18:35:34.881] "remote.SSH.localServerDownload": always
[18:35:34.881] "remote.SSH.remoteServerListenOnSocket": false
[18:35:34.881] "remote.SSH.showLoginTerminal": false
[18:35:34.881] "remote.SSH.defaultExtensions": []
[18:35:34.881] "remote.SSH.loglevel": 2
[18:35:34.881] "remote.SSH.enableDynamicForwarding": true
[18:35:34.881] "remote.SSH.enableRemoteCommand": false
[18:35:34.881] "remote.SSH.serverPickPortsFromRange": {}
[18:35:34.881] "remote.SSH.serverInstallPath": {}
[18:35:34.885] SSH Resolver called for host: txe1-login.mit.edu
[18:35:34.885] Setting up SSH remote "txe1-login.mit.edu"
[18:35:34.887] Acquiring local install lock: /var/folders/bg/wpb6hx715v1dqhv8nbpkxnqr0000gn/T/vscode-remote-ssh-48102e81-install.lock
[18:35:34.888] Looking for existing server data file at /Users/evanvogelbaum/Library/Application Support/Code/User/globalStorage/ms-vscode-remote.remote-ssh/vscode-ssh-host-48102e81-dfd34e8260c270da74b5c2d86d61aee4b6d56977-0.78.0/data.json
[18:35:34.888] Using commit id "dfd34e8260c270da74b5c2d86d61aee4b6d56977" and quality "stable" for server
[18:35:34.891] Install and start server if needed
[18:35:34.893] PATH: /Users/evanvogelbaum/google-cloud-sdk/bin:/Users/evanvogelbaum/opt/anaconda3/bin:/Users/evanvogelbaum/opt/anaconda3/condabin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Library/TeX/texbin
[18:35:34.893] Checking ssh with "ssh -V"
[18:35:34.898] > OpenSSH_8.6p1, LibreSSL 3.3.5

[18:35:34.902] askpass server listening on /var/folders/bg/wpb6hx715v1dqhv8nbpkxnqr0000gn/T/vscode-ssh-askpass-b2f138107bf85edca9005ce33e2d696a83b8ad2c.sock
[18:35:34.903] Spawning local server with {"serverId":1,"ipcHandlePath":"/var/folders/bg/wpb6hx715v1dqhv8nbpkxnqr0000gn/T/vscode-ssh-askpass-b0f254ad953d3d0156afab2f649016003c41d5e3.sock","sshCommand":"ssh","sshArgs":["-v","-T","-D","57411","-o","ConnectTimeout=15","txe1-login.mit.edu"],"serverDataFolderName":".vscode-server","dataFilePath":"/Users/evanvogelbaum/Library/Application Support/Code/User/globalStorage/ms-vscode-remote.remote-ssh/vscode-ssh-host-48102e81-dfd34e8260c270da74b5c2d86d61aee4b6d56977-0.78.0/data.json"}
[18:35:34.903] Local server env: {"SSH_AUTH_SOCK":"/private/tmp/com.apple.launchd.n1B9BvjUKF/Listeners","SHELL":"/bin/zsh","DISPLAY":"1","ELECTRON_RUN_AS_NODE":"1","SSH_ASKPASS":"/Users/evanvogelbaum/.vscode/extensions/ms-vscode-remote.remote-ssh-0.78.0/out/local-server/askpass.sh","VSCODE_SSH_ASKPASS_NODE":"/Applications/Visual Studio Code.app/Contents/MacOS/Electron","VSCODE_SSH_ASKPASS_EXTRA_ARGS":"--ms-enable-electron-run-as-node","VSCODE_SSH_ASKPASS_MAIN":"/Users/evanvogelbaum/.vscode/extensions/ms-vscode-remote.remote-ssh-0.78.0/out/askpass-main.js","VSCODE_SSH_ASKPASS_HANDLE":"/var/folders/bg/wpb6hx715v1dqhv8nbpkxnqr0000gn/T/vscode-ssh-askpass-b2f138107bf85edca9005ce33e2d696a83b8ad2c.sock"}
[18:35:34.904] Spawned 59325
[18:35:35.016] > local-server-1> Spawned ssh, pid=59330
[18:35:35.018] stderr> OpenSSH_8.6p1, LibreSSL 3.3.5
[18:35:35.196] stderr> Authenticated to txe1-login.mit.edu ([18.13.47.13]:22).
[18:35:35.783] > ready: b4a8a5b05a83
[18:35:35.796] > Linux 4.14.269-llgrid-10ms #1 SMP Tue Mar 8 05:03:58 EST 2022
[18:35:35.797] Platform: linux
[18:35:35.809] > /bin/bash
[18:35:35.809] Shell: bash
[18:35:35.810] Creating bash subshell inside "bash"
[18:35:35.837] > bash version:  4.4.20(1)-release
[18:35:35.855] > b4a8a5b05a83: running
[18:35:35.892] > Acquiring lock on /run/user/60910/vscode-remote-lock.evanv.dfd34e8260c270da74b5c2d86d61aee4b6d56977
[18:35:35.893] > \ln /run/user/60910/vscode-remote-lock.evanv.dfd34e8260c270da74b5c2d86d61aee4b6d56977.target /run/user/60910/vscode-remote-lock.evanv.dfd34e8260c270da74b5c2d86d61aee4b6d56977
[18:35:35.898] > Installing to /home/gridsan/evanv/.vscode-server/bin/dfd34e8260c270da74b5c2d86d61aee4b6d56977...
[18:35:35.898] > Trigger local server download
> b4a8a5b05a83:trigger_server_download
> platform==linux==
> vscodeArch==x64==
> destFolder==/home/gridsan/evanv/.vscode-server/bin/==
> destFolder2==dfd34e8260c270da74b5c2d86d61aee4b6d56977==
> b4a8a5b05a83:trigger_server_download_end
> Waiting for client to transfer server archive...
> Waiting for /home/gridsan/evanv/.vscode-server/bin/dfd34e8260c270da74b5c2d86d61aee4b6d56977/vscode-scp-done.flag and vscode-server.tar.gz to exist
[18:35:35.898] Got request to download on client for {"platform":"linux","arch":"x64","destFolder":"/home/gridsan/evanv/.vscode-server/bin/dfd34e8260c270da74b5c2d86d61aee4b6d56977"}
[18:35:35.899] Downloading VS Code server locally...
[18:35:35.899] >  
[18:35:38.900] >  
[18:35:41.537] Downloaded VS Code server to /var/folders/bg/wpb6hx715v1dqhv8nbpkxnqr0000gn/T/80113306-b847-4762-a3f6-9662fb57f2cb
[18:35:41.538] Renamed VS Code server to /var/folders/bg/wpb6hx715v1dqhv8nbpkxnqr0000gn/T/vscode_server_1650494141537/vscode-server.tar.gz
[18:35:41.541] PATH: /Users/evanvogelbaum/google-cloud-sdk/bin:/Users/evanvogelbaum/opt/anaconda3/bin:/Users/evanvogelbaum/opt/anaconda3/condabin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Library/TeX/texbin
[18:35:41.541] Checking ssh with "ssh -V"
[18:35:41.547] > OpenSSH_8.6p1, LibreSSL 3.3.5

[18:35:41.548] Testing scp with "scp"
[18:35:41.558] scp exited with code: 1
[18:35:41.558] Got stderr from scp: usage: scp [-346ABCpqrTv] [-c cipher] [-F ssh_config] [-i identity_file]
            [-J destination] [-l limit] [-o ssh_option] [-P port]
            [-S program] source ... target
[18:35:41.558] Copying file to remote with scp -o ConnectTimeout=15 'vscode-server.tar.gz' 'vscode-scp-done.flag' 'txe1-login.mit.edu':'/home/gridsan/evanv/.vscode-server/bin/dfd34e8260c270da74b5c2d86d61aee4b6d56977'
[18:35:41.559] Using cwd: file:///var/folders/bg/wpb6hx715v1dqhv8nbpkxnqr0000gn/T/vscode_server_1650494141537
[18:35:41.927] >  
[18:35:42.238] > /bin/sh: scp: No such file or directory
[18:35:42.384] "Copy server to host" terminal command done
[18:35:44.903] >  
[18:35:47.904] >  
[18:35:50.939] >  
[18:35:53.907] >  
[18:35:56.982] >  
[18:35:59.951] >  
[18:36:02.920] >  
[18:36:05.993] >  
[18:36:08.919] >  
[18:36:11.933] >  
[18:36:15.007] >  

naveace avatar Apr 20 '22 22:04 naveace

This is a linux level issue, not VSCode. Check if remote VMs have proper scp configured? Are you able to scp manually?

arunc1985 avatar Apr 21 '22 07:04 arunc1985

Hi @arunc1985 , thank you so much for your help! Both the server I am connecting to and my local machine have scp configured correctly. I can SCP the files manually, but not from file:///var/folders/bg/wpb6hx715v1dqhv8nbpkxnqr0000gn/T/vscode_server_1650494141537 as that path is invalid on MacOS. Instead I have to cd into /var/folders/bg/wpb6hx715v1dqhv8nbpkxnqr0000gn/T/vscode_server_1650494141537 Furthermore even though I do SCP it manually, this usually only fixes the issue for one session (if at all). Often times after doing this, a tar process on the server will start trying to unzip the server installation only to immediately die and then just hang.

naveace avatar Apr 21 '22 13:04 naveace

Following up on this issue

naveace avatar Nov 01 '22 18:11 naveace

Might work without "remote.SSH.localServerDownload": always, if that's possible for you.

/bin/sh: scp: No such file or directory

Let me know if this is still an issue, this is probably complaining about the server or the flag file, do either of those not actually exist?

roblourens avatar Dec 17 '22 21:12 roblourens

Hey @roblourens , thanks so much for the follow up! Sadly I require that options as the servers I am connecting to often don't have a strong enough connection to download directly. Both the flag and the server file exist on my machine (I manually scp them over each time)

naveace avatar Dec 17 '22 21:12 naveace

[18:35:41.558] Copying file to remote with scp -o ConnectTimeout=15 'vscode-server.tar.gz' 'vscode-scp-done.flag' 'txe1-login.mit.edu':'/home/gridsan/evanv/.vscode-server/bin/dfd34e8260c270da74b5c2d86d61aee4b6d56977'
[18:35:41.559] Using cwd: file:///var/folders/bg/wpb6hx715v1dqhv8nbpkxnqr0000gn/T/vscode_server_1650494141537
[18:35:41.927] >  
[18:35:42.238] > /bin/sh: scp: No such file or directory
[18:35:42.384] "Copy server to host" terminal command done

Does that exact command from that exact directory (without file:, we are just logging the URI format) work? What command are you using?

roblourens avatar Dec 17 '22 22:12 roblourens

Hey @roblourens , yes. I use that exact command from that exact cwd to copy it over (removing the file:// beforehand).

naveace avatar Dec 17 '22 23:12 naveace

Strange- the actual command we run looks like /bin/sh -c "scp ..." Could you try that with the logged scp command just to see whether it works any differently? It shouldn't, but I don't know why else the same command works when run manually.

roblourens avatar Dec 19 '22 22:12 roblourens

Hey Rob! Indeed when I run the exact command with /bin/sh -c scp ... it gives me the output posted above:

usage: scp [-346ABCpqrTv] [-c cipher] [-F ssh_config] [-i identity_file]
            [-J destination] [-l limit] [-o ssh_option] [-P port]
            [-S program] source ... target

However if I add the ", /bin/sh -c "scp ..." then it works as intended. It appears for some reason my installation is missing the "

naveace avatar Dec 20 '22 01:12 naveace

Hm, we don't actually quote it in our implementation but we pass it to an API in a way that should be equivalent to quoting it. Not sure why it works for everyone else but not you, we should do some investigation to figure out whether we should be quoting the shell arg that we pass to the terminal API.

roblourens avatar Jan 08 '23 01:01 roblourens

Got it; thanks so much for looking into it and let me know if I can provide any additional information about my setup that will be helpful.

naveace avatar Jan 09 '23 13:01 naveace

Im am seeing this issue as well, but cannot seem to figure out why the scp fails

karcaw avatar May 23 '23 16:05 karcaw

Same issue on my side. Previously it worked well but suddenly started to fail this morning. Do we have an update on this?

guomk avatar Oct 30 '23 09:10 guomk

Noticing this issue again in vscode version 1.88

[22:43:43.563] > vscode-cli-e170252f762678dec6ca2cc69aba157076 0% 0 0.0KB/s --:-- ETA [22:43:44.598] > vscode-cli-e170252f762678dec6ca2cc69aba157076 79% 6752KB 6.6MB/s 00:00 ETA [22:43:44.688] > vscode-cli-e170252f762678dec6ca2cc69aba157076 100% 8457KB 7.3MB/s 00:01
[22:43:44.958] > vscode-cli-e170252f762678dec6ca2cc69aba157076 0% 0 0.0KB/s --:-- ETA [22:43:45.007] > vscode-cli-e170252f762678dec6ca2cc69aba157076 100% 9 0.2KB/s 00:00
[22:43:45.397] "Copy server to host" terminal command done [22:43:46.013] >
[22:43:49.003] >
[22:43:52.055] >
[22:43:55.011] >
[22:43:58.106] >
[22:44:01.079] >
[22:44:04.052] >
[22:44:07.127] >
[22:44:10.038] >

rafoakwa avatar May 01 '24 02:05 rafoakwa