Vscode-remote-release: Fail connecting to remote server with time limit reach error using Remote - SSH

Created on 28 Oct 2020  路  13Comments  路  Source: microsoft/vscode-remote-release


Hi VS code team,

I've started to use VS code again these days and bumped into a weired behaviour.

Problem:
If I try to ssh using Remote - SSH extension it gives me an error saying,

  • Could not fetch remote environment
  • Failed to connect to the remote extension host server (Error: Time limit reached)

while I can still ssh using zsh.
Is this a bug or just my settings matter?

Env:

  • VSCode Version: 1.50.1
  • Local OS Version: OS X 10.15.7
  • Remote OS Version:Ubuntu 20.04.1 LTS
  • Remote Extension/Connection Type: SSH
  • Remote - SSH: 0.55.0

Steps to Reproduce:

  1. Set up ssh config as
    Host host_on_google_compute_engine HostName XX.XX.XX.XX User my_user_name IdentityFile ~/.ssh/my_key IdentitiesOnly yes

  2. Connect using Remote - SSH by selecting host_on_google_compute_engine from SSH TARGET pane in VS code.

  3. Gives me an error as below and can't access to the remote
    image

  4. However just doing ssh host_on_google_compute_engine works

What I have tried:

  • Deleting .vscode-server on remote and reconnect.

Thanks!

needs-more-info ssh

All 13 comments

Entire log is,

[16:40:02.743] Log Level: 2
[16:40:02.745] [email protected]
[16:40:02.745] darwin x64
[16:40:02.747] SSH Resolver called for "ssh-remote+sakura2", attempt 1
[16:40:02.747] SSH Resolver called for host: sakura2
[16:40:02.748] Setting up SSH remote "sakura2"
[16:40:02.806] Acquiring local install lock: /var/folders/nm/v126ghp52v3gkybj2vl74qx40000gn/T/vscode-remote-ssh-sakura2-install.lock
[16:40:02.836] Looking for existing server data file at /Users/shiki/Library/Application Support/Code/User/globalStorage/ms-vscode-remote.remote-ssh/vscode-ssh-host-sakura2-d2e414d9e4239a252d1ab117bd7067f125afd80a-0.55.0/data.json
[16:40:02.838] Using commit id "d2e414d9e4239a252d1ab117bd7067f125afd80a" and quality "stable" for server
[16:40:02.842] Install and start server if needed
[16:40:02.853] Checking ssh with "ssh -V"
[16:40:02.872] > OpenSSH_8.1p1, LibreSSL 2.7.3

[16:40:02.877] askpass server listening on /var/folders/nm/v126ghp52v3gkybj2vl74qx40000gn/T/vscode-ssh-askpass-b7c3748e23fc3d769331eab0732eead7d9c25446.sock
[16:40:02.878] Spawning local server with {"ipcHandlePath":"/var/folders/nm/v126ghp52v3gkybj2vl74qx40000gn/T/vscode-ssh-askpass-7624e3acd080775216575a4403a0ddf63bff3212.sock","sshCommand":"ssh","sshArgs":["-v","-T","-D","62183","-o","ConnectTimeout=60","sakura2"],"dataFilePath":"/Users/shiki/Library/Application Support/Code/User/globalStorage/ms-vscode-remote.remote-ssh/vscode-ssh-host-sakura2-d2e414d9e4239a252d1ab117bd7067f125afd80a-0.55.0/data.json"}
[16:40:02.878] Local server env: {"DISPLAY":"1","ELECTRON_RUN_AS_NODE":"1","SSH_ASKPASS":"/Users/shiki/.vscode/extensions/ms-vscode-remote.remote-ssh-0.55.0/out/local-server/askpass.sh","VSCODE_SSH_ASKPASS_NODE":"/Users/shiki/Applications/Visual Studio Code.app/Contents/Frameworks/Code Helper (Renderer).app/Contents/MacOS/Code Helper (Renderer)","VSCODE_SSH_ASKPASS_MAIN":"/Users/shiki/.vscode/extensions/ms-vscode-remote.remote-ssh-0.55.0/out/askpass-main.js","VSCODE_SSH_ASKPASS_HANDLE":"/var/folders/nm/v126ghp52v3gkybj2vl74qx40000gn/T/vscode-ssh-askpass-b7c3748e23fc3d769331eab0732eead7d9c25446.sock"}
[16:40:02.881] Spawned 16829
[16:40:02.986] > local-server> Spawned ssh: 16830
[16:40:02.992] stderr> OpenSSH_8.1p1, LibreSSL 2.7.3
[16:40:04.803] stderr> debug1: Server host key: ecdsa-sha2-nistp256 SHA256:oHmBh7sByykpMouYpJ9kYVAPSiP18WOEycld5onjXOw
[16:40:05.236] Got askpass request: {"request":"Enter passphrase for key '/Users/shiki/.ssh/gcp_sakura':"}
[16:40:05.236] Detected passphrase message
[16:40:05.238] Listening for interwindow password on /var/folders/nm/v126ghp52v3gkybj2vl74qx40000gn/T/vscode-ssh-askpass-432fd240fa5cf75ab90fd8f628e234c8ddbfa29a.sock
[16:40:05.238] Writing password prompt to globalState
[16:40:07.425] Got passphrase response
[16:40:07.425] Interactor gave response: ******
[16:40:07.426] Cleaning up other-window auth server
[16:40:07.915] stderr> Authenticated to 35.185.253.173 ([35.185.253.173]:22).
[16:40:17.482] > Welcome to Ubuntu 20.04.1 LTS (GNU/Linux 5.4.0-1028-gcp x86_64)
> 
>  * Documentation:  https://help.ubuntu.com
>  * Management:     https://landscape.canonical.com
>  * Support:        https://ubuntu.com/advantage
> 
>   System information as of Wed Oct 28 16:40:08 JST 2020
> 
>   System load:  1.73               Processes:                169
>   Usage of /:   56.7% of 96.75GB   Users logged in:          1
>   Memory usage: 82%                IPv4 address for docker0: 172.17.0.1
>   Swap usage:   0%                 IPv4 address for ens4:    10.138.0.2
> 
>  * Introducing autonomous high availability clustering for MicroK8s
>    production environments! Super simple clustering, hardened Kubernetes,
>    with automatic data store operations. A zero-ops HA K8s for anywhere.
> 
>      https://microk8s.io/high-availability
> 
> 32 updates can be installed immediately.
> 2 of these updates are security updates.
> To see these additional updates run: apt list --upgradable
> 
[16:40:17.608] > ready: 886734f2f33c
[16:40:17.718] > Linux 5.4.0-1028-gcp #29-Ubuntu SMP Mon Oct 5 16:42:23 UTC 2020
[16:40:17.719] Platform: linux
[16:40:17.968] > 886734f2f33c: running
[16:40:18.315] > Acquiring lock on /home/gungelion/.vscode-server/bin/d2e414d9e4239a252d1ab117bd7067f125afd80a/vscode-remote-lock.gungelion.d2e414d9e4239a252d1ab117bd7067f125afd80a
[16:40:18.414] > Found existing installation at /home/gungelion/.vscode-server/bin/d2e414d9e4239a252d1ab117bd7067f125afd80a...
[16:40:18.564] > Found running server...
>  
> *
> * Reminder: You may only use this software with Visual Studio family products,
> * as described in the license (https://go.microsoft.com/fwlink/?linkid=2077057)
> *
>  
[16:40:18.716] > Checking server status on port 33485 with wget
[16:40:19.717] > 886734f2f33c: start
> sshAuthSock====
> listeningOn==33485==
> osReleaseId==ubuntu==
> arch==x86_64==
> webUiAccessToken====
> tmpDir==/run/user/1002==
> platform==linux==
> 886734f2f33c: end
[16:40:19.717] Received install output: 
sshAuthSock====
listeningOn==33485==
osReleaseId==ubuntu==
arch==x86_64==
webUiAccessToken====
tmpDir==/run/user/1002==
platform==linux==

[16:40:19.718] Remote server is listening on 33485
[16:40:19.718] Parsed server configuration: {"remoteListeningOn":{"port":33485},"osReleaseId":"ubuntu","arch":"x86_64","webUiAccessToken":"","sshAuthSock":"","tmpDir":"/run/user/1002","platform":"linux"}
[16:40:19.719] Persisting server connection details to /Users/shiki/Library/Application Support/Code/User/globalStorage/ms-vscode-remote.remote-ssh/vscode-ssh-host-sakura2-d2e414d9e4239a252d1ab117bd7067f125afd80a-0.55.0/data.json
[16:40:19.721] Starting forwarding server. localPort 62189 -> socksPort 62183 -> remotePort 33485
[16:40:19.722] Forwarding server listening on 62189
[16:40:19.722] Waiting for ssh tunnel to be ready
[16:40:19.724] [Forwarding server 62189] Got connection 0
[16:40:19.726] Tunneled 33485 to local port 62189
[16:40:19.726] Resolved "ssh-remote+sakura2" to "127.0.0.1:62189"
[16:40:19.740] ------




[16:40:19.767] [Forwarding server 62189] Got connection 1
[16:40:19.767] [Forwarding server 62189] Got connection 2

same here.
1.50.1 seems to be broken.
It works correctly with 1.49.3.

@muk-ai
Hi!
Following your solution, I've just downgraded my VS Code to 1.49.3 but still doesn't work.
Can you share me which Remote-SSH version you are using?

A day has passed and now I try again with 1.50.1, it doesn't cause any problems.
I have no idea why the problem has been resolved.

My environment is below.
vscode

Version: 1.50.1
Commit: d2e414d9e4239a252d1ab117bd7067f125afd80a
Date: 2020-10-13T14:53:05.704Z
Electron: 9.2.1
Chrome: 83.0.4103.122
Node.js: 12.14.1
V8: 8.3.110.13-electron.0
OS: Darwin x64 19.6.0

Local OS: mac 10.15.7
Remote - SSH: 0.55.0
Remote OS: Amazon Linux 2

  1. open vscode 1.49.3
  2. close vscode 1.49.3

I have confirmed that the following process remains on the remote server.

ec2-user 31855  1.5  3.1 971364 63472 ?        Sl   22:56   0:01 /home/ec2-user/.vscode-server/bin/2af051012b66169dde0c4dfae3f5ef48f787ff69/node /home/ec2-user/.vscode-server/bin/2af051012b66169dde0c4dfae3f5ef48f787ff69/out/vs/server/main.js --host=127.0.0.1 --enable-remote-auto-shutdown --port=0

after that

  1. open vscode 1.50.1
  2. close vscode 1.50.1
ec2-user 31855  0.8  3.1 971364 63472 ?        Sl   22:56   0:01 /home/ec2-user/.vscode-server/bin/2af051012b66169dde0c4dfae3f5ef48f787ff69/node /home/ec2-user/.vscode-server/bin/2af051012b66169dde0c4dfae3f5ef48f787ff69/out/vs/server/main.js --host=127.0.0.1 --enable-remote-auto-shutdown --port=0
ec2-user 32277  2.5  3.3 969168 66864 ?        Sl   22:58   0:01 /home/ec2-user/.vscode-server/bin/d2e414d9e4239a252d1ab117bd7067f125afd80a/node /home/ec2-user/.vscode-server/bin/d2e414d9e4239a252d1ab117bd7067f125afd80a/out/vs/server/main.js --host=127.0.0.1 --enable-remote-auto-shutdown --port=0

I have confirmed there were two processes remain.
My guess is that having two versions of the process in existence is not a good thing.
There should be a conflict.

@shikiponn
Wouldn't it solve the problem to try to kill the node process?

Are there any errors in the developer tools? Help > Toggle Developer Tools

@roblourens
The issue is no longer reproducing. Thank you for checking this issue.
But is it okay if the previous version of the process remains on the remote server when I update the vscode version?

@muk-ai
Thanks, but sadly I have no node process running

@roblourens
Checking my Dev Tools Console I see logs below.
Screenshot is attached for a better view.

image

workbench.desktop.main.js:sourcemap:284 [Extension Host] (node:4235) [DEP0005] DeprecationWarning: Buffer() is deprecated due to security and usability issues. Please use the Buffer.alloc(), Buffer.allocUnsafe(), or Buffer.from() methods instead.
t.log @ workbench.desktop.main.js:sourcemap:284
workbench.desktop.main.js:sourcemap:1706   ERR No application in the Launch Services database matches the input criteria.: Error: No application in the Launch Services database matches the input criteria.
DevTools failed to load SourceMap: Could not load content for file:///private/var/folders/nm/v126ghp52v3gkybj2vl74qx40000gn/T/AppTranslocation/85D33C52-5AEB-4D79-9AD9-888B306220E3/d/Visual Studio Code.app/Contents/Resources/app/node_modules.asar/semver-umd/lib/semver-umd.js.map: 
DevTools failed to load SourceMap: Could not load content for file:///private/var/folders/nm/v126ghp52v3gkybj2vl74qx40000gn/T/AppTranslocation/85D33C52-5AEB-4D79-9AD9-888B306220E3/d/Visual Studio Code.app/Contents/Resources/app/node_modules.asar/tas-client/tas-client/ExperimentationService.js.map: 
DevTools failed to load SourceMap: Could not load content for file:///private/var/folders/nm/v126ghp52v3gkybj2vl74qx40000gn/T/AppTranslocation/85D33C52-5AEB-4D79-9AD9-888B306220E3/d/Visual Studio Code.app/Contents/Resources/app/node_modules.asar/tas-client/tas-client/FeatureProvider/TasApiFeatureProvider.js.map: 
DevTools failed to load SourceMap: Could not load content for file:///private/var/folders/nm/v126ghp52v3gkybj2vl74qx40000gn/T/AppTranslocation/85D33C52-5AEB-4D79-9AD9-888B306220E3/d/Visual Studio Code.app/Contents/Resources/app/node_modules.asar/tas-client/tas-client/FeatureProvider/FilteredFeatureProvider.js.map: 
DevTools failed to load SourceMap: Could not load content for file:///private/var/folders/nm/v126ghp52v3gkybj2vl74qx40000gn/T/AppTranslocation/85D33C52-5AEB-4D79-9AD9-888B306220E3/d/Visual Studio Code.app/Contents/Resources/app/node_modules.asar/tas-client/tas-client/FeatureProvider/BaseFeatureProvider.js.map: 
DevTools failed to load SourceMap: Could not load content for file:///private/var/folders/nm/v126ghp52v3gkybj2vl74qx40000gn/T/AppTranslocation/85D33C52-5AEB-4D79-9AD9-888B306220E3/d/Visual Studio Code.app/Contents/Resources/app/node_modules.asar/tas-client/tas-client/Util/AxiosHttpClient.js.map: 
DevTools failed to load SourceMap: Could not load content for file:///private/var/folders/nm/v126ghp52v3gkybj2vl74qx40000gn/T/AppTranslocation/85D33C52-5AEB-4D79-9AD9-888B306220E3/d/Visual Studio Code.app/Contents/Resources/app/node_modules.asar/tas-client/tas-client/ExperimentationServiceAutoPolling.js.map: 
DevTools failed to load SourceMap: Could not load content for file:///private/var/folders/nm/v126ghp52v3gkybj2vl74qx40000gn/T/AppTranslocation/85D33C52-5AEB-4D79-9AD9-888B306220E3/d/Visual Studio Code.app/Contents/Resources/app/node_modules.asar/tas-client/tas-client/ExperimentationServiceBase.js.map: 
DevTools failed to load SourceMap: Could not load content for file:///private/var/folders/nm/v126ghp52v3gkybj2vl74qx40000gn/T/AppTranslocation/85D33C52-5AEB-4D79-9AD9-888B306220E3/d/Visual Studio Code.app/Contents/Resources/app/node_modules.asar/tas-client/tas-client/Util/MemoryKeyValueStorage.js.map: 
DevTools failed to load SourceMap: Could not load content for file:///private/var/folders/nm/v126ghp52v3gkybj2vl74qx40000gn/T/AppTranslocation/85D33C52-5AEB-4D79-9AD9-888B306220E3/d/Visual Studio Code.app/Contents/Resources/app/node_modules.asar/tas-client/tas-client/Util/PollingService.js.map: 
DevTools failed to load SourceMap: Could not load content for file:///private/var/folders/nm/v126ghp52v3gkybj2vl74qx40000gn/T/AppTranslocation/85D33C52-5AEB-4D79-9AD9-888B306220E3/d/Visual Studio Code.app/Contents/Resources/app/node_modules.asar/xterm/lib/xterm.js.map: 
DevTools failed to load SourceMap: Could not load content for file:///private/var/folders/nm/v126ghp52v3gkybj2vl74qx40000gn/T/AppTranslocation/85D33C52-5AEB-4D79-9AD9-888B306220E3/d/Visual Studio Code.app/Contents/Resources/app/node_modules.asar/xterm-addon-unicode11/lib/xterm-addon-unicode11.js.map: 
DevTools failed to load SourceMap: Could not load content for file:///private/var/folders/nm/v126ghp52v3gkybj2vl74qx40000gn/T/AppTranslocation/85D33C52-5AEB-4D79-9AD9-888B306220E3/d/Visual Studio Code.app/Contents/Resources/app/node_modules.asar/xterm-addon-search/lib/xterm-addon-search.js.map: 
workbench.desktop.main.js:sourcemap:1706   ERR [remote-connection] The time limit has been reached for a connection. Error:
workbench.desktop.main.js:sourcemap:1706   ERR Error: Time limit reached
    at workbench.desktop.main.js:sourcemap:1907
workbench.desktop.main.js:sourcemap:1706   ERR [remote-connection] An error occurred in the very first connect attempt, it will be treated as a permanent error! Error:
workbench.desktop.main.js:sourcemap:1706   ERR Error: Time limit reached
    at workbench.desktop.main.js:sourcemap:1907
workbench.desktop.main.js:sourcemap:3067 Failed to connect to the remote extension host server (Error: Time limit reached)
onDidChangeNotification @ workbench.desktop.main.js:sourcemap:3067
(anonymous) @ workbench.desktop.main.js:sourcemap:3066
fire @ workbench.desktop.main.js:sourcemap:96
addNotification @ workbench.desktop.main.js:sourcemap:3133
error @ workbench.desktop.main.js:sourcemap:4878
(anonymous) @ workbench.desktop.main.js:sourcemap:5242
workbench.desktop.main.js:sourcemap:3067 Could not fetch remote environment
onDidChangeNotification @ workbench.desktop.main.js:sourcemap:3067
(anonymous) @ workbench.desktop.main.js:sourcemap:3066
fire @ workbench.desktop.main.js:sourcemap:96
addNotification @ workbench.desktop.main.js:sourcemap:3133
notify @ workbench.desktop.main.js:sourcemap:4879
_scanAndHandleExtensions @ workbench.desktop.main.js:sourcemap:5293
workbench.desktop.main.js:sourcemap:1706   ERR Time limit reached: Error: Time limit reached
    at file:///private/var/folders/nm/v126ghp52v3gkybj2vl74qx40000gn/T/AppTranslocation/85D33C52-5AEB-4D79-9AD9-888B306220E3/d/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/workbench.desktop.main.js:1907:292
DevTools failed to load SourceMap: Could not load content for file:///private/var/folders/nm/v126ghp52v3gkybj2vl74qx40000gn/T/AppTranslocation/85D33C52-5AEB-4D79-9AD9-888B306220E3/d/Visual Studio Code.app/Contents/Resources/app/node_modules.asar/vscode-textmate/release/main.js.map: 
workbench.desktop.main.js:sourcemap:1706   ERR [remote-connection] The time limit has been reached for a connection. Error:
workbench.desktop.main.js:sourcemap:1706   ERR Error: Time limit reached
    at workbench.desktop.main.js:sourcemap:1907
workbench.desktop.main.js:sourcemap:1706   ERR [remote-connection] An error occurred in the very first connect attempt, it will be treated as a permanent error! Error:
workbench.desktop.main.js:sourcemap:1706   ERR Error: Time limit reached
    at workbench.desktop.main.js:sourcemap:1907
workbench.desktop.main.js:sourcemap:4561 Error received from starting extension host
(anonymous) @ workbench.desktop.main.js:sourcemap:4561
workbench.desktop.main.js:sourcemap:4561 Error: Time limit reached
    at workbench.desktop.main.js:sourcemap:1907
(anonymous) @ workbench.desktop.main.js:sourcemap:4561
workbench.desktop.main.js:sourcemap:1706   ERR Could not fetch remote environment: Error: Could not fetch remote environment
    at d.start (file:///private/var/folders/nm/v126ghp52v3gkybj2vl74qx40000gn/T/AppTranslocation/85D33C52-5AEB-4D79-9AD9-888B306220E3/d/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/workbench.desktop.main.js:5212:70)
    at async k.createProcess (file:///private/var/folders/nm/v126ghp52v3gkybj2vl74qx40000gn/T/AppTranslocation/85D33C52-5AEB-4D79-9AD9-888B306220E3/d/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/workbench.desktop.main.js:5229:827)

Sorry @shikiponn there must be something with your network setup or remote environment preventing us from opening a websocket connection to the remote server, even though it apparently started up successfully. I'm not sure what that would be or what else to ask.

I've started getting the same issue since I updated my vscode, I connect remote ssh through sublime and webstorm to my server with no issues at all. So I decided to rollback to an older version of vscode! I rolledback to Oct 2020 1.51 and now it works just fine!
The version with issues is Nov 2020 1.52
The errors I have been having are:

  • Could not fetch remote environment
  • Failed to connect to the remote extension host server (Error: Time limit reached)

Please file an issue and tell me the OS/version/architecture of your remote @alhabarneh

Please file an issue and tell me the OS/version/architecture of your remote @alhabarneh

@roblourens Thanks for replying, my remote OS version is Linux x64 2.6.32-754.el6.x86_64 and I have just filed an issue

Was this page helpful?
0 / 5 - 0 ratings