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.67k stars 291 forks source link

Failed to scp local download tar file to remote server #2792

Open yuchenfun opened 4 years ago

yuchenfun commented 4 years ago

Failed to scp local download tar file to remote server. I think the reason for this issue is some special character in path. Logs:

[13:21:02.905] Got request to download on client for {"platform":"linux","arch":"x64","destFolder":"/root/.vscode-server-insiders/bin/a3083e58e2a9e77f60e531acaa32e18527\bae8439"}
[13:21:02.905] Downloading VS Code server locally...
[13:21:02.920] > 
> 
[13:21:04.121] Downloaded VS Code server to c:\Users\xxxx\AppData\Local\Temp\5f6d257e-5266-44a3-abb3-f2bd7193a4a6
[13:21:04.122] Renamed VS Code server to c:\Users\xxxx\AppData\Local\Temp\vscode_server_1587273664121\vscode-server.tar.gz
[13:21:04.123] Checking ssh with "ssh -V"
[13:21:04.157] > OpenSSH_for_Windows_7.7p1, LibreSSL 2.6.5
[13:21:04.157] Testing scp with "scp"
[13:21:04.190] scp exited with code: 1
[13:21:04.191] Got stderr from scp: usage: scp [-346BCpqrv] [-c cipher] [-F ssh_config] [-i identity_file]
           [-l limit] [-o ssh_option] [-P port] [-S program] source ... target
[13:21:04.191] Copying file to remote with scp vscode-server.tar.gz vscode-scp-done.flag home:/root/.vscode-server-insiders/bin/a3083e58e2a9e77f60e531acaa32e18527ae8439
[13:21:04.192] Using cwd: file:///c%3A/Users/xxxx/AppData/Local/Temp/vscode_server_1587273664121
[13:21:04.192] Terminal shell path: C:\Windows\System32\cmd.exe
[13:21:04.853] > scp: /root/.vscode-server-insiders/bin/a3083e58e2a9e77f60e531acaa32e1852ae8439:
> No such file or directory
> ]0;C:\Windows\System32\cmd.exe
[13:21:05.136] "Copy server to host" terminal command done

Does this issue occur when you try this locally?: No

rpodola commented 4 years ago

Hi, first of all, I like this plugin a lot, it's working fabulously, great work! At least it was until some 2 months ago when I started to get exactly the same error.

The remote server doesn't have internet connection so the new version of VSC Server is downloaded via client and transferred to the remote. It was working well before but now I am getting the error:

[15:19:31.322] Downloaded VS Code server to c:\Users\RADIM~1.POD\AppData\Local\Temp\6b93c8b3-5104-4dee-a1d2-223b051001a1
[15:19:31.326] Renamed VS Code server to c:\Users\RADIM~1.POD\AppData\Local\Temp\vscode_server_1595251171322\vscode-server.tar.gz
[15:19:31.330] Checking ssh with "ssh -V"
[15:19:31.400] > OpenSSH_for_Windows_7.7p1, LibreSSL 2.6.5
[15:19:31.400] Testing scp with "scp"
[15:19:31.466] scp exited with code: 1
[15:19:31.466] Got stderr from scp: usage: scp [-346BCpqrv] [-c cipher] [-F ssh_config] [-i identity_file]
           [-l limit] [-o ssh_option] [-P port] [-S program] source ... target
[15:19:31.467] Copying file to remote with scp vscode-server.tar.gz vscode-scp-done.flag XXX:/XXX/XXX/XXXX/.vscode-server/bin/17299e413d5590b14ab0340ea477cdd86ff13daf
[15:19:31.468] Using cwd: file:///c%3A/Users/RADIM~1.POD/AppData/Local/Temp/vscode_server_1595251171322
[15:19:31.468] Terminal shell path: C:\WINDOWS\System32\cmd.exe
[15:19:32.101] > scp: /XXX/XXX/XXXX/.vscode-server/bin/17299e413d5590b14ab0340ea477dd86ff13
> daf: No such file or directory
> ]0;C:\WINDOWS\System32\cmd.exe
[15:19:32.386] "Copy server to host" terminal command done
[15:23:11.534] > 

