Skip to content

Remote SSH stuck in a reconnect loop #7497

Open
@Yelnats321

Description

@Yelnats321
  • VSCode Version: 1.73.1
  • Local OS Version: Windows 10 Enterprise 21H2 19044.2130
  • Remote OS Version: Ubuntu 20.04
  • Remote Extension/Connection Type: SSH/Containers/WSL/Server: SSH

Log (Window):

2022-11-10 14:33:14.111 [info] [attempt 1] Invoking resolveAuthority(ssh-remote)
2022-11-10 14:33:18.149 [error] [Extension Host] (node:27076) [DEP0005] DeprecationWarning: Buffer() is deprecated due to security and usability issues. Please use the Buffer.alloc(), Buffer.allocUnsafe(), or Buffer.from() methods instead.
(Use Code --trace-deprecation ... to show where the warning was created)
2022-11-10 14:33:18.158 [info] [attempt 1] resolveAuthority(ssh-remote) returned '127.0.0.1:52840' after 4046 ms
2022-11-10 14:33:21.717 [info] [perf] Render performance baseline is 21ms
2022-11-10 14:33:46.435 [info] [remote-connection][ExtensionHost][1da39…][reconnect] received socket timeout event (unacknowledgedMsgCount: 5, timeSinceOldestUnacknowledgedMsg: 20013, timeSinceLastReceivedSomeData: 20012).
2022-11-10 14:33:46.438 [info] [remote-connection][ExtensionHost][1da39…][reconnect] starting reconnecting loop. You can get more information with the trace log level.
2022-11-10 14:33:46.438 [info] [remote-connection][ExtensionHost][1da39…][reconnect] resolving connection...
2022-11-10 14:33:46.439 [info] [remote-connection][ExtensionHost][1da39…][reconnect] connecting to 127.0.0.1:52840...
2022-11-10 14:33:47.131 [info] [remote-connection][ExtensionHost][1da39…][reconnect] reconnected!
2022-11-10 14:34:07.151 [info] [remote-connection][ExtensionHost][1da39…][reconnect] received socket timeout event (unacknowledgedMsgCount: 5, timeSinceOldestUnacknowledgedMsg: 20016, timeSinceLastReceivedSomeData: 20016).
2022-11-10 14:34:07.179 [info] [remote-connection][ExtensionHost][1da39…][reconnect] starting reconnecting loop. You can get more information with the trace log level.
2022-11-10 14:34:07.180 [info] [remote-connection][ExtensionHost][1da39…][reconnect] resolving connection...
2022-11-10 14:34:07.180 [info] [remote-connection][ExtensionHost][1da39…][reconnect] connecting to 127.0.0.1:52840...
2022-11-10 14:34:07.878 [info] [remote-connection][ExtensionHost][1da39…][reconnect] reconnected!

Log (Remote - SSH):

[14:33:14.094] Log Level: 2
[14:33:14.095] [email protected]
[14:33:14.096] win32 x64
[14:33:14.120] SSH Resolver called for "ssh-remote+fe20", attempt 1
[14:33:14.121] "remote.SSH.useLocalServer": false
[14:33:14.121] "remote.SSH.showLoginTerminal": false
[14:33:14.121] "remote.SSH.remotePlatform": {"fe20":"linux"}
[14:33:14.121] "remote.SSH.path": undefined
[14:33:14.121] "remote.SSH.configFile": undefined
[14:33:14.121] "remote.SSH.useFlock": true
[14:33:14.121] "remote.SSH.lockfilesInTmp": false
[14:33:14.122] "remote.SSH.localServerDownload": auto
[14:33:14.122] "remote.SSH.remoteServerListenOnSocket": false
[14:33:14.122] "remote.SSH.showLoginTerminal": false
[14:33:14.122] "remote.SSH.defaultExtensions": []
[14:33:14.122] "remote.SSH.loglevel": 2
[14:33:14.122] "remote.SSH.enableDynamicForwarding": true
[14:33:14.122] "remote.SSH.enableRemoteCommand": false
[14:33:14.122] "remote.SSH.serverPickPortsFromRange": {}
[14:33:14.122] "remote.SSH.serverInstallPath": {}
[14:33:14.126] SSH Resolver called for host: fe20
[14:33:14.126] Setting up SSH remote "fe20"
[14:33:14.141] Using commit id "6261075646f055b99068d3688932416f2346dd3b" and quality "stable" for server
[14:33:14.144] Install and start server if needed
[14:33:14.146] Checking ssh with "ssh -V"
[14:33:14.199] > OpenSSH_for_Windows_8.1p1
[14:33:14.200] > , LibreSSL 3.0.2

