VSCode fails to download the vscode-server on my remote ssh host. With this I am fine. As a fallback VSCode tries to download the vscode-server on my local machine, to then copy it to the remote machine via ssh. This fails du to an XHR error.
The output generated by VSCode looks like this:
> Trigger local server download
> 8d402d7e9ae2:trigger_server_download
> artifact==cli-alpine-x64==
> destFolder==/home/rschmidtner/.vscode-server==
> destFolder2==/vscode-cli-af28b32d7e553898b2a91af498b1fb666fdebe0c.tar.gz==
> 8d402d7e9ae2:trigger_server_download_end
> Waiting for client to transfer server archive...
> Waiting for /home/rschmidtner/.vscode-server/vscode-cli-af28b32d7e553898b2a91af498b1fb666fdebe0c.tar.gz.done and vscode-server.tar.gz to exist
>
[14:17:21.193] Got request to download on client for {"artifact":"cli-alpine-x64","destPath":"/home/rschmidtner/.vscode-server/vscode-cli-af28b32d7e553898b2a91af498b1fb666fdebe0c.tar.gz"}
[14:17:21.193] Downloading VS Code server locally...
[14:17:21.332] Terminating local server
[14:17:21.333] Exec server for ssh-remote+scedge01 failed: Error: XHR failed
[14:17:21.334] Error opening exec server for ssh-remote+scedge01: Error: XHR failed
[14:17:21.336] Local server exit: 15
The developer tools output looks like this:
ERR XHR failed: CodeExpectedError: XHR failed
at ee.rb (vscode-file://vscode-app/Applications/Visual%20Studio%20Code.app/Contents/Resources/app/out/vs/workbench/workbench.desktop.main.js:2718:21055)
at async ee.qb (vscode-file://vscode-app/Applications/Visual%20Studio%20Code.app/Contents/Resources/app/out/vs/workbench/workbench.desktop.main.js:2718:20332)
at async ee.Ob (vscode-file://vscode-app/Applications/Visual%20Studio%20Code.app/Contents/Resources/app/out/vs/workbench/workbench.desktop.main.js:2719:11484)
at async ee.jb (vscode-file://vscode-app/Applications/Visual%20Studio%20Code.app/Contents/Resources/app/out/vs/workbench/workbench.desktop.main.js:2718:17969)
I have the strong assumption that this is proxy related. I connect to the remote host via the proxy. The proxy domain and port are correct, I double checked. I also played arround with proxy settings in VSCode like suggested in Visual Studio Code "Error while fetching extensions. XHR failed", but without success. Installing extensions on my local machine works without raising XHR errors. How can I prevent VSCode from running into XHR errors while downloading the vscode-server?
If you are running VSCode version 1.85.0, it seems to be a CDN server configuration issue, see https://github.com/microsoft/vscode/issues/200512 and https://github.com/microsoft/vscode-remote-release/issues/9246.
A fix has been merged to VSCode, I think it will be included in the next release : https://github.com/microsoft/vscode/pull/200554.
I understand that downgrading to 1.84 is a workaround. You can also manually install the server to your remote host by following the answer in this theda : How can I install vs-code-server manually and tell vs-code-remote?