and here it is stuck forever.

I have found a workaround, it is working when you copy the downloaded server to the server manually and extract it to the bin folder under the correct hash of the version but it is pretty annoying especially with so many new version lately.

It doesn't seem like a hard error to fix, is there a chance that it will be fixed soon? Thanks!

WTassoux commented 4 years ago

Having the same problem on VSCode 1.48.0. Manually copying the tarball works

bamurtaugh commented 4 years ago

Thanks for the discussion here! Offline feedback may be related to https://github.com/microsoft/vscode-remote-release/issues/1242?

roblourens commented 4 years ago

Both of you have a weird character in this path that scp got, which is probably related, but I have no idea what's going on

Copying file to remote with scp vscode-server.tar.gz vscode-scp-done.flag home:/root/.vscode-server-insiders/bin/a3083e58e2a9e77f60e531acaa32e18527�ae8439

roblourens commented 4 years ago

Oh this was like https://github.com/microsoft/vscode-remote-release/issues/3139, I need to do the same in more places

li1234yun commented 2 years ago

image

Scp test failed! I see other normal host, I will not see scp exited with code: 1 error, maybe It cause the reason.

talregev commented 2 years ago

Still happen on v1.7.0. Are you working on it? Can we prioritize this issue?

piankma commented 2 years ago

happened to me today on 1.73.

[12:35:21.804] Testing scp with "scp"
[12:35:21.827] scp exited with code: 1
[12:35:21.827] 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
[12:35:21.827] Copying file to remote with scp -o ConnectTimeout=15 'vscode-server.zip' 'vscode-scp-done.flag' 

It should raise at least an error when receiving non-zero exit code, now it continues

willherbert27 commented 1 year ago

Also getting this error today on version 1.76.2. It is doing the same as with @piankma and continuing even when receiving a non-zero exit code.

Log:

[16:25:18.179] Log Level: 2 [16:25:18.651] "remote.SSH.useLocalServer": false [16:25:18.653] "remote.SSH.showLoginTerminal": false [16:25:18.654] "remote.SSH.remotePlatform": {} [16:25:18.654] "remote.SSH.path": C:\Windows\System32\OpenSSH\ssh.exe [16:25:18.655] "remote.SSH.configFile": undefined [16:25:18.655] "remote.SSH.useFlock": true [16:25:18.655] "remote.SSH.lockfilesInTmp": false [16:25:18.656] "remote.SSH.localServerDownload": always [16:25:18.670] "remote.SSH.remoteServerListenOnSocket": false [16:25:18.670] "remote.SSH.showLoginTerminal": false [16:25:18.671] "remote.SSH.defaultExtensions": [] [16:25:18.672] "remote.SSH.loglevel": 2 [16:25:18.672] "remote.SSH.enableDynamicForwarding": true [16:25:18.673] "remote.SSH.enableRemoteCommand": false [16:25:18.673] "remote.SSH.serverPickPortsFromRange": {} [16:25:18.673] "remote.SSH.serverInstallPath": {} [16:25:18.719] VS Code version: 1.77.0 [16:25:18.719] Remote-SSH version: remote-ssh@0.98.0 [16:25:18.719] win32 x64 [16:25:18.723] SSH Resolver called for host: mforgehn1.mayo.edu [16:25:18.723] Setting up SSH remote "mforgehn1.mayo.edu" [16:25:18.735] Using commit id "7f329fe6c66b0f86ae1574c2911b681ad5a45d63" and quality "stable" for server [16:25:18.782] Install and start server if needed [16:25:37.557] Checking ssh with "C:\Windows\System32\OpenSSH\ssh.exe -V" [16:25:37.954] > OpenSSH_for_Windows_8.1p1, [16:25:37.955] > LibreSSL 3.0.2

[16:25:37.976] Running script with connection command: "C:\Windows\System32\OpenSSH\ssh.exe" -T -D 51192 "mforgehn1.mayo.edu" bash [16:25:37.983] Terminal shell path: C:\WINDOWS\System32\cmd.exe [16:25:39.657] > ]0;C:\WINDOWS\System32\cmd.exe [16:25:39.659] Got some output, clearing connection timeout [16:25:40.494] > Enter PASSCODE: [16:25:44.952] > Enter PASSCODE:

[16:26:00.197] > [16:26:05.442] > e42a0cba672b: running [16:26:05.499] > Acquiring lock on /PRIVATEPATH/.vscode-server/bin/7f329fe6c66b0f86ae1574c2911b681ad5a45d63/vscode-remote-lock.m2147 79.7f329fe6c66b0f86ae1574c2911b681ad5a45d63 [16:26:05.525] > /PRIVATEPATH/.vscode-server/bin/7f329fe6c66b0f86ae1574c2911b681ad5a45d63... Trigger local server download e42a0cba672b:trigger_server_download platform==linux== vscodeArch==x64== destFolder==/PRIVATEPATH/.vscode-server/bin/== destFolder2==7f329fe6c66b0f86ae1574c2911b681ad5a45d63== e42a0cba672b:trigger_server_download_end Waiting for client to transfer server archive... Waiting for /PRIVATEPATH/.vscode-server/bin/7f329fe6c66b0f86ae1574c2911b681ad5a45d63/vscode-scp-done.flag and vscod e-server.tar.gz to exist

[16:26:05.527] Got request to download on client for {"platform":"linux","arch":"x64","destFolder":"/PRIVATEPATH/.vscode-server/bin/7f329fe6c66b0f86ae1574c2911b681ad5a45d63"} [16:26:05.531] Downloading VS Code server locally... [16:26:32.814] Downloaded VS Code server to c:\Users\m214779\AppData\Local\Temp\db1a3be9-16a0-43e7-8315-3b41923bbdb9 [16:26:32.817] Renamed VS Code server to c:\Users\m214779\AppData\Local\Temp\vscode_server_1680211592814\vscode-server.tar.gz [16:26:32.822] Checking ssh with "C:\Windows\System32\OpenSSH\ssh.exe -V" [16:26:32.968] > OpenSSH_for_Windows_8.1p1, LibreSSL 3.0.2

[16:26:32.972] Expecting scp to be next to ssh at C:\Windows\System32\OpenSSH\scp.exe [16:26:32.973] Testing scp with "C:\Windows\System32\OpenSSH\scp.exe" [16:26:33.076] scp exited with code: 1 [16:26:33.076] Got stderr from scp: usage: scp [-346BCpqrTv] [-c cipher] [-F ssh_config] [-i identity_file] [-J destination] [-l limit] [-o ssh_option] [-P port] [-S program] source ... target [16:26:33.078] Copying file to remote with "C:\Windows\System32\OpenSSH\scp.exe" "vscode-server.tar.gz" "vscode-scp-done.flag" "mforgehn1.mayo.edu":"/home/mayo/m214779/.vscode-server/bin/7f329fe6c66b0f86ae1574c2911b681ad5a45d63" [16:26:33.078] Using cwd: file:///c%3A/Users/m214779/AppData/Local/Temp/vscode_server_1680211592814 [16:26:33.078] Terminal shell path: C:\WINDOWS\System32\cmd.exe [16:26:33.479] > ]0;C:\WINDOWS\System32\cmd.exe [16:26:34.523] > Enter PASSCODE: [16:26:37.866] > Acquiring lock on /PRIVATEPATH/.vscode-server/bin/7f329fe6c66b0f86ae1574c2911b681ad5a45d63/vscode-remote-lock.m214779.7f3

