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 289 forks source link

Connecting with SSH timed out #5611

Closed Fydon closed 3 years ago

Fydon commented 3 years ago

[11:24:25.107] Running script with connection command: ssh -T -D 1040 "remote.foo.bar" bash [11:24:25.109] Terminal shell path: C:\Windows\System32\cmd.exe [11:24:52.122] Resolver error: Error: Connecting with SSH timed out at Function.Timeout (c:\Users\username.vscode-insiders\extensions\ms-vscode-remote.remote-ssh-0.65.8\out\extension.js:1:397167) at Timeout._onTimeout (c:\Users\username.vscode-insiders\extensions\ms-vscode-remote.remote-ssh-0.65.8\out\extension.js:1:488075) at listOnTimeout (internal/timers.js:554:17) at processTimers (internal/timers.js:497:7) [11:24:52.127] ------

[11:24:53.357] > ]0;C:\Windows\System32\cmd.exe [11:24:53.358] Got some output, clearing connection timeout [11:24:58.341] > 84d2fadea731: running

Acquiring lock on /home/ubuntu/.vscode-server-insiders/bin/c28c86fcd12e4f8693d65 69deadfc740dcf8f55b/vscode-remote-lock.ubuntu.c28c86fcd12e4f8693d6569deadfc740dc f8f55b Installing to /home/ubuntu/.vscode-server-insiders/bin/c28c86fcd12e4f8693d6569de adfc740dcf8f55b... 84d2fadea731%%1%% Downloading with wget [11:24:59.332] > Download complete 84d2fadea731%%2%% tar --version: tar (GNU tar) 1.28 Copyright (C) 2014 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. [11:25:00.339] > Checking /home/ubuntu/.vscode-server-insiders/.c28c86fcd12e4f8693d6569deadfc740d cf8f55b.log and /home/ubuntu/.vscode-server-insiders/.c28c86fcd12e4f8693d6569dea dfc740dcf8f55b.pid for a running server Looking for server with pid: 4655 Found running server... Installing extensions... Installing extensions... Extension 'oderwat.indent-rainbow' v8.0.0 is already installed. Use '--force' op tion to update to latest version or provide '@' to install a specific v ersion, for example: 'oderwat.indent-rainbow@1.2.3'. Extension 'zignd.html-css-class-completion' v1.20.0 is already installed. Use '- -force' option to update to latest version or provide '@' to install a specific version, for example: 'zignd.html-css-class-completion@1.2.3'. Extension 'eamodio.gitlens' v11.6.0 is already installed. Use '--force' option t o update to latest version or provide '@' to install a specific version , for example: 'eamodio.gitlens@1.2.3'. Extension 'donjayamanne.githistory' v0.6.18 is already installed. Use '--force' option to update to latest version or provide '@' to install a specific version, for example: 'donjayamanne.githistory@1.2.3'. Extension 'christian-kohler.path-intellisense' v2.4.0 is already installed. Use '--force' option to update to latest version or provide '@' to install a specific version, for example: 'christian-kohler.path-intellisense@1.2.3'.
Extension 'gruntfuggly.todo-tree' v0.0.214 is already installed. Use '--force' o ption to update to latest version or provide '@' to install a specific version, for example: 'gruntfuggly.todo-tree@1.2.3'. Extension 'pflannery.vscode-versionlens' v1.0.9 is already installed. Use '--for ce' option to update to latest version or provide '@' to install a spec ific version, for example: 'pflannery.vscode-versionlens@1.2.3'. Extension 'redhat.vscode-xml' v0.18.0 is already installed. Use '--force' option to update to latest version or provide '@' to install a specific versi on, for example: 'redhat.vscode-xml@1.2.3'. Extension 'dotjoshjohnson.xml' v2.5.1 is already installed. Use '--force' option to update to latest version or provide '@' to install a specific versi on, for example: 'dotjoshjohnson.xml@1.2.3'.

*

Checking server status on port 45780 with wget 84d2fadea731: start SSH_AUTH_SOCK==/tmp/ssh-Za7X6wfa3f/agent.5706== DISPLAY==== webUiAccessToken==== listeningOn==45780== osReleaseId==ubuntu== arch==x86_64== tmpDir==/run/user/1000== platform==linux== unpackResult==success== didLocalDownload==0== downloadTime==542== installTime==1437== extInstallTime==341== serverStartTime==== connectionToken==111111aa-111a-111a-111a-1111a11a11a1== 84d2fadea731: end

Steps to Reproduce:

  1. Remote from Windows 10 to Linux host

Note that it times out and then almost immediately attempts to connect, which is successful.

Increasing the timeout via remote.SSH.connectTimeout just increases the time it takes before it attempts to connect. Setting remote.SSH.useLocalServer to false didn't change anything. I tried using Remote-SSH: Kill Local Connection Server For Host. Using vscode 1.60 works using the same SSH config. The timeout issue might be similar to #5555 but when that issue was occurring it didn't attempt to connect at all.

Does this issue occur when you try this locally?: N/A. It didn't get that far Does this issue occur when you try this locally and all extensions are disabled?: N/A. Disabling all extensions except Remote SSH and trying to remote still fails as above.

Version: 1.61.0-insider (system setup)
Commit: c28c86fcd12e4f8693d6569deadfc740dcf8f55b
Date: 2021-09-20T07:28:25.574Z
Electron: 13.4.0
Chrome: 91.0.4472.164
Node.js: 14.16.0
V8: 9.1.269.39-electron.0
OS: Windows_NT x64 10.0.19043
WhoisDonlee commented 3 years ago

I had a similar problem earlier today. You can SSH by terminal and delete the lock file.

> Acquiring lock on /home/ubuntu/.vscode-server-insiders/bin/c28c86fcd12e4f8693d65
> 69deadfc740dcf8f55b/vscode-remote-lock.ubuntu.c28c86fcd12e4f8693d6569deadfc740dc
> f8f55b

This worked for me.

Fydon commented 3 years ago

@WhoisDonlee Thank you for trying to help. In the above log it times out at 11:24:52.122. Then it actually attempts to connect and acquire the lock at 11:24:58.341, which is does successfully. However I did try deleting the lock file and bin folder and it didn't make a difference. I have a number of remote servers and can't connect to them either due to the same error.

munael commented 3 years ago

This started happening to me as well once I updated to VSCode 1.61 . Except it never manages to connect. I did the update an hour or so ago and it just killed all momentum. Now looking into how to rollback an update.

ayush-j commented 3 years ago

Same issue. My SSH setup was working fine till yesterday but I'm not able to connect using VS Code today (ssh connections outside VS Code still work).

Version: 1.61.0-insider (user setup)
Commit: c28c86fcd12e4f8693d6569deadfc740dcf8f55b
Date: 2021-09-20T07:28:25.574Z
Electron: 13.4.0
Chrome: 91.0.4472.164
Node.js: 14.16.0
V8: 9.1.269.39-electron.0
OS: Windows_NT x64 10.0.22463

Remote SSH Nightly v2021.9.19620

[13:08:44.295] Log Level: 2
[13:08:44.303] remote-ssh-nightly@2021.9.19620
[13:08:44.303] win32 x64
[13:08:44.332] SSH Resolver called for "ssh-remote+mysshhost", attempt 1
[13:08:44.332] "remote.SSH.useLocalServer": false
[13:08:44.332] "remote.SSH.showLoginTerminal": false
[13:08:44.332] "remote.SSH.remotePlatform": {...}
[13:08:44.332] "remote.SSH.path": undefined
[13:08:44.332] "remote.SSH.configFile": undefined
[13:08:44.332] "remote.SSH.useFlock": true
[13:08:44.333] "remote.SSH.lockfilesInTmp": false
[13:08:44.333] "remote.SSH.localServerDownload": auto
[13:08:44.333] "remote.SSH.remoteServerListenOnSocket": false
[13:08:44.333] "remote.SSH.showLoginTerminal": false
[13:08:44.333] "remote.SSH.defaultExtensions": []
[13:08:44.333] "remote.SSH.loglevel": 2
[13:08:44.334] SSH Resolver called for host: mysshhost
[13:08:44.334] Setting up SSH remote "mysshhost"
[13:08:44.341] Using commit id "c28c86fcd12e4f8693d6569deadfc740dcf8f55b" and quality "insider" for server
[13:08:44.345] Install and start server if needed
[13:08:44.369] Checking ssh with "ssh -V"
[13:08:44.427] > OpenSSH_for_Windows_8.6p1, LibreSSL 3
[13:08:44.427] > .3.3

[13:08:44.434] Remote command length: 6027/8192 characters
[13:08:44.434] Running script with connection command: ssh -T -D 63633 "mysshhost" powershell
[13:08:44.438] Terminal shell path: C:\WINDOWS\System32\cmd.exe
[13:09:01.449] Resolver error: Error: Connecting with SSH timed out
    at Function.Timeout (c:\Users\ayjindal\.vscode-insiders\extensions\ms-vscode-remote.remote-ssh-nightly-2021.9.19620\out\extension.js:1:397167)
    at Timeout._onTimeout (c:\Users\ayjindal\.vscode-insiders\extensions\ms-vscode-remote.remote-ssh-nightly-2021.9.19620\out\extension.js:1:488075)
    at listOnTimeout (internal/timers.js:554:17)
    at processTimers (internal/timers.js:497:7)
[13:09:01.453] ------

[13:09:09.003] > Windows PowerShell
> Copyright (C) Microsoft Corporation. All rights reserved.Try the new cross-platform PowerShell https://aka.ms/pscore6]0;C:\WINDOWS\System32\cmd.exePS C:\Users\ayjindal> 
> PS C:\Users\ayjindal> $uuid="277ab8837d65"
> PS C:\Users\ayjindal> "${uuid}: running"
> 277ab8837d65: running
> PS C:\Users\ayjindal> "277ab8837d65: pauseLog"
> 277ab8837d65: pauseLog
[13:09:09.004] Got some output, clearing connection timeout
adamaltmejd commented 3 years ago

Same problem here.

munael commented 3 years ago

The latest Insiders update seems to have fixed it.