vscode
vscode copied to clipboard
Failed to connect to the remote extension host server (Error: WebSocket close with status code 1006)
Does this issue occur when all extensions are disabled?: Yes/No
- VS Code Version: 1.88.2
- OS Version: Windows x64 10
- WSL2 distro is Ubuntu Ubuntu 22.04.2 LTS
Steps to Reproduce:
After clonsing the vs code instance & laptop and opened it the next day, suddenly i got
" Could not fetch remote environment & Failed to connect to the remote extension host server (Error: WebSocket close with status code 1006)" error while tryin to connect to WSL instance. It is not the first time I've encountered this issue. I can't take things from scratch every time i get this error.
I tried to reboot windows, NO change.
I tried to reboot WSL from CMD with " wsl --distribution Ubuntu" and it worked. VS Code doesn't want to conect to it.
Thanks for creating this issue! It looks like you may be using an old version of VS Code, the latest stable release is 1.80.0. Please try upgrading to the latest version and checking whether this issue remains.
Happy Coding!
I have reinstalled Vs Code and I got the same issue.... same erros. Here are the details of the verisons: Version: 1.80.0 Date: 2023-07-04T15:06:02.407Z Electron: 22.3.14 ElectronBuildId: 21893604 Chromium: 108.0.5359.215 Node.js: 16.17.1 V8: 10.8.168.25-electron.0 OS: Windows_NT x64 10.0.19045
I was able to solve this issue by completing these steps found in here
- Start WSL2 with > wsl.exe from the windows terminal, or with windows application icon (such as Ubuntu).
- Change directory to home directory.
- Remove .vscode-server, such as $
rm -rf .vscode-server
. - Finally, start VSCode and Remote-WSL: New Window. (VSCode makes new .vscode-server.)
Will have to check if the issue keeps appearing after rebooting computer
Thanks for reporting. These issues are difficult to investigate. I'll close the issue for now. If you see it again and have more information, please let us know.
I was able to solve this issue by completing these steps found in here
- Start WSL2 with > wsl.exe from the windows terminal, or with windows application icon (such as Ubuntu).
- Change directory to home directory.
- Remove .vscode-server, such as $
rm -rf .vscode-server
.- Finally, start VSCode and Remote-WSL: New Window. (VSCode makes new .vscode-server.)
Will have to check if the issue keeps appearing after rebooting computer
I ran into the same issue just now,
Failed to connect to the remote extension host server (Error: WebSocket close with status code 1006)
,
and the fix you commented helped me out. Thanks for posting it.
Just to simplify the instructions, running this command from your WSL2 terminal should fix the issue.
- Exit out of VSCode entirely.
- Run
rm -rf ~/.vscode-server/
from your WSL2 terminal. - Open VSCode again.
Open an issue at https://github.com/microsoft/vscode/issues/ if the issue still persists.