Failed to connect to the remote extension host server (Error: Missing proxy instance MainThreadDebugService) - visual-studio-code

Hey stackoverflow community i have an issue with vscode connecting to wsl2 with the following error [picture bellow] message i already searched for hours and couldnt find a solution.
reinstalled both with a clean updated version without any success
Edit 1:Tried to unmount and remount folders also tried opening with high privilege's from cmd 'wsl code .' moreover i completely deleted wsl and vscode with all the extensions but still am getting the same error, i was able to reproduce more readable error, when opening a project it prompts with
unable to resolve resource vscode-re...://%ubuntu-22.04/file_path
Edit 2: opening WSL, 'New WSL window using distro' works fine but i cant open any directory, without it producing the error in Edit 1

I got the same issue. I use Windows and I open the folder in vscode in this way:
shift+right-click the folder -> open linux shell -> type in "code ."
when vscode opens, the error does not exist.

For me this was due to the secondary sidebar being visible.
After disabling it via View -> Appearance -> Secondary Side Bar, WSL2 starts up fine again.

I got the same.
If your project is on another drive mount it and
run vscode as administrator.

I had this issue and needed to run..
$ code
Updating VS Code Server to version 97dec172d3256f8ca4bfb2143f3f76b503ca0534
Removing previous installation...
Installing VS Code Server for x64 (97dec172d3256f8ca4bfb2143f3f76b503ca0534)
Downloading: 100%
Unpacking: 100%
Unpacked 2389 files and folders to /home/dmitri/.vscode-server/bin/97dec172d3256f8ca4bfb2143f3f76b503ca0534.
in WSL2 to update the WSL2 server. Then uninstalling and reinstalling the WSL extension from VSCode did the trick.

I am the same.
I also reinstalled VSCode and Docker, but nothing changed.
In the "Remote - Containers" tutorial, I was able to connect without any problems.
It doesn't work with my code.

Related

cannot connect to the remote wsl on vs code (Error: [UriError]: cannot call joinPath on URI without path)

i'm trying to use wsl on vs code. it worked well until it unexpectedly stopped working.
Any ideas on how can i fix this? I tried to uninstall and reinstall vs code as well as stopping the remote server but it did not work either. I'm still stuck on the workspace page without the possibility to do anything.
Thanks in advance.
Uninstalling doesn't affect the vscode server files in your home directory. Removing said files will cause a fresh install of said server and remote container files. So,
rm -r ~/.vscode*
code <wherever_you_like>

Failed to connect to the remote extension host server (Error: Handler already set!)

I went to open a repo using Vs Code on a remote ssh host. I can ssh in successfully but when I try to open a repo I get Failed to connect to the remote extension host server (Error: Handler already set!). I've tried un installing and re installing Vs Code. Does anyone have a fix other than switching ides.
avenmore comment helped me:
I started getting this message with v1.57.0 when trying to run a Vue
project. Long story short: I usually have my DEBUG CONSOLE window
docked inside to the right of my TERMINAL (powershell), and upon
opening VSCode it wouldn't be visible and I'd get this message after
building successfully and trying to launch. The work-around is to
close VSCode, navigate to folder
USERPROFILE%\AppData\Roaming\Code\User\workspaceStorage and delete the
contents (notably state.vscdb) and then restart VSCode. The DEBUG
CONSOLE then shows itself again and all is fine unless I dock it again
and close VSCode and there is a good chance of it happening again next
time VSCode is opened. I have stopped docking the window inside the
terminal and it hasn't happened since.
For me what solved this was to go into the 'remote explorer' and clear out the SSH Targets that I already had in there before the upgrade, and then just paste them in again. Now I can connect. For example, a re-pasted SSH command looked like:
ssh -i "/Users/myuseraccount/abc.pem" someuser#ec2-ip-instance1.compute.amazonaws.com
A few days later this stopped working again. I think maybe because my SSH targets config saved what I pasted in as my SSH connection command. It appears "sometimes" if there are any entries in the SSH target config file, that this error occurs.
I find to ensure this error never occurs do
rm ~/.ssh/config
every time before you open Vs Code. Assuming ~/.ssh/config is where your Vs Code is reading its SSH entries from. There is one other place possible under /etc/$somewhere (I dont know where).
Then when you go to your empty SSH Target and hit the (+) button to connect, paste in the entire ssh connection request at the top of this file. I think you have to clear out the SSH targets every time otherwise I get this error coming up again days later.
Try in settings.json add item "security.workspace.trust.enabled": false
Windows, VSCode 1.57.1
I've just remove and added the host again in ssh configuration:
If you are using MacOS, I found a way.
Close Visual Studio Code, delete files in these two folder, then restart Visual Studio Code.
rm -rf $HOME/Library/Application\ Support/Code
rm -rf $HOME/.vscode
I tried all solution on this post, and can't get success. Then cloned another repo on my WSL folder then open, it was fine. So I changed my repo name, then problem gone. Maybe it may dumb solution. But it works me.
You gonna have to change the "debug.terminal.clearBeforeReusing" to true on setting.json. It works for me
I noticed there was a workspace folder in the folder above, deleted that and it resolved the issue
On the remote system, after various things had happened, I did mv .vscode .vscode-old to basically reset the remote .vscode (over ssh). I had also renamed the remote folder for the project -- not sure if that matters. Then I was was able to connect to it again.
I can't be scientific about those "various things that happened", but I'll to list some:
I had created a second project alongside the first and had connected to it - this was for unrelated reasons and preceded the "handler" error
it was then that I had issues connecting to the first one, even though it had worked for months and months without me ever having this Handler already set error -- related to creating the 2nd one? Not sure. The 2nd one worked fine throughout.
I tried File: Open Folder... from the second remote project and opened the first; it opened but got 2 python exception errors in a python extension - unfortunately I can't remember what they were. This could be noise / unrelated. I happen to have both MS python and pylance extensions installed remotely, I think it was the pylance once that was not happy.
during this, I had also renamed the 1st folder which didn't work; I'm not sure if the rename triggered the different behaviour ie python ext errors instead of the "handler" error
I then replaced .vscode in the first remote project (with the new folder name)
... and that was when it worked, with no "handler" error and no complaints from the python extension(s)

Error loading webview: Error: Could not register service workers: TypeError: Failed to register a ServiceWorker for scope

When I update my VSCode to v1.56.2 and open webview, I get these messages:
Error loading webview: Error: Could not register service workers:
TypeError: Failed to register a ServiceWorker for scope
('vscode-webview://867f875b-c5a3-4504-8de2-2e8614bdc0f8/') with script
('vscode-webview://867f875b-c5a3-4504-8de2-2e8614bdc0f8/service-worker.js?platform=electron&id=867f875b-c5a3-4504-8de2-2e8614bdc0f8&vscode-resource-origin=https%3A%2F%2F867f875b-c5a3-4504-8de2-2e8614bdc0f8.vscode-webview-test.com'):
ServiceWorker cannot be started.
How can I solve this issue?
If you are using Ubuntu, there is probably another (maybe hidden) vscode process, which is causing the problem.
Close the vs code first and in terminal try: killall code.
In Windows, you can simply fix this error by clearing the cache for VSCode. Please follow the steps below:
Close VSCode and also kill any background processes running in the task manager.
Go to the file explorer and to the path C:\Users\<user_name>\AppData\Roaming\Code and clear the contents of the folders Cache, CachedData, CachedExtensions, CachedExtensionVSIXs (if this folder exists) and Code Cache.
Open VSCode and you are good to go.
I encountered this issue and am not a Windows user, so this is my resolution:
I found that there was an instance of VS Code open that was erroneously not shown on my dock. I closed this instance and opened a new instance. The problem was gone.
I think the issue happened because I had a VS Code instance open, allowed a software update to run in the background, postponed the restart, opened a new and updated VS Code instance, and the old instance remained open causing conflicts.
OS: Ubuntu 20.04.2 LTS
#tritemio on GitHub has a great answer:
https://github.com/microsoft/vscode/issues/125993#issuecomment-912439561
in short, delete cache folder:
rm -rf ~/.config/Code/Cache
This is a known bug in VS Code 1.56. It happens for some Windows users when running VS Code as an administrator
As a workaround, you can try launching VS Code with the --no-sandbox command line flag:
$ code --no-sandbox
#tritemio, thanks for sharing.
This also seemed to solve my issues on Windows for "Extensions - Details View", "VS Code Release Notes View", "Gitlab integrated Interactive Rebase Editor", etc.
I followed your suggestion and deleted the following folders;
%appdata%\Code - Insiders\Cache
%appdata%\Code - Insiders\Code Cache
On *nix systems, first close VS Code app then run pgrep -f '/Applications/Visual Studio Code.app' | xargs kill to clean up vscode's processes. Reopen vscode and the issue will be gone.
If on macOS, you can run the above command verbatim. If you're not on macOS or installed vscode on a different location, you need to change the argument passed to pgrep. You can run ps auxww | command grep -i --color code to find the path of vscode's running processes.
Happened to me when started code in windows cmd. Closed vs code and opened it from my taskbar shortcut instead, and the error was gone
The simplest solution for this problem in any version of Linux is simply to close other instances of VS code and use only one instance of VS code.
OS: Linux 20.04.3 LTS
I've also encountered the same "Error loading web view" Error.
I've solved this issue by moving "vscode.app" into "Application folder" instead of "Download folder" on macOS.
I'll describe my "symptom" here.
OS: macOS 12.0.1
Installed 2 versions of vscode somehow, 1 under "Application folder", another under "download folder"
Run both vscode at the same time, the "download folder" version has no error display plugin pages, the "Application folder" version has the "Error loading webview" error
Checked and see 2 vscode instances running in the background
What I tried to solve this issue:
Tried to kill "download folder" instance, and the error remains for "application folder" instance
Moved "download folder" to "application folder" and both vscode works correctly on plugin page!
What I suspect on what the problem is?
Maybe these 2 vscode are sharing the same resource(could be some shared file), however they have different permissions since one is under application folder and another is under download folder.
This answer applies if using VSCode in GitHub Codespaces in Firefox or Brave browsers. I had to disable "Enhanced Tracking Protection" for the site, and that is all. To do so, click on the shield icon which is to the left of the displayed web address.
If anyone is using Brave, please turn off the brave shields as well.
For Mac/Apple computer Monteray version the following steps worked for me:
Delete VSCode from downloads folder.
Turn off VSCode
Open Activity Monitor and delete VSCode "Code" process.
Try closing all the process cmd+qof vscode and reopen vscode and everything should work well.
I have just restarted VS code and it worked for me. OS was Windows 10.

vscode is not lauching for me on windows 7

I downloaded the latest ZIP file of VSCode for windows from VSCode website.
Unzipped it and tried running the Code.exe from it. It does nothing no crashing message juts output nothing.
I tried running Code.exe from command prompt [after CD to the directory where I have unzipped it], nothing happens, no out put.
Then I did some googling to do more troubleshooting and found out I need to run Code.exe or bin\code.cmd with --help and --verbose command.
No output on command line.
I am totally confused and don't know how do I make VScode work on my windows 7 machine or how do I troubleshoot why its not working.
I have appropriate .Net Framework installed [the one suggested by the VSCode website].
I have also tried installer , with all above debugging steps , same outcome as above.
I checked the code.exe in task manager to see if its running in background, nothing in there too.
What do I do ?
Check if the process is running in Task Manager.
Check for "code.exe". If it is running, then end all instances, and try again.
Otherwise, try opening event log, in Application or System. Look for errors or warnings which may have been logged and give some insight into why Code didn't open.
So guys seems like new version of VSCode has this problem.
Try downloading an older version of VSCode and do not upgrade it once its installed.
After I installed : V 1.18.1 , its working fine.

Receiving error message 'Extension host terminated unexpectedly.' in Visual Studio Code

I have been looking around and I haven't found any answers to my issue.
I keep getting this error "Extension host terminated unexpectedly." and I have tried removing all of my extensions, reinstalling the program, trying different versions of vscode including the insider versions.
The way I get this isssue isn't from trying to use the debugger or trying to use some sort of extension, as I said before I removed all of them and the error keeps on coming back, it's simply from opening the application. I'm not entirely sure how to continue? I have had to use another editor because the error just doesn't go away. I will just have to wait for another update of Visual Studio Code I assume? I've had the issue since tuesday this week, guessing since the latest update.
Above is the error message I get. It is closed by esc but reappears very shortly after, every time.
When I open developer tools, this is what I find in the console.
Running vscode from command prompt with Code.exe --disable-extensions doesn't help.
Visual Studio Code version: 1.16.1
I appreciate any help.
Linking my github issue on Microsoft/vscode as reference
I had the same error after updating vsc to v. 1.31.0.
Disabling Live Server Extension worked for me.
Here's the error i'm getting having the extension enabled.
I started getting this error when vscode automatically updated to March 2020 (version 1.44). I have tried various suggestions given in the forum and over the internet but none of them worked.
What worked for me: I downloaded January 2020 (version 1.42) build from https://code.visualstudio.com/updates/v1_42 and ran over the previous installation without uninstalling and surprisingly, the error disappeared and all extensions are loading and working properly.
I tried following things and non of them worked:
I disabled all the installed extension from GUI.
uninstalled all the extension and installed again.
removed the left-over extensions from Windows %USERPROFILE%.vscode\extensions.
tried launching from the command prompt with --disable-extensions option.
Linking my github issue on Microsoft/vscode as reference.
It ended up being one of the base extensions that runs on startup that was the root of the problem.
In my case the git in extensions folder was causing it.
"git.enabled": false was not doing the trick so I had to remove the git folder altogether for the error to disappear.
In my case, I used typescript-hero extension. Disabling this extension fixed my problem.
It's temporal fix but maybe will help somebody.
I disabled all the extensions with name Live for example Live Server, Live Share etc and restarted my vscode again and it worked for me.
For me this was happening due to HTML CSS Support extension. so i removed it and restarted vs code and voila! it worked!
I had to uninstall few extensions related to Java (debugger for java, Test runner for java, extension pack for java etc) to make the error go away.
Click on the developer tool option that popups and see if it has the extension which is causing this error.
I got same issue and it was because of Color Highlight Extension. I just uninstalled Color Highlight Extension and its working fine and NO ERROR.
Me too. My failure has no "Code":
Extension host terminated unexpectedly. Code: null Signal: SIGABRT
MessageService.ts
I recently ran into the same error message after accepting a permission to run a program on the extension livepreview. It corrupted all other extensions where it could not find the commands. I deleted all extension files and reinstalled the other extensions without a problem. I tried liveserver again but It never prompted me again for permissions and still, the error message keeps occurring. I'm assuming liveserver was trying to ask the computer permission to run a local server after which is still accepted but something else is interfering with the computer being able to translate from the program to actually building and accessing the local server.
In my case, the live server extension was causing this issue in 1.31.0v of VS Code. After uninstalling the extension it started working correctly.
In my case it was from the extension "Todo Tree". It was breaking on a particularly large file in my project (13.7mb), with the error saying the file was over the max-size for a node-buffer (used by the C regex matcher).
Resolved the issue by disabling the extension.
I also opened an issue for it here: https://github.com/Gruntfuggly/todo-tree/issues/135
I had same problem with following error in my VSCode console.
`1: node::DecodeWrite
2: node::InternalCallbackScope::Close
3: v8::internal::VirtualMemory::TakeControl
4: v8::internal::PerThreadAssertScope<4,1>::PerThreadAssertScope<4,1>
5: v8::internal::operator<<
6: v8::internal::operator<<
7: 00000073ECF04481`
I solved it by uninstalling Angular Console extension. Not sure if it was that particular extension or some other memory issue but problem went away as soon as I uninstalled that.
Remove all Extensions which are located in a per user extensions folder. Depending on your platform, the location is in the following folder:
Windows %USERPROFILE%\.vscode\extensions
macOS
~/.vscode/extensions
Linux ~/.vscode/extensions
Restart vscode and start installing extensions.
I am not sure why this caused , but the Antivirus was throwing popups that something like extensionprocess.js file was repaired.
Disabled the Antivirus and re-installed Vscode and it was back to normal.
Hope this helps.
Here is what helped me:
Ctrl+Shift+P --> type: "Disable"
and click Disable all installed extensions
(alternatively click Disable all installed extensions for this Workspace)
Then go to extensions panel on the left and re-enable slowly those that you really need.
See which extension (or their combination) triggers that error.
It will be highly appreciated which extenstion/combination you'll find guilty as there may be several of them, and different in time...
for me, it was code runner extension I just disabled it.