-
Notifications
You must be signed in to change notification settings - Fork 4
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
Issue with WSL losing remote connection randomly - Cannot reconnect. Please reload the window #2
Comments
Hi @PylotLight I can repro with vscodium |
If you prove it's purely vscodium issue then feel free to close but given there's no issues with the official extension there must be something different, I imagine would be hard to resolve given the closed source nature, but ye hopefully its fixable. |
I have left the connection open for several minutes at this point without a repeat of the error after I reinstalled the extension so will have to keep testing and monitoring. Perhaps we close for now and I'll report back with requested logs and reopen if the issue returns.
It's WSL2 using Debian. Btw being able to open with distro option would be highly valuable, but there is a way around it for now as currently it just uses default distro which may or may not be the one we want to launch with. |
Repeated the issue on my work machine now:
|
I can repro now, will work on a fix. |
Just to make sure you have my example, heres some of my server logs; |
Yay (this affects me, a first time-user of Open Remote WSL, too; at least on earlier versions the manual "start ssh server, get ip, connect via your SSH extension" did work without any aborts; but the nice integration of Open Remote WSL is really good!) |
The issue exists in 1.83.1 as well:
|
I've been having this as well |
I know the reason but been short of time lately to work on this, I'll see if have some time this month 🙏 |
nvm i just created a hardlink to the file... that way i still got the old logs. ...Also, pls fix ASAP if possible...thanks! |
Or you could tell me in short what's causing it... and I could try looking into how to fix it... I'm relatively free till this weekend... |
From what I'm seeing in these logs there seems to be 2 issues. |
Let me explain the issue:
|
At least two vscode windows connected to the same WSL distro, only one will start the vscode server, so if that window is closed then the other vscode window connected to the same server will disconnect as there's no server running. @PylotLight in your case if you only have one window, do you see a pattern? does it happen after an update or after a window reload? |
As shown in my pic, I was getting the disconnect error with no other windows open, so I've seen this issue occur in various senarios, e.g where I would open codium, do nothing, leave it for a few minutes and it would just disconnect on its own. And other cases where I have a spilt view which I assume counts as two windows which works fine for hours with no issues.
Unfortunately I don't have any patterns to report at this time, is there any way we could add extra logging into the extension to try narrow down some issues to provide better feedback? |
Hello @PylotLight. Glad seeing that you're not the only one that has this problem. It does seem harmless, but a pretty annoying bug every couple of minutes. I can repro as well. |
The question is can you repro consistently? I do often get the issue, but sometimes its fine and sometimes it's not, I haven't figured out a pattern for it. |
It will do it after a certain minutes of usage. Doesn't care if there's anything or nothing going on. I had this happen when there's a process running on the terminal or when I'm editing. |
I realized when the host VSCodium says it's disconnected, the server will have different PIDs like it was restarting itself, but I can't find any relevant log (lines). When server (re)starts, it overwrites the log instantly. |
That was the exact same problem when I was trying to debug this issue. You could try creating a hard link to the log file, with a different name using the ln logfile logfile2 Then, after the server restarts, theoretically you could get the older logs in logfile2. |
I believe this issue is gone for me since I switched to WSL Kernel 6.1. Can anyone else try and confirm? Here are instructions on how to do use the new kernel: https://learn.microsoft.com/en-us/community/content/wsl-user-msft-kernel-v6 |
I've also compiled and upgraded, will leave this comment here and update it if I have any errors. P.S MS docs suck and defs required some extra not included steps. |
Yeah, the documentation from MS definitely fails to mention that on distros other than Ubuntu (using Debian 12 here) some packages like @ColorfulRhino - Since I updated the WSL kernel to 6.1 the issue hasn't reappeared. |
I still get the "Please reconnect" sometimes with kernel 6.1, but rarely compared to before with kernel 5.15. It's definitely managable with 6.1 |
The same issue here: Version: 1.87.2 (system setup) I am using WSL2 with Ubuntu Preview. |
Also experiencing the same issue on Windows 10 (22H2 19045.4170) with latest VSCodium 1.88.1.24104 and WSL 2.0 Debian 10 (Kernel: 5.15.150.1-microsoft-standard-WSL2). I have only a single VSCodium window open connected to the only installed WSL distro with a Workspace opened at I noticed the issue when the VSCodium window is open on my second monitor but not focused, or when unlocking windows after coming back from a coffee break. The second one isn't a big deal since I just need to reload to continue, but having to do this every time switching back to the editor when researching something is annoying. VSCodium Window Log Output for Error (Trace log level):
|
Attempting to dig into the code which is way out of my wheelhouse: Also a child process already seems to be calling wsl commands so I feel like the earlier suggestion doesn't quite make sense. |
As a workaround, you can manually launch the server on the WSL instance. Simply navigate to |
WorkaroundA good work around is to:
All jokes aside, when you follow these steps you'll be able to use Codium without having to "reload window" every 10 minutes or so. |
Unfortunately, this issue still persists on the most recent WSL2 kernel under certain circumstances, e.g. reconnecting after opening a different workspace. While the workaround might be feasible it's potentially less effort to start the remote extension host (i.e. vscodium-server) in a detached shell in the WSL2 and connecting manually. |
@entepe85 wrote:
How would you exactly do that? I guess you would connect once with this extension to have the server installed and after first disconnect do ??? |
That's correct - you would need to initially set the extension up, or download the |
I've found what works for me is just using wsl --shutdown to restart the whole session which makes it work for a while fixing whatever is broken in the background. |
Having issues with the extension losing connection randomly, not sure where to find any logs for this issues.
So far after testing, downloading the original WSL extension vsix, does not have the same timeout issue, so should be related to this extension I think.
2023-09-09 12:35:26.139 [info] [remote-connection][ExtensionHost][7c117…][reconnect] received socket timeout event (unacknowledgedMsgCount: 523, timeSinceOldestUnacknowledgedMsg: 1654689, timeSinceLastReceivedSomeData: 1658676).
2023-09-09 11:57:57.775 [error] Missing 'tunnelApplicationConfig' or 'tunnelApplicationName' in product.json. Remote tunneling is not available
The text was updated successfully, but these errors were encountered: