Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

When upgrading to 1.85, remote ssh would report "XHR FAILED", while downgrading to 1.82 everything would be OK #200512

Closed
Tracked by #200518
monchin opened this issue Dec 11, 2023 · 24 comments
Assignees

Comments

@monchin
Copy link

monchin commented Dec 11, 2023

Does this issue occur when all extensions are disabled?: Yes

  • VS Code Version: 1.85.0
  • OS Version: win10 22H2

Steps to Reproduce:

  1. Install 1.85 windows x64 stable from official web
  2. Use remote ssh and it would fail. It would say "can't connect to {ip}: XHR failed". Below is the complete output
[11:28:08.865] Log Level: 2
[11:28:08.951] SSH Resolver called for "ssh-remote+10.2.23.88", attempt 1
[11:28:08.952] "remote.SSH.useLocalServer": false
[11:28:08.952] "remote.SSH.useExecServer": false
[11:28:08.952] "remote.SSH.showLoginTerminal": false
[11:28:08.952] "remote.SSH.remotePlatform": {"10.0.4.115":"linux","10.0.3.50":"linux","10.0.4.112":"linux","10.2.23.125":"linux","10.2.23.99":"linux","10.2.23.91":"linux","10.2.23.90":"linux","10.2.23.120":"linux","10.2.23.88":"linux","TargetMachine":"linux","10.2.23.100":"linux","10.2.23.121":"linux","10.2.23.135":"linux","10.1.23.203":"linux","10.2.23.136":"linux","10.2.23.204":"linux","10.2.23.138":"linux"}
[11:28:08.952] "remote.SSH.path": undefined
[11:28:08.952] "remote.SSH.configFile": undefined
[11:28:08.953] "remote.SSH.useFlock": true
[11:28:08.953] "remote.SSH.lockfilesInTmp": false
[11:28:08.953] "remote.SSH.localServerDownload": auto
[11:28:08.953] "remote.SSH.remoteServerListenOnSocket": false
[11:28:08.953] "remote.SSH.showLoginTerminal": false
[11:28:08.953] "remote.SSH.defaultExtensions": []
[11:28:08.954] "remote.SSH.loglevel": 2
[11:28:08.954] "remote.SSH.enableDynamicForwarding": true
[11:28:08.954] "remote.SSH.enableRemoteCommand": false
[11:28:08.954] "remote.SSH.serverPickPortsFromRange": {}
[11:28:08.954] "remote.SSH.serverInstallPath": {}
[11:28:08.957] VS Code version: 1.85.0
[11:28:08.957] Remote-SSH version: remote-ssh@0.107.1
[11:28:08.957] win32 x64
[11:28:08.959] SSH Resolver called for host: 10.2.23.88
[11:28:08.959] Setting up SSH remote "10.2.23.88"
[11:28:08.962] Using commit id "af28b32d7e553898b2a91af498b1fb666fdebe0c" and quality "stable" for server
[11:28:08.965] Install and start server if needed
[11:28:08.967] Checking ssh with "C:\Program Files\PlasticSCM5\server\ssh.exe -V"
[11:28:08.969] Got error from ssh: spawn C:\Program Files\PlasticSCM5\server\ssh.exe ENOENT
[11:28:08.969] Checking ssh with "C:\Program Files\PlasticSCM5\client\ssh.exe -V"
[11:28:08.971] Got error from ssh: spawn C:\Program Files\PlasticSCM5\client\ssh.exe ENOENT
[11:28:08.971] Checking ssh with "C:\Program Files\Common Files\Oracle\Java\javapath\ssh.exe -V"
[11:28:08.972] Got error from ssh: spawn C:\Program Files\Common Files\Oracle\Java\javapath\ssh.exe ENOENT
[11:28:08.972] Checking ssh with "C:\Windows\system32\ssh.exe -V"
[11:28:08.973] Got error from ssh: spawn C:\Windows\system32\ssh.exe ENOENT
[11:28:08.973] Checking ssh with "C:\Windows\ssh.exe -V"
[11:28:08.974] Got error from ssh: spawn C:\Windows\ssh.exe ENOENT
[11:28:08.974] Checking ssh with "C:\Windows\System32\Wbem\ssh.exe -V"
[11:28:08.974] Got error from ssh: spawn C:\Windows\System32\Wbem\ssh.exe ENOENT
[11:28:08.975] Checking ssh with "C:\Windows\System32\WindowsPowerShell\v1.0\ssh.exe -V"
[11:28:08.975] Got error from ssh: spawn C:\Windows\System32\WindowsPowerShell\v1.0\ssh.exe ENOENT
[11:28:08.975] Checking ssh with "C:\Windows\System32\OpenSSH\ssh.exe -V"
[11:28:09.004] > OpenSSH_for_Windows_8.1p1, LibreSSL 3.0.2

