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

Improve error message for client without internet access #3349

Closed
SafeteeWoW opened this issue Jul 11, 2020 · 18 comments
Closed

Improve error message for client without internet access #3349

SafeteeWoW opened this issue Jul 11, 2020 · 18 comments
Assignees
Labels
bug Issue identified by VS Code Team member as probable bug plan-review PM-highlighted item determined to be P1 or P2 ssh Issue in vscode-remote SSH verified Verification succeeded

Comments

@SafeteeWoW
Copy link

  • 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 USERNAME@domain.com -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.

@SafeteeWoW
Copy link
Author

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

@SafeteeWoW
Copy link
Author

Remote OS bash version: 4.2.46(1)-release

@SafeteeWoW
Copy link
Author

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

@github-actions github-actions bot added the ssh Issue in vscode-remote SSH label Jul 11, 2020
@SafeteeWoW
Copy link
Author

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

@SafeteeWoW
Copy link
Author

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

@SafeteeWoW
Copy link
Author

SafeteeWoW commented Jul 12, 2020

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

@SafeteeWoW
Copy link
Author

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

@SafeteeWoW
Copy link
Author

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

@SafeteeWoW
Copy link
Author

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.

@adfel70
Copy link

adfel70 commented Jul 15, 2020

Is this the same as #1242?

@SafeteeWoW
Copy link
Author

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.

@Zamiell
Copy link

Zamiell commented Aug 27, 2020

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

@debugger24
Copy link

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

@SoftwareApe
Copy link

SoftwareApe commented Oct 12, 2020

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

@bamurtaugh bamurtaugh added the bug Issue identified by VS Code Team member as probable bug label Nov 4, 2020
@bamurtaugh
Copy link
Member

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.

@roblourens roblourens changed the title Could not establish connection. XHR failed Improve error message for client with no network Nov 6, 2020
@roblourens roblourens changed the title Improve error message for client with no network Improve error message for client without internet access Nov 6, 2020
@bamurtaugh bamurtaugh added the plan-review PM-highlighted item determined to be P1 or P2 label Nov 20, 2020
@funilrys
Copy link

Sorry for bumping, but this is ridiculous.

I had to put the proxies into /etc/wgetrc .... That was unexpected ...
"XHR failed" is not sufficient.

@zimbeo
Copy link

zimbeo commented Dec 22, 2023

Also just dealt with this issue on a machine behind a corporate proxy. XHR failed is not indicative of the cause of the issue - I was able to find the issue by looking at the "Remote - SSH" output of the vscode-server install where wget indicated there was a proxy issue. An error message related to internet connectivity issues would be much more helpful here.

@roblourens
Copy link
Member

I improved the error message here, but it's still a bit generic because it's hard to know why we failed to download the vscode server. If someone has an example of the log output where this happened, I might be able to make it more specific.

@roblourens roblourens added this to the December / January 2024 milestone Dec 30, 2023
@lramos15 lramos15 added the verified Verification succeeded label Jan 24, 2024
@microsoft microsoft locked and limited conversation to collaborators Feb 13, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Issue identified by VS Code Team member as probable bug plan-review PM-highlighted item determined to be P1 or P2 ssh Issue in vscode-remote SSH verified Verification succeeded
Projects
None yet
Development

No branches or pull requests

10 participants