29fe6c66b0f86ae1574c2911b681ad5a45d63 Installing to /PRIVATEPATH/.vscode-server/bin/7f329fe6c66b0f86ae1574c2911b681ad5a45d63... Trigger local server download e42a0cba672b:trigger_server_download platform==linux== vscodeArch==x64== destFolder==/home/mayo/m214779/.vscode-server/bin/== destFolder2==7f329fe6c66b0f86ae1574c2911b681ad5a45d63== e42a0cba672b:trigger_server_download_end Waiting for client to transfer server archive... Waiting for /home/mayo/m214779/.vscode-server/bin/7f329fe6c66b0f86ae1574c2911b681ad5a45d63/vscode-scp-done.flag and vscode-serv er.tar.gz to exist

treapster commented 1 year ago

Having the same issue after update

jrmims commented 1 year ago

The fix is to find a version that works and never update :) still rocking a version from 2020

On Tue, Apr 4, 2023, 9:51 AM treapster @.***> wrote:

Having the same issue after update

— Reply to this email directly, view it on GitHub https://github.com/microsoft/vscode-remote-release/issues/2792#issuecomment-1496012508, or unsubscribe https://github.com/notifications/unsubscribe-auth/ADLTE446P2O45OUZVO7ZKI3W7QRM3ANCNFSM4MLUWORA . You are receiving this because you are subscribed to this thread.Message ID: @.***>

jucdev commented 1 year ago

Solved for me!

I have 2 remote Windows servers, the 1st one was working and the 2nd one stopped working. I had the same SSH logs, it seems that VSCode couldn't copy his server to the 2nd server anymore (I don't know why).

I copied the files from the 1st server to the 2nd server: C:/Users/{myname1}/.vscode-server from the 1st server to 2nd server C:/Users/{myname2}/.vscode-server.

Be sure to use the correct SSH user {myname2} to connect to the server after that.

talregev commented 1 year ago

Solved for me!

I have 2 remote Windows servers, the 1st one was working and the 2nd one stopped working. I had the same SSH logs, it seems that VSCode couldn't copy his server to the 2nd server anymore (I don't know why).

I copied the files from the 1st server to the 2nd server: C:/Users/{myname1}/.vscode-server from the 1st server to 2nd server C:/Users/{myname2}/.vscode-server.

Be sure to use the correct SSH user {myname2} to connect to the server after that.

We already familiar with this workaround. It should solved without this.

melMass commented 1 year ago

The exact issue from the OP in 1.45 is still present in Insiders 1.82 with a windows host and a mac client:

[10:12:52.578] Checking ssh with "ssh -V"
[10:12:52.586] > OpenSSH_9.0p1, LibreSSL 3.3.6

[10:12:52.587] Testing scp with "scp"
[10:12:52.595] scp exited with code: 1
[10:12:52.595] 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
[10:12:52.595] Copying file to remote with scp -o ConnectTimeout=15 'vscode-server.zip' 'vscode-scp-done.flag' 'mel-pc':'C:\Users\User\.vscode-server-insiders\bin\501baeb5e07b5a404f862d922bacb93771d91331'
[10:12:52.596] Using cwd: file:///var/folders/b5/m1nplt654p37sbyqdfkj0l2m0000gn/T/vscode_server_1692519172576
[10:12:53.266] > subsystem request failed on channel 0
> scp: Connection closed
[10:12:53.515] "Copy server to host" terminal command done

I'm guessing this is setup this way (scp instead of a local dll on host) assuming the host might not have internet?

htgasunie commented 11 months ago

Im also having this issue in 1.83.1 unfortunately. Im having VS code installed on a W11 machine and trying to access a linux server.

mvanaltvorst commented 8 months ago

I encountered this issue as well, in my case it meant that the drive on my host was full.

cohenchris commented 3 weeks ago

Also encountered this issue on 1.94.2