[11:28:09.007] Running script with connection command: "C:\Windows\System32\OpenSSH\ssh.exe" -T -D 52291 "10.2.23.88" bash
[11:28:09.010] Terminal shell path: C:\Windows\System32\cmd.exe
[11:28:09.229] > �]0;C:\Windows\System32\cmd.exe�
[11:28:09.229] Got some output, clearing connection timeout
[11:28:09.315] > mon@10.2.23.88's password: 
[11:28:09.316] Showing password prompt
[11:28:11.697] Got password response
[11:28:11.698] "install" wrote data to terminal: "********"
[11:28:11.717] > 
[11:28:12.149] > 20d46933f1fc: running
[11:28:12.184] > Acquiring lock on /home/mon/.vscode-server/bin/af28b32d7e553898b2a91af498b1f
> b666fdebe0c/vscode-remote-lock.mon.af28b32d7e553898b2a91af498b1fb666fdebe0c 
> Installing to /home/mon/.vscode-server/bin/af28b32d7e553898b2a91af498b1fb666
> fdebe0c...
> 20d46933f1fc%%1%%
> Downloading with wget
[11:28:12.206] > wget download failed
> Unable to establish SSL connection.
> printenv:
>     SHELL=/bin/bash
>     PWD=/home/mon/.vscode-server/bin/af28b32d7e553898b2a91af498b1fb666fdebe0
> c
>     LOGNAME=mon
>     XDG_SESSION_TYPE=tty
>     MOTD_SHOWN=pam
>     HOME=/home/mon
>     LANG=en_US.UTF-8
>     VSCODE_AGENT_FOLDER=/home/mon/.vscode-server
>     SSH_CONNECTION=10.2.20.222 52292 10.2.23.88 22
>     XDG_SESSION_CLASS=user
>     USER=mon
>     SHLVL=0
>     XDG_SESSION_ID=2361
>     XDG_RUNTIME_DIR=/run/user/1000
>     SSH_CLIENT=10.2.20.222 52292 22
>     PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games
> :/usr/local/games:/snap/bin
>     DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/1000/bus
>     OLDPWD=/home/mon
>     _=/usr/bin/printenv
> Trigger local server download
> 20d46933f1fc:trigger_server_download
> artifact==server-linux-x64==
> destFolder==/home/mon/.vscode-server/bin/==
> destFolder2==/af28b32d7e553898b2a91af498b1fb666fdebe0c/vscode-server.tar.gz==   
> 20d46933f1fc:trigger_server_download_end
> Waiting for client to transfer server archive...
> Waiting for /home/mon/.vscode-server/bin/af28b32d7e553898b2a91af498b1fb666fd
> ebe0c/vscode-server.tar.gz.done and vscode-server.tar.gz to exist
[11:28:12.207] Got request to download on client for {"artifact":"server-linux-x64","destPath":"/home/mon/.vscode-server/bin//af28b32d7e553898b2a91af498b1fb666fdebe0c/vscode-server.tar.gz"}
[11:28:12.207] Downloading VS Code server locally...
[11:28:12.225] > 
> 
[11:28:12.337] Resolver error: Error: XHR failed
    at k.onerror (vscode-file://vscode-app/c:/Users/c.men/AppData/Local/Programs/Microsoft%20VS%20Code/resources/app/out/vs/workbench/workbench.desktop.main.js:95:2027)
[11:28:12.341] ------




[11:32:12.336] > 
> 

So I checked workbench.desktop.main.js on line 95, col 2027

k.onerror=h=>g(navigator.onLine?new Error(k.statusText&&"XHR failed: "+k.statusText||"XHR failed"):new I.$0n),

col 2027 is from new Error

When I reinstall vscode version 1.82.1, and tried to use remote ssh, then everything worked well. I discovered this problem after my vscode upgraded itself, so I still have the older installing package. Now what I can do is to reinstall by version 1.82.1, and not let it upgrade itself.

@zesonzhang
Copy link

zesonzhang commented Dec 11, 2023

I have a similar issue using version 1.85 on my macbook to ssh

...
[13:02:11.727] > Installation already in progress...
> If you continue to see this message, you can try toggling the remote.SSH.useFlock setting
> a3b6f20b8d05: start
> exitCode==24==
> listeningOn====
> osReleaseId==debian==
> arch==x86_64==
> vscodeArch==x64==
> bitness==64==
> tmpDir==/run/user/617414==
> platform==linux==
> unpackResult====
> didLocalDownload==0==
> downloadTime====
> installTime====
> extInstallTime====
> serverStartTime====
> a3b6f20b8d05: end
[13:02:11.728] Received install output: 
exitCode==24==
listeningOn====
osReleaseId==debian==
arch==x86_64==
vscodeArch==x64==
bitness==64==
tmpDir==/run/user/617414==
platform==linux==
unpackResult====
didLocalDownload==0==
downloadTime====
installTime====
extInstallTime====
serverStartTime====

[13:02:11.728] Server installation process already in progress - waiting and retrying
[13:02:11.728] Terminating local server
[13:02:11.733] Local server exit: 15
  1. I tried to toggle remote.SSH.useFlock but still see the same error。
  2. I tried to install version 1.82.3, ssh function is OK

@bonzzo2014 bonzzo2014 mentioned this issue Dec 11, 2023
@phudson
Copy link

phudson commented Dec 11, 2023

I also see this.

@Alexandre316
Copy link

me as well

@norderik
Copy link

Same, but different error: the downloaded gzip has invalid data, so it fails to extract.
Version 1.84.2 works perfectly.

@glenn2wang
Copy link

mac vscode 1.85.0 sam question

@MiMO33
Copy link

MiMO33 commented Dec 12, 2023

I have a similar issue using version 1.85.

@lianyueh
Copy link

lianyueh commented Dec 12, 2023

same issue
VS Code Version: 1.85.0
OS Version: win11 22H2
Version 1.84.2 works perfectly.

@baizebing
Copy link

same issue. When set/reset Http: Proxy setting, it works.
hope helpful.

Http: Proxy Support is override on my side.

@glenn2wang
Copy link

Access to XMLHttpRequest at 'https://vscode.download.prss.microsoft.com/dbazure/download/stable/af28b32d7e553898b2a91af498b1fb666fdebe0c/vscode_cli_alpine_x64_cli.tar.gz?1' (redirected from 'https://update.code.visualstudio.com/commit:af28b32d7e553898b2a91af498b1fb666fdebe0c/cli-alpine-x64/stable') from origin 'vscode-file://vscode-app' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource.
request.ts:44 GET https://vscode.download.prss.microsoft.com/dbazure/download/stable/af28b32d7e553898b2a91af498b1fb666fdebe0c/vscode_cli_alpine_x64_cli.tar.gz?1 net::ERR_FAILED
(anonymous) @ request.ts:44
D @ request.ts:20
(anonymous) @ requestService.ts:32
c @ request.ts:72
request @ requestService.ts:32
download @ downloadService.ts:29
$download @ mainThreadDownloadService.ts:23
S @ rpcProtocol.ts:456
Q @ rpcProtocol.ts:441
M @ rpcProtocol.ts:371
L @ rpcProtocol.ts:297
(anonymous) @ rpcProtocol.ts:161
y @ event.ts:1148
fire @ event.ts:1179
fire @ ipc.net.ts:650
x.onmessage @ localProcessExtensionHost.ts:374
log.ts:441 ERR [Extension Host] Error: XHR failed
at k.onerror (vscode-file://vscode-app/Applications/Visual%20Studio%20Code.app/Contents/Resources/app/out/vs/workbench/workbench.desktop.main.js:95:2027)
console.ts:137 [Extension Host] Error: XHR failed
at k.onerror (vscode-file://vscode-app/Applications/Visual%20Studio%20Code.app/Contents/Resources/app/out/vs/workbench/workbench.desktop.main.js:95:2027)

image

@mirqr
Copy link

mirqr commented Dec 12, 2023

same issue. When set/reset Http: Proxy setting, it works. hope helpful.

Http: Proxy Support is override on my side.

Doesn't work for me.
vscode 1.85 on macos

@baizebing
Copy link

same issue. When set/reset Http: Proxy setting, it works. hope helpful.
Http: Proxy Support is override on my side.

Doesn't work for me. vscode 1.85 on macos

yes, it's a bit confusing, I just do {remove proxy, connect, set proxy, connet} several times, then it connected.

@Tian42chen
Copy link

Tian42chen commented Dec 12, 2023

Please refer to this link. It appears to be a bug with Remote-SSH. The team is actively working on a fix, and while the exact completion date is uncertain, it is anticipated to be resolved within the next few months. The bug has been fixed. Please await the upcoming release.

@roblourens
Copy link
Member

Thanks @Tian42chen. Yes, fix is on the way

@jordimuela
Copy link

@roblourens "on the way" means in the upcoming days(2-3)? Or next month? Just to know if worth it to do a downgrade or I can wait... And thank you a lot for the work fixing it! :D

@thezzisu
Copy link

@roblourens
Copy link
Member

It's in the next stable vscode release, which should be today

@glenn2wang
Copy link

glenn2wang commented Dec 15, 2023

is the bug fix in 1.85.1 ?

@jordimuela
Copy link

is the bug fix in 1.85.1 ?

For me it's working well after upgrading yesterday

@A-Vani
Copy link

A-Vani commented Dec 18, 2023

I too had the "XRH failed" error. Downgrading to Version 1.84.2 works perfectly. System: mac 13.3.1

@FranzKafkaYu
Copy link

FranzKafkaYu commented Dec 21, 2023

My vscode is 1.85.1 but the problem still exist(Windows 11),so I downgrade Remote-SSH and the problem disappeared.Hope this can help you guys.

@masip85
Copy link

masip85 commented Dec 21, 2023

My vscode is 1.85.1 but the problem still exist,so I downgrade Remote-SSH and the problem disappeared.Hope this can help you guys.

Only that specific extension? To which version?

@FranzKafkaYu
Copy link

My vscode is 1.85.1 but the problem still exist,so I downgrade Remote-SSH and the problem disappeared.Hope this can help you guys.

Only that specific extension? To which version?

yes,only downgrade Remote SSH extension,the latest release is v0.107.1,I switced to 0.107.0,it worked.

@ibertli
Copy link

ibertli commented Dec 29, 2023

i open the VPN and tried again, it becomes OK.

@niukai10
Copy link

niukai10 commented Jan 9, 2024

mac vscode 1.85.1 reports “Connecting with SSH timed out”

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests