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

[Remote-SSH Bug]: VSCode failt to install code-server when i use “”Local Server Download" #10026

Closed
3 tasks done
XhosaS opened this issue Jul 4, 2024 · 9 comments
Closed
3 tasks done
Assignees
Labels
bug Issue identified by VS Code Team member as probable bug ssh Issue in vscode-remote SSH

Comments

@XhosaS
Copy link

XhosaS commented Jul 4, 2024

Is there an existing issue for this bug?

  • I have searched the existing issues

Required Troubleshooting Steps

  • I have followed these troubleshooting steps
  • I have tried both values of the remote.SSH.useLocalServer setting

Connect Locally

It connects successfully

->

No response

Expected Behavior

When I use "Local Server Download", VSCode scps the file c:\Users\xhosa.liu\AppData\Local\Temp\vscode_server_1720084729396\vscode-cli-ea1445cc7016315d0f5728f8e8 to ~/.vscode-server on my server. However, during extraction with tar, tar interprets colons (:) in file names as meaning it is a file on another machine, so the extraction fails. Can you add --force-local to the extraction command, or is there any other solution?

Steps To Reproduce

  • Remote OS Version: a offline Ubuntu 14.04.6 LTS, Trusty Tahr
  • VSCode Version: 1.91.0
  • Local OS Version: Windows 10
  • Remote-SSH Version:v0.112.0

connect ssh with "Local Server Download"

Remote-SSH Log

Remote-SSH Log

[17:44:09.448] Log Level: 2
[17:44:09.456] SSH Resolver called for "ssh-remote+172.21.16.233", attempt 1
[17:44:09.456] "remote.SSH.useLocalServer": false
[17:44:09.457] "remote.SSH.useExecServer": true
[17:44:09.457] "remote.SSH.showLoginTerminal": false
[17:44:09.457] "remote.SSH.remotePlatform": {"172.21.16.233":"linux"}
[17:44:09.457] "remote.SSH.path": D:\Program Files\Git\usr\bin\ssh.exe
[17:44:09.457] "remote.SSH.configFile": undefined
[17:44:09.457] "remote.SSH.useFlock": true
[17:44:09.457] "remote.SSH.lockfilesInTmp": false
[17:44:09.457] "remote.SSH.localServerDownload": auto
[17:44:09.457] "remote.SSH.remoteServerListenOnSocket": false
[17:44:09.457] "remote.SSH.showLoginTerminal": false
[17:44:09.457] "remote.SSH.defaultExtensions": []
[17:44:09.457] "remote.SSH.loglevel": 2
[17:44:09.458] "remote.SSH.enableDynamicForwarding": true
[17:44:09.458] "remote.SSH.enableRemoteCommand": false
[17:44:09.458] "remote.SSH.serverPickPortsFromRange": {}
[17:44:09.458] "remote.SSH.serverInstallPath": {}
[17:44:09.465] VS Code version: 1.91.0
[17:44:09.465] Remote-SSH version: remote-ssh@0.112.0
[17:44:09.465] win32 x64
[17:44:09.467] SSH Resolver called for host: 172.21.16.233
[17:44:09.467] Setting up SSH remote "172.21.16.233"
[17:44:09.472] Using commit id "ea1445cc7016315d0f5728f8e8b12a45dc0a7286" and quality "stable" for server
[17:44:09.474] Install and start server if needed
[17:44:09.476] Checking ssh with "D:\Program Files\Git\usr\bin\ssh.exe -V"
[17:44:09.612] > OpenSSH_7.9p1, OpenSSL 1.1.1a  20 Nov 2018

[17:44:09.631] Running script with connection command: "D:\Program Files\Git\usr\bin\ssh.exe" -T -D 51128 "172.21.16.233" bash
[17:44:09.633] Terminal shell path: C:\WINDOWS\System32\cmd.exe
[17:44:10.688] > �]0;C:\WINDOWS\System32\cmd.exe�
[17:44:10.689] Got some output, clearing connection timeout
[17:44:10.720] > 11862286b493: running
> Installing to /home/xhosa.liu/.vscode-server...
> 11862286b493%%1%%
> Downloading with wget
[17:44:46.112] > wget download failed
> 
> printenv:
>     XDG_SESSION_ID=41
>     SHELL=/bin/bash
>     SSH_CLIENT=10.10.31.81 51131 22
>     USER=xhosa.liu
>     VSCODE_AGENT_FOLDER=/home/xhosa.liu/.vscode-server
>     PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games
> :/usr/local/games
>     MAIL=/var/mail/xhosa.liu
>     PWD=/home/xhosa.liu/.vscode-server
>     LANG=en_US.UTF-8
>     HOME=/home/xhosa.liu
>     SHLVL=2
>     LANGUAGE=en_US:en
>     LOGNAME=xhosa.liu
>     SSH_CONNECTION=10.10.31.81 51131 172.21.16.233 22
>     XDG_RUNTIME_DIR=/run/user/1002
>     OLDPWD=/home/xhosa.liu
>     _=/usr/bin/printenv
> Trigger local server download
> 11862286b493:trigger_server_download
> artifact==cli-alpine-x64==
> destFolder==/home/xhosa.liu/.vscode-server==
> destFolder2==/vscode-cli-ea1445cc7016315d0f5728f8e8b12a45dc0a7286.tar.gz==      
> 11862286b493:trigger_server_download_end
> Waiting for client to transfer server archive...
> Waiting for /home/xhosa.liu/.vscode-server/vscode-cli-ea1445cc7016315d0f5728f8e8
> b12a45dc0a7286.tar.gz.done and vscode-server.tar.gz to exist
[17:44:46.116] Got request to download on client for {"artifact":"cli-alpine-x64","destPath":"/home/xhosa.liu/.vscode-server/vscode-cli-ea1445cc7016315d0f5728f8e8b12a45dc0a7286.tar.gz"}
[17:44:46.117] Downloading VS Code server locally...
[17:44:46.127] > 
> 
[17:44:46.954] Downloaded VS Code server to c:\Users\xhosa.liu\AppData\Local\Temp\8e6a552b-2d80-4547-990c-a11d85af9849
[17:44:46.959] Renamed VS Code server to c:\Users\xhosa.liu\AppData\Local\Temp\vscode_server_1720086286954\vscode-cli-ea1445cc7016315d0f5728f8e8b12a45dc0a7286.tar.gz
[17:44:46.964] Checking ssh with "D:\Program Files\Git\usr\bin\ssh.exe -V"
[17:44:47.081] > OpenSSH_7.9p1, OpenSSL 1.1.1a  20 Nov 2018

[17:44:47.102] Expecting scp to be next to ssh at D:\Program Files\Git\usr\bin\scp.exe
[17:44:47.102] Testing scp with "D:\Program Files\Git\usr\bin\scp.exe"
[17:44:47.226] scp exited with code: 1
[17:44:47.226] 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
[17:44:47.227] Copying file to remote with "D:\Program Files\Git\usr\bin\scp.exe" "c:\Users\xhosa.liu\AppData\Local\Temp\vscode_server_1720086286954\vscode-cli-ea1445cc7016315d0f5728f8e8b12a45dc0a7286.tar.gz" "vscode-cli-ea1445cc7016315d0f5728f8e8b12a45dc0a7286.tar.gz.done" "172.21.16.233":"/home/xhosa.liu/.vscode-server"
[17:44:47.227] Using cwd: file:///c%3A/Users/xhosa.liu/AppData/Local/Temp/vscode_server_1720086286954
[17:44:47.227] Terminal shell path: C:\WINDOWS\System32\cmd.exe
[17:44:48.359] > �]0;C:\WINDOWS\System32\cmd.exe�
[17:44:48.385] > c:\Users\xhosa.liu\AppData\Local\Temp\vscode_   0%    0     0.0KB/s   --:-- ETA
[17:44:49.370] > 
[17:44:49.383] > c:\Users\xhosa.liu\AppData\Local\Temp\vscode_  81% 7104KB   6.9MB/s   00:00 ETA
[17:44:49.624] > 
[17:44:49.641] > c:\Users\xhosa.liu\AppData\Local\Temp\vscode_ 100% 8755KB   6.8MB/s   00:01    
[17:44:49.668] > vscode-cli-ea1445cc7016315d0f5728f8e8b12a45dc   0%    0     0.0KB/s   --:-- ETA
[17:44:49.682] > 
[17:44:49.698] > vscode-cli-ea1445cc7016315d0f5728f8e8b12a45dc 100%    9     0.3KB/s   00:00    
[17:44:51.017] "Copy server to host" terminal command done
[17:44:52.088] > Found flag and server on host
> 11862286b493%%2%%
> tar --version:
> tar (GNU tar) 1.27.1
> Copyright (C) 2013 Free Software Foundation, Inc.
> License GPLv3+: GNU GPL version 3 or later <http://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.
> tar: This does not look like a tar archive
> 
> gzip: stdin: unexpected end of file
> tar: Child returned status 1
> tar: Error is not recoverable: exiting now
> ERROR: tar exited with non-0 exit code: 0
[17:44:52.103] > 
> Already attempted local download, failing
> 11862286b493: start
> exitCode==37==
> listeningOn====
> osReleaseId==ubuntu==
> arch==x86_64==
> vscodeArch==x64==
> bitness==64==
> tmpDir==/run/user/1002==
> platform==linux==
> unpackResult==error==
> didLocalDownload==1==
> downloadTime====
> installTime==4==
> serverStartTime====
> execServerToken==a1a1a111-1111-1a11-1a1a-1a1aaaa11111==
> 11862286b493: end
[17:44:52.103] Received install output: 
exitCode==37==
listeningOn====
osReleaseId==ubuntu==
arch==x86_64==
vscodeArch==x64==
bitness==64==
tmpDir==/run/user/1002==
platform==linux==
unpackResult==error==
didLocalDownload==1==
downloadTime====
installTime==4==
serverStartTime====
execServerToken==a1a1a111-1111-1a11-1a1a-1a1aaaa11111==

[17:44:52.105] Resolver error: Error: 无法安装 VS Code 服务器
	at g.ServerInstallError (c:\Users\xhosa.liu\.vscode\extensions\ms-vscode-remote.remote-ssh-0.112.0\out\extension.js:2:499852)
	at d (c:\Users\xhosa.liu\.vscode\extensions\ms-vscode-remote.remote-ssh-0.112.0\out\extension.js:2:493513)
	at t.handleInstallOutput (c:\Users\xhosa.liu\.vscode\extensions\ms-vscode-remote.remote-ssh-0.112.0\out\extension.js:2:495331)
	at t.tryInstall (c:\Users\xhosa.liu\.vscode\extensions\ms-vscode-remote.remote-ssh-0.112.0\out\extension.js:2:621085)
	at async c:\Users\xhosa.liu\.vscode\extensions\ms-vscode-remote.remote-ssh-0.112.0\out\extension.js:2:580730
	at async t.withShowDetailsEvent (c:\Users\xhosa.liu\.vscode\extensions\ms-vscode-remote.remote-ssh-0.112.0\out\extension.js:2:584036)
	at async k (c:\Users\xhosa.liu\.vscode\extensions\ms-vscode-remote.remote-ssh-0.112.0\out\extension.js:2:577649)
	at async t.resolve (c:\Users\xhosa.liu\.vscode\extensions\ms-vscode-remote.remote-ssh-0.112.0\out\extension.js:2:581407)
	at async c:\Users\xhosa.liu\.vscode\extensions\ms-vscode-remote.remote-ssh-0.112.0\out\extension.js:2:848023
[17:44:52.109] ------




[17:44:52.368] > 
[17:44:52.600] Opening exec server for ssh-remote+172.21.16.233
[17:44:52.630] Initizing new exec server for ssh-remote+172.21.16.233
[17:44:52.653] Using commit id "ea1445cc7016315d0f5728f8e8b12a45dc0a7286" and quality "stable" for server
[17:44:52.655] Install and start server if needed
[17:44:52.665] Running script with connection command: "D:\Program Files\Git\usr\bin\ssh.exe" -T -D 51128 "172.21.16.233" bash
[17:44:52.667] Terminal shell path: C:\WINDOWS\System32\cmd.exe
[17:44:53.424] "install" terminal command done
[17:44:53.424] Install terminal quit with output: 
[17:44:53.781] > �]0;C:\WINDOWS\System32\cmd.exe�
[17:44:53.782] Got some output, clearing connection timeout
[17:44:53.805] > 50403a12fd42: running
> Installing to /home/xhosa.liu/.vscode-server...
> 50403a12fd42%%1%%
> Downloading with wget
[17:45:29.214] > wget download failed
> 
> printenv:
>     XDG_SESSION_ID=43
>     SHELL=/bin/bash
>     SSH_CLIENT=10.10.31.81 51169 22
>     USER=xhosa.liu
>     VSCODE_AGENT_FOLDER=/home/xhosa.liu/.vscode-server
>     PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games
> :/usr/local/games
>     MAIL=/var/mail/xhosa.liu
>     PWD=/home/xhosa.liu/.vscode-server
>     LANG=en_US.UTF-8
>     HOME=/home/xhosa.liu
>     SHLVL=2
>     LANGUAGE=en_US:en
>     LOGNAME=xhosa.liu
>     SSH_CONNECTION=10.10.31.81 51169 172.21.16.233 22
>     XDG_RUNTIME_DIR=/run/user/1002
>     OLDPWD=/home/xhosa.liu
>     _=/usr/bin/printenv
> Trigger local server download
> 50403a12fd42:trigger_server_download
> artifact==cli-alpine-x64==
> destFolder==/home/xhosa.liu/.vscode-server==
> destFolder2==/vscode-cli-ea1445cc7016315d0f5728f8e8b12a45dc0a7286.tar.gz==      
> 50403a12fd42:trigger_server_download_end
> Waiting for client to transfer server archive...
> Waiting for /home/xhosa.liu/.vscode-server/vscode-cli-ea1445cc7016315d0f5728f8e8
> b12a45dc0a7286.tar.gz.done and vscode-server.tar.gz to exist
> 
[17:45:29.215] Got request to download on client for {"artifact":"cli-alpine-x64","destPath":"/home/xhosa.liu/.vscode-server/vscode-cli-ea1445cc7016315d0f5728f8e8b12a45dc0a7286.tar.gz"}
[17:45:29.215] Downloading VS Code server locally...
[17:45:29.353] Downloaded VS Code server to c:\Users\xhosa.liu\AppData\Local\Temp\76175617-a5d1-430c-abbe-1bbef03b5b6a
[17:45:29.356] Renamed VS Code server to c:\Users\xhosa.liu\AppData\Local\Temp\vscode_server_1720086329354\vscode-cli-ea1445cc7016315d0f5728f8e8b12a45dc0a7286.tar.gz
[17:45:29.359] Checking ssh with "D:\Program Files\Git\usr\bin\ssh.exe -V"
[17:45:29.475] > OpenSSH_7.9p1, OpenSSL 1.1.1a  20 Nov 2018

[17:45:29.480] Expecting scp to be next to ssh at D:\Program Files\Git\usr\bin\scp.exe
[17:45:29.480] Testing scp with "D:\Program Files\Git\usr\bin\scp.exe"
[17:45:29.597] scp exited with code: 1
[17:45:29.597] 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
[17:45:29.598] Copying file to remote with "D:\Program Files\Git\usr\bin\scp.exe" "c:\Users\xhosa.liu\AppData\Local\Temp\vscode_server_1720086329354\vscode-cli-ea1445cc7016315d0f5728f8e8b12a45dc0a7286.tar.gz" "vscode-cli-ea1445cc7016315d0f5728f8e8b12a45dc0a7286.tar.gz.done" "172.21.16.233":"/home/xhosa.liu/.vscode-server"
[17:45:29.598] Using cwd: file:///c%3A/Users/xhosa.liu/AppData/Local/Temp/vscode_server_1720086329354
[17:45:29.598] Terminal shell path: C:\WINDOWS\System32\cmd.exe
[17:45:30.726] > �]0;C:\WINDOWS\System32\cmd.exe�
[17:45:30.748] > c:\Users\xhosa.liu\AppData\Local\Temp\vscode_   0%    0     0.0KB/s   --:-- ETA
[17:45:31.751] > 
[17:45:31.765] > c:\Users\xhosa.liu\AppData\Local\Temp\vscode_  77% 6784KB   6.5MB/s   00:00 ETA
[17:45:32.020] > 
[17:45:32.035] > c:\Users\xhosa.liu\AppData\Local\Temp\vscode_ 100% 8755KB   6.6MB/s   00:01    
[17:45:32.066] > vscode-cli-ea1445cc7016315d0f5728f8e8b12a45dc   0%    0     0.0KB/s   --:-- ETA
[17:45:32.083] > 
[17:45:32.097] > vscode-cli-ea1445cc7016315d0f5728f8e8b12a45dc 100%    9     0.3KB/s   00:00    
[17:45:32.205] > Found flag and server on host
> 50403a12fd42%%2%%
> tar --version:
> tar (GNU tar) 1.27.1
> Copyright (C) 2013 Free Software Foundation, Inc.
> License GPLv3+: GNU GPL version 3 or later <http://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.
> tar: This does not look like a tar archive
> 
> gzip: stdin: unexpected end of file
> tar: Child returned status 1
> tar: Error is not recoverable: exiting now
[17:45:32.220] > 
> ERROR: tar exited with non-0 exit code: 0
> Already attempted local download, failing
> 50403a12fd42: start
> exitCode==37==
> listeningOn====
> osReleaseId==ubuntu==
> arch==x86_64==
> vscodeArch==x64==
> bitness==64==
> tmpDir==/run/user/1002==
> platform==linux==
> unpackResult==error==
> didLocalDownload==1==
> downloadTime====
> installTime==5==
> serverStartTime====
> execServerToken==11111aaa-aa1a-111a-a11a-1111a1a1a1a1==
> 50403a12fd42: end
[17:45:32.220] Received install output: 
exitCode==37==
listeningOn====
osReleaseId==ubuntu==
arch==x86_64==
vscodeArch==x64==
bitness==64==
tmpDir==/run/user/1002==
platform==linux==
unpackResult==error==
didLocalDownload==1==
downloadTime====
installTime==5==
serverStartTime====
execServerToken==11111aaa-aa1a-111a-a11a-1111a1a1a1a1==

[17:45:32.221] Exec server for ssh-remote+172.21.16.233 failed: Error: 无法安装 VS Code 服务器
[17:45:32.221] Error opening exec server for ssh-remote+172.21.16.233: Error: 无法安装 VS Code 服务器
[17:45:32.232] > 
[17:45:33.466] "Copy server to host" terminal command done
[17:45:33.763] "install" terminal command done
[17:45:33.763] Install terminal quit with output: 

Anything else?

i run tar in my local terminal :
tar (child): Cannot connect to c: resolve failed

gzip: stdin: unexpected end of file
tar: Child returned status 128
tar: Error is not recoverable: exiting now

@XhosaS XhosaS added the ssh Issue in vscode-remote SSH label Jul 4, 2024
@sergiosierram
Copy link

I have tried remote ssh with macOS silicon connecting to a raspberry pi.

Same issue with login loop installing vscode server.

Workaround for now:
I have downgrade vscode to v1.85 and it works again

@XhosaS
Copy link
Author

XhosaS commented Jul 31, 2024

@roblourens Do you have any suggestions for this issue?

@roblourens
Copy link
Member

However, during extraction with tar, tar interprets colons (:) in file names as meaning it is a file on another machine, so the extraction fails.

Where are you seeing a colon in the file name?

@roblourens roblourens added the info-needed Issue requires more information from poster label Aug 1, 2024
@XhosaS
Copy link
Author

XhosaS commented Aug 2, 2024

However, during extraction with tar, tar interprets colons (:) in file names as meaning it is a file on another machine, so the extraction fails.

Where are you seeing a colon in the file name?

VSCode first downloads vscode-server to my C drive, and then when executing the scp command, it uses my directory as the server's name for the transfer (e.g., C:\Users\xhosa.liu\AppData\Local\Temp\vscode_server_1720084729396\vscode-cli-ea1445cc7016315d0f5728f8e8). The C drive contains colon.

And when I enter the ~/.vscode-server/bin directory, I can see that the filename of the scp includes a colon.

@XhosaS
Copy link
Author

XhosaS commented Aug 8, 2024

image
@roblourens this is my remote server dir.

@XhosaS
Copy link
Author

XhosaS commented Aug 14, 2024

@roblourens Do you have any suggestions for this issue?

@roblourens
Copy link
Member

@connor4312 I think you changed something with the scp path?

@roblourens roblourens added bug Issue identified by VS Code Team member as probable bug and removed info-needed Issue requires more information from poster labels Aug 14, 2024
@connor4312
Copy link
Member

This should be fixed in the latest version of Remote - SSH. Does this happen on Remote - SSH version v0.113.1 or higher?

@XhosaS
Copy link
Author

XhosaS commented Aug 15, 2024

This should be fixed in the latest version of Remote - SSH. Does this happen on Remote - SSH version v0.113.1 or higher?

Yes, v0.113.1 fixed this bug. thanks

@XhosaS XhosaS closed this as completed Aug 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Issue identified by VS Code Team member as probable bug ssh Issue in vscode-remote SSH
Projects
None yet
Development

No branches or pull requests

4 participants