-
Notifications
You must be signed in to change notification settings - Fork 287
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Remote SSH stuck in a reconnect loop #7497
Comments
Hello! Could you set the log level to trace, re-try with this connection, and then send those new logs? Secondly, could you send what extensions you have enabled and then try going through and disabling those to see if an extension might be the causing an issue. Thanks! |
I am currently using GitLens, clangd, and CodeLLDB on the remote server. I have been able to reproduce this with any one of these extensions enabled/disabled, and with no extensions at all. The problem is that the connection needs to be "annoyed" so to speak, and it's easier to do with an extension (say doing a git blame with GitLens) than without any extensions, so this repro uses that.
|
From the logs, the client side doesn't receive any data from the extension host for over 20s. And that makes it begin reconnecting:
So the client side sent 126 messages which were never acknowledged, and the extension host last send data 20.1s ago. This usually happens when the extension host process is unhealthy i.e. the event loop of the remote extension host is taken over by a long running (>20s) operation. Are you perhaps connecting to a particular slow machine? |
The machine should be plenty capable, it's a server with 128 cores. Is it possible to diagnose anything from the extension host? |
In my experience, such issues are virtually always caused by one of the installed extensions. Or perhaps by the remote machine being very busy and starving the extension host process. Could you please try launching |
Improve logging to render the extension host kind too (microsoft/vscode-remote-release#7497)
I've got this capture, hopefully from when something starts acting up. I removed some personal information, so the file is just called file.h.
|
I see this issue as well. Happens when the connection speed is slow: say 100 kBps or less. Can't this hard coded timeout of 20 seconds (described further above) be made configurable? 20s is too low on a slow connection. Only way out of this is to keep retrying and hope that it connects somehow or move to a faster connection. |
@Yelnats321 apologies for the slow response here. In your log, I find interesting that the last requests the UI side made to the remote extension host were for asking it for code lenses:
After the above two requests, the remote extension host never comes back for 20s, thus triggering the reconnection logic. Does it make a difference when disabling code lenses? |
Some additional observations |
Is there a way to change the 20s timeout mentioned in this thread? |
@alexdima thanks for the observation! I have the same issue and after uninstalling the GitLens extension I could reconnect. |
I was able to work around this by turning off |
Thank you so much! It worked! |
I found the server log at the same time:
|
Same situation. I see this messages just after refresh source control. But i can't understand after what event vs code brokes. |
Same issue observed with remote host as ubuntu 22.04 from visual studio code 1.89 |
Still a problem with a remote debian 12, local macOS. It's timer based, can't figure out how long, but not long at all, probably around 5 minutes. Then you can't save changes, and reconnecting to SSH: ... appears. And stays forever. This seems to happen randomly after a prolonged uptime with Visual Studio Code running. Since it's a laptop mac, it's also going trough a bunch of network changes and sleep-wake cycles. Something about these changes messes up this extension. Nothing else as far as I have noticed. Remote SSH 0.4.3 running on the remote system. No network issue, no ssh issue, no firewall issue. I can always resume working if I close this window and then reopen. For some unknown reason one can't open 2 VSC windows on the same remote folder path 🤷 Console messages complains about not being to resolve the host? After having resolved it and connected to it. Very odd.
Turned on debug logging but can't find anything in |
I'm also facing this issue for some time now. Renders remote notebooks unstable causing countless hours of work lost since they're also not autosaved for some weird reason. |
Same for me since a couple of days --- an unworkable situation. Remote ssh connections suddenly disconnect, after about one minute, and then an endless unsuccessful "reconnect" lower left status appears with an unusable editor. Restart of vscode locally fixes problem, but then problem kicks in after one minute again |
I run into the same problem. Every time I edit something, VSCode reconnects. It seems the issue arises because of the AI code assistant I am using (the 'Continue' extension). Each time I edit something, the autocomplete function of this extension may be performing extensive processing, which causes the processing time to exceed the connection timeout in VSCode, leading to reconnections. |
Ah --- that might explain things. I also recently installed that extension, for amusement purposes mainly, although I've had cases where it writes 2 or so lines according to my intentions. I'll deactivate that and see if that helps, thanks! |
same issue here, but without using AI code assistants. I tried the solutions above: |
rm -rf ~/.vscode-server/ Is a must have. It's not a problem with the host or SSH, it's VSC. Still not fixed after 2 years..... Microsoft quality at it's finest. |
Log (Window):
Log (Remote - SSH):
Steps to Reproduce:
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
The text was updated successfully, but these errors were encountered: