VSCode | The editor cannot be opened due to an unexpected error
Asked Answered
R

13

18

Goal: Get regular Bash and Git in Terminal working for Python projects in Visual Studio Code.

Anytime I launch, I see this error. I cannot open code or use Terminal.

Visual Studio Code screen

Error Message:

The editor cannot be opened due to an unexpected error: No file system provider found for resource 'vscode-remote://wsl%2Bubuntu/...'

Update: Uninstalled WSL. I no longer have the below old Terminal output.

Terminal:

[2022-06-13 15:53:18.277] Resolving wsl+ubuntu, resolveAttempt: 1
[2022-06-13 15:53:18.361] Starting VS Code Server inside WSL (wsl1)
[2022-06-13 15:53:18.361] Extension version: 0.66.3
[2022-06-13 15:53:18.361] Windows build: 19044. Multi distro support: available. WSL path support: enabled
[2022-06-13 15:53:18.361] No shell environment set or found for current distro.
[2022-06-13 15:53:18.546] WSL daemon log file: 
[2022-06-13 15:53:18.548] Probing if server is already installed: C:\WINDOWS\System32\wsl.exe -d Ubuntu -e sh -c "[ -d ~/.vscode-server/bin/c3511e6c69bb39013c4a4b7b9566ec1ca73fc4d5 ] && printf found || ([ -f /etc/alpine-release ] && printf alpine-; uname -m)"
[2022-06-13 15:53:19.023] Probing result: x86_64
[2022-06-13 15:53:19.024] No server install found in WSL, needs linux-x64
[2022-06-13 15:53:19.024] Downloading server on client side to C:\Users\dabell\AppData\Local\Temp\vscode-remote-wsl\c3511e6c69bb39013c4a4b7b9566ec1ca73fc4d5\vscode-server-stable-linux-x64.tar.gz.
[2022-06-13 15:53:19.024] https://update.code.visualstudio.com/commit:c3511e6c69bb39013c4a4b7b9566ec1ca73fc4d5/server-linux-x64/stable
[2022-06-13 15:53:26.719] Unable to download server on client side: Error: Request downloadRequest failed with message: getaddrinfo ENOTFOUND update.code.visualstudio.com. Will try to download on WSL side.
[2022-06-13 15:53:26.721] Launching C:\WINDOWS\System32\wsl.exe -d Ubuntu sh -c '"$VSCODE_WSL_EXT_LOCATION/scripts/wslServer.sh" c3511e6c69bb39013c4a4b7b9566ec1ca73fc4d5 stable code-server .vscode-server --host=127.0.0.1 --port=0 --connection-token=1433349295-3472956524-2784734323-674824766 --use-host-proxy --without-browser-env-var --disable-websocket-compression --accept-server-license-terms --telemetry-level=all'
[2022-06-13 15:53:27.103] Setting up server environment: Looking for /home/danielbellhv/.vscode-server/server-env-setup. Not found.
[2022-06-13 15:53:27.104] WSL version: 4.4.0-19041-Microsoft Ubuntu
[2022-06-13 15:53:27.104] Updating VS Code Server to version c3511e6c69bb39013c4a4b7b9566ec1ca73fc4d5
[2022-06-13 15:53:27.104] Removing previous installation...
[2022-06-13 15:53:27.104] Installing VS Code Server for x64 (c3511e6c69bb39013c4a4b7b9566ec1ca73fc4d5)
[2022-06-13 15:53:27.104] Downloading:     
[2022-06-13 15:53:37.329] 100%
[2022-06-13 15:53:37.329] Failed
[2022-06-13 15:53:37.331] --2022-06-13 16:53:37--  https://update.code.visualstudio.com/commit:c3511e6c69bb39013c4a4b7b9566ec1ca73fc4d5/server-linux-x64/stable
[2022-06-13 15:53:37.331] Resolving update.code.visualstudio.com (update.code.visualstudio.com)... 
[2022-06-13 15:53:47.093] failed: Temporary failure in name resolution.
[2022-06-13 15:53:47.093] wget: unable to resolve host address ‘update.code.visualstudio.com’
[2022-06-13 15:53:47.093] ERROR: Failed to download https://update.code.visualstudio.com/commit:c3511e6c69bb39013c4a4b7b9566ec1ca73fc4d5/server-linux-x64/stable to /home/danielbellhv/.vscode-server/bin/c3511e6c69bb39013c4a4b7b9566ec1ca73fc4d5-1655135606.tar.gz
[2022-06-13 15:53:47.094] VS Code Server for WSL closed unexpectedly.
[2022-06-13 15:53:47.094] For help with startup problems, go to https://code.visualstudio.com/docs/remote/troubleshooting#_wsl-tips
[2022-06-13 15:53:47.116] WSL Daemon exited with code 0
Resource answered 14/6, 2022 at 10:40 Comment(1)
This issue has been happening since almost two years to me and I still don't understand why it is happening and why it isn't fixed permanently...Blockish
R
-1

I simply uninstalled and reinstalled WSL 2, from Windows Store.

You can via command line, but I found using Windows Store to be more accessible / user friendly.

Resource answered 2/7, 2022 at 12:17 Comment(1)
This is not an option for most Enterprises as laptops often has Windows Store Disabled by a domain controller due to security policies.Vacate
Y
17

running wsl --shutdown from windows command line and relaunch the vscode solved my issue.

Yukyukaghir answered 26/10, 2022 at 3:35 Comment(3)
This worked for me and seems like the most 'correct' solution for the majority of cases.Alleris
I only restarted VScode, and the problem was solved.Hurlyburly
This ended up working for me, but I had to close all instances of vs code. I did shutdown wsl after closing one instance, but forgot I left a second instance open. After starting up wsl and closing the second instance, then re-opening vs code, it worked. I'm not suggesting that's the right order, I would have rather closed both instances first. Only noting the wsl shutdown because that's the process I took :/Brevity
T
13

Deleting the .vscode* folders in the home directory (in wsl) fixed the issue

Teatime answered 22/12, 2022 at 15:8 Comment(0)
E
11

This can be solved temporarily by restarting the WSL container's network.

Open Powershell as administrator and run the following command:

Restart-Service LxssManager

I would advise saving it to a script such as restart-WSL-network.ps1 and setting up a shortcut to run this when it happens again.

Ema answered 7/9, 2022 at 17:47 Comment(1)
Yup this worked for me, thanks! It did also kill my Docker Desktop backend :DMiriam
S
6

I'm kind of late to the party, but I've just had this issue today. I only restarted Windows, and now it works fine!

Sympathizer answered 23/8, 2022 at 13:59 Comment(1)
In my case only restarting windows did help. Also, try to check if Pycharm has access to this project, as this was the error only in Visual Studio Code.Indestructible
T
3

Tried shutting down WSL using wsl --shutdown and restarting vs code, but it still didn't work.

What i had to do was also close other vs code instances and ensure VS code was not running in the background. It works now.

Teakwood answered 17/1, 2024 at 12:51 Comment(1)
I didn't run wsl --shutdown but just remove ~/.vscode-server and close all the instances of vscode. The issue resolved.Misty
A
2

Remove folder .vscode-server and restart VSCode

Aplomb answered 12/4, 2024 at 6:33 Comment(0)
T
1

Something was hung for me. Couldn't restart wsl, so restarted the PC, made sure wsl is running, then docker if you are using docker and vscode opens fine.

Traherne answered 14/3, 2023 at 23:24 Comment(0)
L
0

I had the same issue, caused by a broken installation of Ubuntu; basically, the Ubuntu installation was forcibly aborted, but some configuration still remained and I could see the distro listed by the wsl --list command.

I manually unregistered the distro, issuing the following command in Powershell:

wsl --unregister Ubuntu

Afterwards, I also checked wsl --list to be sure that:

  1. the offending distro was not present any more and

  2. that the default distro was correct)

Then everything started to work properly again.

Lindquist answered 25/10, 2023 at 14:47 Comment(0)
L
0

Disclaimer: This answer has nothing to do with WSL... but I had a very similar problem and wasn't able to find an answer anywhere. Adding my solution here because this question was a top search result for me.

My problem (in VS Code for Web) was due to some built-in extensions having been disabled. Specifically Remote Repositories, GitHub Repositories, and Azure Repos. The issue was immediately resolved after enabling all disabled built-in extensions.

enter image description here

P.S. When I looked at the output for Extension Host (Worker) I saw the same (or similar) error message as is seen in the image presented by the OP. This led me down the path of checking extensions (and eventually the built-in ones).

Lockage answered 15/5, 2024 at 22:46 Comment(0)
N
0

I came across this issue today running VS Code on Linux (bare metal, not WSL). I am using docker-desktop for container services and the problem was that docker-desktop's VM had run out of disk space (the physical disk had plenty of space, but the VHD allocated to docker was full).

Novella answered 6/6, 2024 at 19:50 Comment(0)
I
0

It happened to me in 2024 due to an vscode update not installed in the vscode wsl server. Close the opened vscode windows and restart them manually. It will reconnect(while notifying of an update in the down right corner), if the update is the issue.

Incense answered 14/6, 2024 at 8:20 Comment(0)
I
0

I encountered this error using VSCODE remote desktop to a Linux box. To fix the problem I simply had to kill all processes running on the server and restart VSCODE locally.

Inevitable answered 22/7, 2024 at 19:9 Comment(0)
R
-1

I simply uninstalled and reinstalled WSL 2, from Windows Store.

You can via command line, but I found using Windows Store to be more accessible / user friendly.

Resource answered 2/7, 2022 at 12:17 Comment(1)
This is not an option for most Enterprises as laptops often has Windows Store Disabled by a domain controller due to security policies.Vacate

© 2022 - 2025 — McMap. All rights reserved.