[14:33:14.204] Running script with connection command: ssh -T -D 52828 fe20 bash
[14:33:14.206] Terminal shell path: C:\Windows\System32\cmd.exe
[14:33:16.124] > �]0;C:\Windows\System32\cmd.exe�
[14:33:16.124] Got some output, clearing connection timeout
[14:33:17.963] > 170532b73608: running
[14:33:17.996] > Acquiring lock on /u/elnar/.vscode-server/bin/6261075646f055b99068d3688932416f23

46dd3b/vscode-remote-lock.elnar.6261075646f055b99068d3688932416f2346dd3b
[14:33:18.010] > Found existing installation at /u/elnar/.vscode-server/bin/6261075646f055b99068d
3688932416f2346dd3b...
Checking /u/elnar/.vscode-server/.6261075646f055b99068d3688932416f2346dd3b.log a
nd /u/elnar/.vscode-server/.6261075646f055b99068d3688932416f2346dd3b.pid for a r
unning server
Looking for server with pid: 543328
[14:33:18.045] > Found running server...
[14:33:18.055] >
*

[14:33:18.132] > Checking server status on port 46511 with wget

170532b73608: start
SSH_AUTH_SOCK====
DISPLAY====
webUiAccessToken====
listeningOn==46511==
osReleaseId==ubuntu==
arch==x86_64==
tmpDir==/run/user/10057971==
platform==linux==
unpackResult====
didLocalDownload==0==
downloadTime====
installTime====
extInstallTime====
serverStartTime====
connectionToken==a11aaaa1-a111-111a-1a1a-11a1aa111a11==
170532b73608: end
[14:33:18.133] Received install output:
SSH_AUTH_SOCK====
DISPLAY====
webUiAccessToken====
listeningOn==46511==
osReleaseId==ubuntu==
arch==x86_64==
tmpDir==/run/user/10057971==
platform==linux==
unpackResult====
didLocalDownload==0==
downloadTime====
installTime====
extInstallTime====
serverStartTime====
connectionToken==a11aaaa1-a111-111a-1a1a-11a1aa111a11==

[14:33:18.133] Remote server is listening on 46511
[14:33:18.133] Parsed server configuration: {"serverConfiguration":{"remoteListeningOn":{"port":46511},"osReleaseId":"ubuntu","arch":"x86_64","webUiAccessToken":"","sshAuthSock":"","display":"","tmpDir":"/run/user/10057971","platform":"linux","connectionToken":"a11aaaa1-a111-111a-1a1a-11a1aa111a11"},"installUnpackCode":""}
[14:33:18.135] Starting forwarding server. localPort 52840 -> socksPort 52828 -> remotePort 46511
[14:33:18.136] Forwarding server listening on 52840
[14:33:18.136] Waiting for ssh tunnel to be ready
[14:33:18.136] Tunneled 46511 to local port 52840
[14:33:18.137] Resolved "ssh-remote+fe20" to "127.0.0.1:52840"
[14:33:18.137] [Forwarding server 52840] Got connection 0
[14:33:18.144] ------

[14:33:18.162] [Forwarding server 52840] Got connection 1
[14:33:18.451] [Forwarding server 52840] Got connection 2
[14:33:19.771] [Forwarding server 52840] Got connection 3
[14:33:46.441] [Forwarding server 52840] Got connection 4
[14:34:07.181] [Forwarding server 52840] Got connection 5
[14:34:27.892] [Forwarding server 52840] Got connection 6
[14:34:48.560] [Forwarding server 52840] Got connection 7
[14:35:09.166] [Forwarding server 52840] Got connection 8
[14:35:30.270] [Forwarding server 52840] Got connection 9

Steps to Reproduce:

  1. Connect to remote host OR WSL
  2. The reconnect loop occurs, there is no way to fix it once it starts apart from reloading VS Code and hoping it fixes itself.

This is easiest to force with some extensions installed on the server as more communication seems to cause it, but the extension itself doesn't matter. GitLens, LLDB, clangd all have caused this, as well as no extensions installed.

Does this issue occur when you try this locally?: Yes, in that I can reproduce it connecting to a WSL instance instead. This is on a company computer with a VPN and DirectAccess, but I am able to reproduce it sans VPN.
Does this issue occur when you try this locally and all extensions are disabled?: Yes

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions