skip to Main Content

In this month i always connected to a ssh server with vscode ssh connection, and the only thing i do to close my connection is close the window. But this time i can’t reconnect due to an error.

This is my log:


 Log Level: 2
 SSH Resolver called for "ssh-remote+<SERVER IP>", attempt 1
 "remote.SSH.useLocalServer": false
 "remote.SSH.useExecServer": true
 "remote.SSH.showLoginTerminal": false
 "remote.SSH.remotePlatform": {"<SERVER IP>":"linux","1<SERVER IP2>":"linux","<SERVER IP3>":"linux"}
 "remote.SSH.path": undefined
 "remote.SSH.configFile": C:Users<User>.sshconfig
 "remote.SSH.useFlock": true
 "remote.SSH.lockfilesInTmp": false
 "remote.SSH.localServerDownload": auto
 "remote.SSH.remoteServerListenOnSocket": false
 "remote.SSH.showLoginTerminal": false
 "remote.SSH.defaultExtensions": []
 "remote.SSH.loglevel": 2
 "remote.SSH.enableDynamicForwarding": true
 "remote.SSH.enableRemoteCommand": false
 "remote.SSH.serverPickPortsFromRange": {}
 "remote.SSH.serverInstallPath": {}
 VS Code version: 1.91.0
 Remote-SSH version: [email protected]
 win32 x64
 SSH Resolver called for host: <SERVER IP>
 Setting up SSH remote "<SERVER IP>"
 Using commit id "ea1445cc7016315d0f5728f8e8b12a45dc0a7286" and quality "stable" for server
 Install and start server if needed
 Checking ssh with "C:Program FilesEclipse Adoptiumjdk-17.0.4.101-hotspotbinssh.exe -V"
 Got error from ssh: spawn C:Program FilesEclipse Adoptiumjdk-17.0.4.101-hotspotbinssh.exe ENOENT
 Checking ssh with "C:WindowsSystem32HWAudioDriverLibsssh.exe -V"
 Got error from ssh: spawn C:WindowsSystem32HWAudioDriverLibsssh.exe ENOENT
Checking ssh with "C:WINDOWSsystem32ssh.exe -V"
 Got error from ssh: spawn C:WINDOWSsystem32ssh.exe ENOENT
 Checking ssh with "C:WINDOWSssh.exe -V"
Got error from ssh: spawn C:WINDOWSssh.exe ENOENT
Checking ssh with "C:WINDOWSSystem32Wbemssh.exe -V"
Got error from ssh: spawn C:WINDOWSSystem32Wbemssh.exe ENOENT
Checking ssh with "C:WINDOWSSystem32WindowsPowerShellv1.0ssh.exe -V"
Got error from ssh: spawn C:WINDOWSSystem32WindowsPowerShellv1.0ssh.exe ENOENT
 Checking ssh with "C:WINDOWSSystem32OpenSSHssh.exe -V"
 > OpenSSH_for_Windows_8.6p1, LibreSSL 3.4.3

Using SSH config file "C:Users<User>.sshconfig"
Running script with connection command: "C:WINDOWSSystem32OpenSSHssh.exe" -T -D 5616 -F "C:Users<User>.sshconfig" "<SERVER IP>" bash
Terminal shell path: C:WINDOWSSystem32cmd.exe
>  user@<SERVER IP>'s password:]0;C:WINDOWSSystem32cmd.exe 
Got some output, clearing connection timeout
Showing password prompt
Got password response
"install" wrote data to terminal: "*******"
> 
> 0a1a67f567e7: running
> Installing to /home/ user/.vscode-server...
> 0a1a67f567e7%%1%%
> Downloading with wget
> wget download failed
> Cannot write to ‘vscode-cli-ea1445cc7016315d0f5728f8e8b12a45dc0a7286.tar.gz’ (Success).
> printenv:
>     SHELL=/bin/bash
>     PWD=/home/ user/.vscode-server
>     LOGNAME= user
>     XDG_SESSION_TYPE=tty
>     MOTD_SHOWN=pam
>     HOME=/home/ user
>     LANG=en_US.UTF-8
>     VSCODE_AGENT_FOLDER=/home/ user/.vscode-server
>     SSH_CONNECTION=93.40.209.177 45921 <SERVER IP> <Port>
>     XDG_SESSION_CLASS=user
>     USER= user
>     SHLVL=0
>     XDG_SESSION_ID=991
>     XDG_RUNTIME_DIR=/run/user/1193
>     SSH_CLIENT=93.40.209.177 45921 <Port>
>     PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin
>     DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/1193/bus
>     OLDPWD=/home/ user
>     _=/usr/bin/printenv
> Trigger local server download
> 0a1a67f567e7:trigger_server_download
> artifact==cli-alpine-x64==
> 
> destFolder==/home/ user/.vscode-server==
> destFolder2==/vscode-cli-ea1445cc7016315d0f5728f8e8b12a45dc0a7286.tar.gz==      
> 0a1a67f567e7:trigger_server_download_end
> Waiting for client to transfer server archive...
> Waiting for /home/ user/.vscode-server/vscode-cli-ea1445cc7016315d0f5728f8e8b1
> 12a45dc0a7286.tar.gz.done and vscode-server.tar.gz to exist
> 
Got request to download on client for {"artifact":"cli-alpine-x64","destPath":"/home/ user/.vscode-server/vscode-cli-ea1445cc7016315d0f5728f8e8b12a45dc0a7286.tar.gz"}
Downloading VS Code server locally...
Downloaded VS Code server to c:Users<User>AppDataLocalTempee41220b-0352-46c4-b93e-371eabfac3bf
Renamed VS Code server to c:Users<User>AppDataLocalTempvscode_server_1720687265302vscode-cli-ea1445cc7016315d0f5728f8e8b12a45dc0a7286.tar.gz
Checking ssh with "C:Program FilesEclipse Adoptiumjdk-17.0.4.101-hotspotbinssh.exe -V"
Got error from ssh: spawn C:Program FilesEclipse Adoptiumjdk-17.0.4.101-hotspotbinssh.exe ENOENT
 Checking ssh with "C:WindowsSystem32HWAudioDriverLibsssh.exe -V"
 Got error from ssh: spawn C:WindowsSystem32HWAudioDriverLibsssh.exe ENOENT
 Checking ssh with "C:WINDOWSsystem32ssh.exe -V"
 Got error from ssh: spawn C:WINDOWSsystem32ssh.exe ENOENT
 Checking ssh with "C:WINDOWSssh.exe -V"
 Got error from ssh: spawn C:WINDOWSssh.exe ENOENT
 Checking ssh with "C:WINDOWSSystem32Wbemssh.exe -V"
 Got error from ssh: spawn C:WINDOWSSystem32Wbemssh.exe ENOENT
 Checking ssh with "C:WINDOWSSystem32WindowsPowerShellv1.0ssh.exe -V"
 Got error from ssh: spawn C:WINDOWSSystem32WindowsPowerShellv1.0ssh.exe ENOENT
 Checking ssh with "C:WINDOWSSystem32OpenSSHssh.exe -V"
 > OpenSSH_for_Windows_8.6p1, LibreSSL 3.4.3

 Expecting scp to be next to ssh at C:WINDOWSSystem32OpenSSHscp.exe
 Testing scp with "C:WINDOWSSystem32OpenSSHscp.exe"
 scp exited with code: 1
 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
 Using SSH config file "C:Users<User>.sshconfig"
 Copying file to remote with "C:WINDOWSSystem32OpenSSHscp.exe" -F "C:Users<User>.sshconfig" "c:Users<User>AppDataLocalTempvscode_server_1720687265302vscode-cli-ea1445cc7016315d0f5728f8e8b12a45dc0a7286.tar.gz" "vscode-cli-ea1445cc7016315d0f5728f8e8b12a45dc0a7286.tar.gz.done" "<SERVER IP>":"/home/ user/.vscode-server"
 Using cwd: file:///c%3A/Users/<User>/AppData/Local/Temp/vscode_server_1720687265302
 Terminal shell path: C:WINDOWSSystem32cmd.exe
[10:41:06.260] >  user@<SERVER IP>'s password:]0;C:WINDOWSSystem32cmd.exe 
[10:41:06.262] Showing password prompt
[10:41:09.461] Got password response
[10:41:09.462] "Copy server to host" wrote data to terminal: "*******"
[10:41:09.515] > 
[10:41:10.395] > vscode-cli-ea1445cc7016315d0f5728f8e8b12a45dc0a7286.tar.gz   0%    0     0.0KB/
[10:41:11.475] > vscode-cli-ea1445cc7016315d0f5728f8e8b12a45dc0a7286.tar.gz  46% 4080KB   3.7MB/
[10:41:12.415] > vscode-cli-ea1445cc7016315d0f5728f8e8b12a45dc0a7286.tar.gz  69% 6128KB   3.5MB/
> vscode-cli-ea1445cc7016315d0f5728f8e8b12a45dc0a7286.tar.gz  94% 8304KB   3.4MB/
> scp: /home/ user/.vscode-server/vscode-cli-ea1445cc7016315d0f5728f8e8b12a45dc0a7286.tar.gz: Disk quota exceeded
> vscode-cli-ea1445cc7016315d0f5728f8e8b12a45dc0a7286.tar.gz 100% 8755KB   2.1MB/
> vscode-cli-ea1445cc7016315d0f5728f8e8b12a45dc0a7286.tar.gz.done   0%    0     0
> scp: /home/ user/.vscode-server/vscode-cli-ea1445cc7016315d0f5728f8e8b12a45dc0a7286.tar.gz.done: Disk quota exceeded
> vscode-cli-ea1445cc7016315d0f5728f8e8b12a45dc0a7286.tar.gz.done 100%    9     0
"Copy server to host" terminal command done
> Found flag and server on host
> 0a1a67f567e7%%2%%
> tar --version:
> tar (GNU tar) 1.30
[10:41:16.853] > 
> Copyright (C) 2017 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.
> ERROR: tar exited with non-0 exit code: 0
> Already attempted local download, failing
> 0a1a67f567e7: start
> exitCode==37==
> 
> listeningOn====
> osReleaseId==ubuntu==
> arch==x86_64==
> vscodeArch==x64==
> bitness==64==
> tmpDir==/run/user/1193==
> platform==linux==
> unpackResult==error==
> didLocalDownload==1==
> downloadTime====
> installTime==8==
> serverStartTime====
[10:41:16.871] > 
> execServerToken==11aa1a1a-1a11-1a11-a11a-a111111a11aa==
> tar: This does not look like a tar archive
> 
> gzip: stdin: unexpected end of file
[10:41:16.889] > 
> tar: Child returned status 1
> tar: Error is not recoverable: exiting now
> 0a1a67f567e7: end
[10:41:16.891] Received install output: 
exitCode==37==
listeningOn====
osReleaseId==ubuntu==
arch==x86_64==
vscodeArch==x64==
bitness==64==
tmpDir==/run/user/1193==
platform==linux==
unpackResult==error==
didLocalDownload==1==
downloadTime====
installTime==8==
serverStartTime====
execServerToken==11aa1a1a-1a11-1a11-a11a-a111111a11aa==
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

Resolver error: Error: Failed to install the VS Code Server
    at g.ServerInstallError (c:Users<User>.vscodeextensionsms-vscode-remote.remote-ssh-0.112.0outextension.js:2:499852)
    at d (c:Users<User>.vscodeextensionsms-vscode-remote.remote-ssh-0.112.0outextension.js:2:493513)
    at t.handleInstallOutput (c:Users<User>.vscodeextensionsms-vscode-remote.remote-ssh-0.112.0outextension.js:2:495331)
    at t.tryInstall (c:Users<User>.vscodeextensionsms-vscode-remote.remote-ssh-0.112.0outextension.js:2:621085)
    at async c:Users<User>.vscodeextensionsms-vscode-remote.remote-ssh-0.112.0outextension.js:2:580730
    at async t.withShowDetailsEvent (c:Users<User>.vscodeextensionsms-vscode-remote.remote-ssh-0.112.0outextension.js:2:584036)
    at async k (c:Users<User>.vscodeextensionsms-vscode-remote.remote-ssh-0.112.0outextension.js:2:577649)
    at async t.resolve (c:Users<User>.vscodeextensionsms-vscode-remote.remote-ssh-0.112.0outextension.js:2:581407)
    at async c:Users<User>.vscodeextensionsms-vscode-remote.remote-ssh-0.112.0outextension.js:2:848023
------

"install" terminal command done
Install terminal quit with output: 

I dont know if is it my problem or the problem can be caused by something in the server not depending by me.

2

Answers


  1. I have just resolved this on my QNAP system. Not sure if it might apply to you.

    wget (busybox) on my system in /usr/bin/wget is

    GNU Wget 1.16

    I also have a more recent wget installed with Entware in /opt/bin/wget

    GNU Wget 1.21.4

    /usr/bin/wget will fail to download vscode server, but /opt/bin/wget works

    > /usr/bin/wget https://vscode.download.prss.microsoft.com/dbazure/download/stable/f1e16e1e6214d7c44d078b1f0607b2388f29d729/vscode-server-linux-x64.tar.gz
    
    --2024-07-17 17:51:56--  https://vscode.download.prss.microsoft.com/dbazure/download/stable/f1e16e1e6214d7c44d078b1f0607b2388f29d729/vscode-server-linux-x64.tar.gz
        Resolving vscode.download.prss.microsoft.com (vscode.download.prss.microsoft.com)... 2606:2800:247:1cb7:261b:1f9c:2074:3c, 152.199.39.108
    
    Connecting to vscode.download.prss.microsoft.com (vscode.download.prss.microsoft.com)|2606:2800:247:1cb7:261b:1f9c:2074:3c|:443... connected.
    OpenSSL: error:1409442E:SSL routines:ssl3_read_bytes:tlsv1 alert protocol version
    Unable to establish SSL connection.
    

    In my normal usage, I have made sure that /opt/bin is before /usr/bin in my PATH.

    However, when VSCODE connects using a non-interactive non-login shell, they are reversed in the PATH.

    PATH=/usr/bin:/bin:/usr/sbin:/sbin:/opt/bin
    

    I renamed /usr/bin/wget to something else so it wouldn’t be found, the installation then used /opt/bin/wget, and everything worked.

    A second issue was related: after starting the server, it couldn’t find the process ID because the busybox ps was obsolete, and the updated version is in /opt/bin/ps

    ps: invalid option -- 'p'
    

    In my login shells, the path is

    PATH=...:/opt/bin:/opt/sbin:...:/usr/bin:/bin...
    

    For the life of me I can’t find where the path gets set to /usr/bin:/bin:/usr/sbin:/sbin:/opt/bin in the non-interactive non-login shell. I’ve checked every .profile, .bashrc, /etc/profile, /opt/etc/profile etc that I can find documented.

    For now I have made symbolic links to the updated get and ps versions, and everything is fine again.

    This may or may not be your issue, but I hope it at least helps somebody who has spend the whole day searching and reading threads on this issue finding nothing helped. Luckily, I just happened to notice the PATH getting reported in the terminal output in VSCODE, and checked where wget was installed.

    Login or Signup to reply.
  2. Looking at your log files it looks like a permission issue on the server.

    ls -ld /home/user/.vscode-server might help see the permissions.

    If nothing helps remove the directory from remote server and start again. (Make sure to replace the path with the actual path for your SSH user)

    rm -rf /home/user/.vscode-server
    

    Also make sure the server you are trying to RemoteSSH into are not using proxy. At least it was in my case.
    Adding the following in your basrc or bash_profile might help.

    export http_proxy='http://myproxy.com:8080'
    

    or

    export https_proxy'https://myproxy.com:8080'
    
    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search