XHR Failed on trying to view extentions in Visual Studio code - visual-studio-code

I installed VSCode from WSL (not WSL extention but normal Vscode linux app).
But when I try to view extentions - I am getting Error while fetching extentions. XHR failed.
There is a similar old bug: https://github.com/microsoft/vscode/issues/34385 . It is still open. But my case is different because I cannot see even extentions lists.
The solutions suggested are mainly around proxy settings but I am not behind proxy. I anyway tried them but nothing worked.
I tried different Ubuntu distros (22.04 and 18.04) - the same error.

Related

WSL Distros not visible to VSCode or IntelliJ IDEs

For a few weeks now I have had this very strange issue and have been unable to resolve it:
I usually code on WSL2, and it used to work fine on this machine and user. But now, whenever I try to open the Remote Explorer in Visual Studio Code or try to open a "New Project from Existing Files" in an IntelliJ IDE, no WSL Distros show up.
They are still there - wsl -l -v lists them and I can open them in the terminal. Everything inside of them works (aside from opening VSCode).
In Windows Explorer, their filesystems do show up. But in Visual Studio Code the list of Distros is empty and I get an error message stating "Cannot read properties of undefined (reading 'name')" when I open the Remote Explorer. In IntelliJ IDEs, only my local drives appear where there used to be additional entries for WSL.
When I navigate to a directory in WSL in the terminal and then execute code ., it opens a VSCode window, but then I get the notification "No WSL distros found".
Interestingly, previously opened projects in IntelliJ IDEs can still be opened (but I am getting Line-Ending issues).
I have tried reinstalling the WSL extension in VSCode, restarting the LXSSManager-Service, doing a network reset with netsh winsock reset, netsh int ip reset, ipconfig /release, ipconfig /renew, ipconfig /flushdns - and I have tried reinstalling VSCode entirely... to no avail. I have also looked at the registry entries for the WSL Distros under Computer\HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Lxss\, and they look fine to me.
I have also uninstalled my non-primary distros and reinstalled them - same issue across all installed distros, old or freshly installed.
I am sadly unable to specify how to reproduce the issue as everything used to work in this setup and nothing was deliberately changed.
My Windows version is Windows 11 Version 22H2 (OS Build 22621.963).

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

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.

What is the install terminal and how to remove it from VS Code terminal window?

This started showing up a few months back in my VS Code setup. It wasn't bothering so much, so I kept ignoring it. I am not sure what it's called, but searching around with "install window" or other combinations for VS Code gives some unexpected results. I am using remote-ssh extension for development and believe that it has something to do with a remote extension setting. If I try to close this window, my ssh connection breaks and VS Code opens up another of these to recreate the ssh connection.
I have tried checking and unchecking various remote-ssh extensions but to no avail. Even reinstalling VS Code didn't do any good. I don't see the same behavior on other machines that I have VS Code installed.
I would really appreciate if someone could help me get rid of this terminal. My VS Code is running on macos and ssh server is Ubuntu if this helps.
Remove "remote.SSH.showLoginTerminal": true from your User settings JSON file, then exit VSCode and re-launch the workspace. If that doesn't work set the setting to false instead.

VSCode unable to connect SSH to raspberry pi 4

I'm facing an annoying problem which just popped out of the blue overnight: VScode will not, under any circumstances connect to my raspberry pi 4 via ssh. I'm using VScode insiders with the remote-ssh extension and it worked like a charm the weeks before.
What works:
Putty connects seamlessly over LAN or WiFi.
ssh is enabled on rpi4
i am using the correct IP which i get from hostname -I in the terminal
What doesn't work:
neither "raspberrypi" nor "my correct IP" work. Right after selecting "Linux" in the selection process it throws the error "Could not establish connection to "my correct IP""
uninstalling VScode insiders and deleting all related files in docs and appdata changes nothing after reinstallation
What i observed:
This happened to me before in VScode for no reason and was unfixable. On a forum post someone recommended using insiders, which fixed the problem but now VScode insiders seems to be affected by this as well. Whenever a connection couldn't be established, two problems pop up in my extensions tab:
"Error while loading extensions. Error"
"We cannot conect to the Marketplace at this time, please try again later."
Especially the last one gives me a feeling that this is a bug within VScode. I'll gladly take the blame if it's on my behalf, i just want to fix the problem.
Similar things have been mentioned here:
"Extension host terminated unexpectedly" in vs code
Remote SSH in Visual Studio Code does not work
but are unsolved or don't quite fit my description. Thank you for your time and help.
Screenshot of my VScode insiders: https://imgur.com/a/uODtBlE

How do I make vscode c++ intellisense work with remote development?

When running vscode locally on windows I can install the C/C++ extension and immediately have some code understanding from the editor (visual studio 2019 is installed too):
However after installing OpenSSH and connecting to the same PC via the vscode Remote Development extension (connecting from linux to Windows) this doesn't work:
Everything I hover over says: Unsupported Markup content received. Kind is:
Also typing msg.<ctrl+space> gives No suggestions.
The only references I can find are:
https://github.com/redhat-developer/vscode-xml/issues/43
https://github.com/TypeFox/monaco-languageclient/pull/103/files#diff-fde961a63820de2855135d552feaef126f4624fa959efbe848c112a5fb04e4a5R180
These don't seem related. I have not set up a c_cpp_properties.json but then I didn't need to for the local test that worked. The error makes me think there is some conflicting extension, but I've uninstalled most others and the issue persists. What have I missed?