kshru9
kshru9

Reputation: 83

Remote SSH connection hangs at "Downloading vscode server step" after updating VScode to 1.82.0 version

I am trying to connect to Remote SSH through Remote-SSH extension, however it hangs at "Downloading VSCode Server" step for a long time after updating the vscode release. Please find the logs for the same as below

[17:55:58.394] Remote server is listening on port 44281
[17:55:58.394] Parsed server configuration: {"serverConfiguration":{"remoteListeningOn":{"port":44281},"osReleaseId":"ol","arch":"x86_64","sshAuthSock":"","display":"","tmpDir":"/run/user/1663455","platform":"linux"},"serverStartTime":70,"installUnpackCode":""}
[17:55:58.395] Persisting server connection details to /Users/skatpara/Library/Application Support/Code/User/globalStorage/ms-vscode-remote.remote-ssh/vscode-ssh-host-5d30b538-8b617bd08fd9e3fc94d14adb8d358b56e3f72314-0.106.1/data.json
[17:55:58.398] Starting forwarding server. local port 49696 -> socksPort 49694 -> remotePort 44281
[17:55:58.398] Forwarding server listening on port 49696
[17:55:58.398] Waiting for ssh tunnel to be ready
[17:55:58.400] Tunneled port 44281 to local port 49696
[17:55:58.400] Resolved "ssh-remote+node" to "port 49696"
[17:55:58.402] Initizing new exec server for ssh-remote+node
[17:55:58.402] Resolving exec server at port 49696
[17:55:58.414] [Forwarding server port 49696] Got connection 0
[17:55:58.415] [Forwarding server port 49696] Got connection 1
[17:55:59.362] Exec server for ssh-remote+node created and cached
[17:55:59.369] ------




[17:55:59.693] [server] Checking /home/uname/.vscode-server/cli/servers/Stable-8b617bd08fd9e3fc94d14adb8d358b56e3f72314/log.txt and /home/uname/.vscode-server/cli/servers/Stable-8b617bd08fd9e3fc94d14adb8d358b56e3f72314/pid.txt for a running server...
[17:55:59.735] [server] Installing and setting up Visual Studio Code Server...

I expect to resolve the issue and be able to connect to remote server through vscode Remote-SSH extension

Upvotes: 8

Views: 15787

Answers (3)

Leon V
Leon V

Reputation: 1233

I run an Ubuntu server where multiple VSCode users SSH remote into, and they all use the ubutnu user account for development. Previously, we used this config to keep our settings and extension separate:

"remote.SSH.serverInstallPath": {
    "server-name":"~/.vscode-username"
}

However, we all also had VSCode stall on "Downloading VSCode Server". Around the same time, I also noticed that the ~ in the remote.SSH.serverInstallPath value was taken literally, and a directory named ~ was added to the hole folder. And this was the new path:

/home/ubuntu/~/.vscode-username/.vscode-server

We set "remote.SSH.useExecServer": false to fix this, however I noticed that I could connect to other users' VSCode server instances / shells and read sensitive environment variables passed through from VSCode.

I hypothesized that the root cause was how VSCode managed the relative path, so I tried a few things.

I found that using $HOME instead of ~ fixed both my problems. I am now able to connect to the host with "remote.SSH.useExecServer": true or leave it omitted, and use:

"remote.SSH.serverInstallPath": {
    "server-name":"$HOME/.vscode-username"
}

Server installed first try with no issues, and my install path is the expected:

/home/ubuntu/.vscode-username/.vscode-server

Everything seems to work correctly for me now.

Upvotes: 0

starball
starball

Reputation: 52064

There's a bug in version 0.106.1 of the Remote SSH extension used with VS Code 1.82: [Remote-SSH Bug]: Remote-SSH 0.106.1 gets stuck downloading the server #8926

The suggested workaround for version 0.106.1 is to set "remote.SSH.useExecServer": false. It is disabled by default in version 0.106.2. The default will be changed back to true when the bug is fixed- perhaps in the next stable VS Code release.

Before 0.106.2 was released, other users used other workarounds such as downgrading/rolling-back the extension to version 0.102.0, downloading and extracting the server files manually, downgrading VS Code to 1.81.

Upvotes: 4

Moritz Wilksch
Moritz Wilksch

Reputation: 397

The newest VSCode version does not play nice with the most recent version of the "Remote SSH" extension due to a bug. It is being tracked here though it seems like it mostly ocurrs when the remote machine you're connecting to does not have an internet connection. While this is being fixed you could try

  1. setting remote.SSH.useExecServer": false in settings.json or toggle the "Use Exec Server" checkbox in the settings

or

  1. Downgrade VSCode and the "Remote SSH" extension to an older version

Upvotes: 13

Related Questions