Vscode-remote-release: Improve error message for client without internet access

Created on 11 Jul 2020  路  15Comments  路  Source: microsoft/vscode-remote-release


  • VSCode Version: 1.47.0 (Commit d5e9aa02)
  • "Remote - SSH" extension version: 0.51.0
  • Local OS Version: Windows 7 (Windows_NT x64 6.1.7601)
  • Local OS ssh version: OpenSSH_7.7p1, OpenSSL 1.0.2p 14 Aug 2018, comes from Git for Windows 2.19.1
  • Remote OS Version: CentOS 7.3.1611 (Kernel version 3.10.0-514.el7.x86_64)
  • Remote OS ssh version: OpenSSH_6.6.1p1, OpenSSL 1.0.1e-fips 11 Feb 2013
  • Remote Extension/Connection Type: SSH
    Steps to Reproduce:
  1. Press F1, Press Enter on "Remote-SSH: Add New SSH Host", enter "ssh [email protected] -A", (a normal user is used, NOT root), then select "C:\Users\WIN_USERNAME.ssh\config" as the SSH configuration file to update
    The config file is similar to:

Host domain.com
HostName domain.com
User USERNAME
ForwardAgent yes

  1. Press F1, Press Enter on "Remote-SSH: Connect to Host...", then enter on "domain.com". A new VSCode window is opened. In the new window, enter on "Linux" then enter the ssh password. On the bottomright, it says "Setting up SSH Host domain.com (details) Initializing VS Code Server". I press "detail", it gives some log which I put as the attachment vscode_remote_log.txt (Actual hostname and username concealed).
    After a while, I get a error dialog "Could not establish connection to domain.com. XHR failed"


Does this issue occur when you try this locally?: Yes
Does this issue occur when you try this locally and all extensions are disabled?: All other extensions disabled except "Remote - SSH"

Currently I cannot provide /etc/ssh/sshd_config because it is readable by root only. If needed, I can get it by contacting the system admin.

bug plan-review ssh

Most helpful comment

The problem is related to no internet access. However, the error message is too confusing for me. I didn't realize that "Could not establish connection. XHR failed" is because downloading vscode-server from internet failed.

Find the solution on https://stackoverflow.com/questions/56718453/using-remote-ssh-in-vscode-on-a-target-machine-that-only-allows-inbound-ssh-co/56781109#56781109

This works for me.

All 15 comments

I have attempted to remove ~/.vscode-server on the remote machine and retry. But it does not solve the problem.

Remote OS bash version: 4.2.46(1)-release

Remote OS glibc version: 2.17-157.el7_3.1

Local OS and Remote OS have NO access to the internet. Extension installed by vsix

Home folder is on NFS. Read the issue #885. Enabled remote.SSH.lockfilesInTmp, but does not solve the problem

Remote host Login shell is /bin/bash. Remove ~/.bashrc and ~/.bash_profile does not help

Install wget from http://gnuwin32.sourceforge.net/packages/wget.htm, on the Host Windows OS. Not work

Remove ~/.vscode, ~/.vscode-server and /run/user/$(id -u)/vscode*. Does not help

The problem is related to no internet access. However, the error message is too confusing for me. I didn't realize that "Could not establish connection. XHR failed" is because downloading vscode-server from internet failed.

Find the solution on https://stackoverflow.com/questions/56718453/using-remote-ssh-in-vscode-on-a-target-machine-that-only-allows-inbound-ssh-co/56781109#56781109

This works for me.

Is this the same as #1242?

This is the same as #1242, but the error message is too confusing, so it takes me a while to realize the root cause of the issue. I suggest to fix the broken error message first.

just encountered this as well on an air-gapped machine.
very confusing error message!
thank you Safetee for the fix! the stack overflow link worked perfectly

You can try this approach https://medium.com/@debugger24/installing-vscode-server-on-remote-machine-in-private-network-offline-installation-16e51847e275

I had this exact issue after upgrading to 1.50.0. Deleting /.vscode-server via SSH did it for me though.

As mentioned above, duplicate of #1242, but considering keeping open to address feedback about improved error message:

The problem is related to no internet access. However, the error message is too confusing for me. I didn't realize that "Could not establish connection. XHR failed" is because downloading vscode-server from internet failed.

Was this page helpful?
0 / 5 - 0 ratings