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

WSL2 Slow Ring ECONNREFUSED #1841

Closed
bushidocodes opened this issue Nov 13, 2019 · 13 comments
Closed

WSL2 Slow Ring ECONNREFUSED #1841

bushidocodes opened this issue Nov 13, 2019 · 13 comments
Labels
upstream Issue identified as 'upstream' component related (exists outside of VS Code Remote) wsl Issue in vscode-remote WSL

Comments

@bushidocodes
Copy link

  • VSCode Version: 1.40.0
  • Local OS Version: Build 19013.vb_release.191025-1609
  • Remote OS Version:
  • Remote Extension/Connection Type: WSL

Steps to Reproduce:

  1. Start System
  2. Launch VSCode from active WSL Terminal via code .
  3. VSCode errors out

image

[2019-11-13 12:43:09.344] [renderer1] [error] [remote-connection][ExtensionHost][ea027…][initial][::1:38773] socketFactory.connect() failed. Error:
[2019-11-13 12:43:09.345] [renderer1] [error] Error: connect ECONNREFUSED ::1:38773
at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1054:14)
[2019-11-13 12:43:09.345] [renderer1] [error] [remote-connection] An error occurred in the very first connect attempt, it will be treated as a permanent error! Error:
[2019-11-13 12:43:09.346] [renderer1] [error] Error: connect ECONNREFUSED ::1:38773
at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1054:14)
[2019-11-13 12:43:09.371] [renderer1] [error] [remote-connection][Management ][fd6d0…][initial][::1:38773] socketFactory.connect() failed. Error:
[2019-11-13 12:43:09.371] [renderer1] [error] Error: connect ECONNREFUSED ::1:38773
at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1054:14)
[2019-11-13 12:43:09.372] [renderer1] [error] [remote-connection] An error occurred in the very first connect attempt, it will be treated as a permanent error! Error:
[2019-11-13 12:43:09.372] [renderer1] [error] Error: connect ECONNREFUSED ::1:38773
at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1054:14)
[2019-11-13 12:43:09.623] [renderer1] [error] connect ECONNREFUSED ::1:38773: Error: connect ECONNREFUSED ::1:38773
at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1054:14)
[2019-11-13 12:43:10.763] [renderer1] [error] Could not fetch environment: Error: Could not fetch environment

Does this issue occur when you try this locally?: Yes
Does this issue occur when you try this locally and all extensions are disabled?: n/a

@rauvolaj
Copy link

rauvolaj commented Nov 14, 2019

UPDATE: Moved to fast ring release of windows and problem is gone. Confirms its a WSL2 issue in slow ring??

I was able to use this extension after updating windows (to slow ring yesterday), but after I updated VS code and restarted PC this error started to occur.

Extra Info:
I was running WSL2 in fast ring and code v1.40 with no issues. I've also noticed that if I launch a server in WSL2 now, I can't connect to it via localhost unless im in the WSL command prompt. So this may be a WSL issue and not code.

Steps to reproduce:

Open VS Code
Run -> Remote-WSL: New Window

Build:

Version: 1.40.1 (user setup)
Commit: 8795a9889db74563ddd43eb0a897a2384129a619
Date: 2019-11-13T16:49:35.976Z
Electron: 6.1.2
Chrome: 76.0.3809.146
Node.js: 12.4.0
V8: 7.6.303.31-electron.0
OS: Windows_NT x64 10.0.19013

Error Log:

[2019-11-14 08:12:29.291] [renderer1] [error] [remote-connection][ExtensionHost][3cae2…][initial][::1:40111] socketFactory.connect() failed. Error:
[2019-11-14 08:12:29.292] [renderer1] [error] Error: connect ECONNREFUSED ::1:40111
at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1054:14)
[2019-11-14 08:12:29.292] [renderer1] [error] [remote-connection] An error occurred in the very first connect attempt, it will be treated as a permanent error! Error:
[2019-11-14 08:12:29.292] [renderer1] [error] Error: connect ECONNREFUSED ::1:40111
at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1054:14)
[2019-11-14 08:12:29.292] [renderer1] [error] [remote-connection][Management ][abf8d…][initial][::1:40111] socketFactory.connect() failed. Error:
[2019-11-14 08:12:29.292] [renderer1] [error] Error: connect ECONNREFUSED ::1:40111
at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1054:14)
[2019-11-14 08:12:29.292] [renderer1] [error] [remote-connection] An error occurred in the very first connect attempt, it will be treated as a permanent error! Error:
[2019-11-14 08:12:29.293] [renderer1] [error] Error: connect ECONNREFUSED ::1:40111
at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1054:14)
[2019-11-14 08:12:29.393] [renderer1] [error] connect ECONNREFUSED ::1:40111: Error: connect ECONNREFUSED ::1:40111
at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1054:14)
[2019-11-14 08:14:32.705] [renderer1] [error] Could not fetch environment: Error: Could not fetch environment

@bushidocodes
Copy link
Author

The error is sporadic and seemingly non-deterministic for me. I've hit this issue twice, but I've been able to restart my system and things have then worked as expected for the session.

@aeschli
Copy link
Contributor

aeschli commented Nov 15, 2019

What does the WSL log show? (Use Remote-WSL: Show Log)

@aeschli aeschli added the wsl Issue in vscode-remote WSL label Nov 15, 2019
@bushidocodes
Copy link
Author

When I ran the Remote-WSL command, I received the following:

[2019-11-17 14:17:15.410] Starting VS Code Server inside WSL (ubuntu-18.04)
[2019-11-17 14:17:15.410] Extension version: 0.40.3, Windows build: 19018. Multi distro support: enabled. WSL path support: enabled
[2019-11-17 14:17:15.581] Probing if server is already installed: C:\WINDOWS\System32\wsl.exe -d ubuntu-18.04 -e sh -c "[ -d ~/.vscode-server/bin/8795a9889db74563ddd43eb0a897a2384129a619 ] && printf found || ([ -f /etc/alpine-release ] && printf alpine-; uname -m)"
[2019-11-17 14:17:15.716] Probing result: found
[2019-11-17 14:17:15.716] Server install found in WSL
[2019-11-17 14:17:15.716] Launching C:\WINDOWS\System32\wsl.exe -d ubuntu-18.04 sh -c '"$VSCODE_WSL_EXT_LOCATION/scripts/wslServer.sh" 8795a9889db74563ddd43eb0a897a2384129a619 stable .vscode-server 0  ' in c:\Users\Sean\.vscode\extensions\ms-vscode-remote.remote-wsl-0.40.3
[2019-11-17 14:17:15.879] Setting up server environment: Looking for /home/sean/.vscode-server/server-env-setup. Not found.
[2019-11-17 14:17:15.879] WSL version: 4.19.79-microsoft-standard Ubuntu-18.04
[2019-11-17 14:17:15.879] Starting server: /home/sean/.vscode-server/bin/8795a9889db74563ddd43eb0a897a2384129a619/server.sh  --port=0 --enable-remote-auto-shutdown 
[2019-11-17 14:17:16.496] 
[2019-11-17 14:17:16.496] 
[2019-11-17 14:17:16.496] *
[2019-11-17 14:17:16.496] * Visual Studio Code Server
[2019-11-17 14:17:16.496] *
[2019-11-17 14:17:16.496] * Reminder: You may only use this software with Visual Studio family products,
[2019-11-17 14:17:16.496] * as described in the license https://aka.ms/vscode-remote/license
[2019-11-17 14:17:16.496] *
[2019-11-17 14:17:16.496] 
[2019-11-17 14:17:16.496] 
[2019-11-17 14:17:16.496] IP Address: 172.30.13.17
[2019-11-17 14:17:16.496] Extension host agent listening on 46595
[2019-11-17 14:17:16.496] 
[2019-11-17 14:17:16.496] 
[2019-11-17 14:17:16.496] [09:17:16] Extension host agent started.
[2019-11-17 14:17:16.497] WSL resolver response: ::1:46595
[2019-11-17 14:17:16.497] To debug connection issues, open a local browser on http://[::1]:46595/version

It looks like the resolver is a bit confused, as the URL it asks me to go to is incorrect. If I replace [::1] with the IP logged a few lines above http://172.30.13.17:46595/version, then I get to a page with the following string:

8795a9889db74563ddd43eb0a897a2384129a619

This seems to match the value passed to wsl.exe in

Launching C:\WINDOWS\System32\wsl.exe -d ubuntu-18.04 sh -c '"$VSCODE_WSL_EXT_LOCATION/scripts/wslServer.sh" 8795a9889db74563ddd43eb0a897a2384129a619 stable .vscode-server 0  ' in c:\Users\Sean\.vscode\extensions\ms-vscode-remote.remote-wsl-0.40.3

@aeschli
Copy link
Contributor

aeschli commented Nov 18, 2019

[::1] is the IP-V6 representation of localhost. Some month ago WSL2 added the feature that you can use localhost on the host to connect to ports in WSL2 (https://docs.microsoft.com/en-us/windows/wsl/release-notes#build-18945)
Did you try opening http://[::1]:46595/version in a browser?

It's likely a WSL issue. If you see this again, can you file it against WSL? https://github.com/microsoft/WSL/blob/master/CONTRIBUTING.md#9-networking-logs describes how to collect more useful information.

@bushidocodes
Copy link
Author

Danke Martin! I believe the IPv6 address didn't resolve in the browser, so likely a networking bug as you mention. I'll try to recreate this and file this through feedback hub. Is there a way to pull a URL for the issue I open in feedback hub to cross-post here so others can track this?

@rauvolaj
Copy link

The error is sporadic and seemingly non-deterministic for me. I've hit this issue twice, but I've been able to restart my system and things have then worked as expected for the session.

After a few days of using the Fast ring I can verify that this is the case as well. So its not just limited to the slow ring, but is also an issue in the current fast ring. I will also post any future related problems to WSL issues.

@bushidocodes
Copy link
Author

Here is the issue I posted in the WSL repo. microsoft/WSL#4693
I am going to collect logs as suggested above and associate them with the issue I just opened.

@aeschli
Copy link
Contributor

aeschli commented Nov 29, 2019

Thanks. Closing as upstream.
If more users see this, I can look into a setting where you can control that we rather use the VM ip. But that also caused problems for some users, that's why I went on to use localhost, which is the proper way according to the WSL guys.

@aeschli aeschli closed this as completed Nov 29, 2019
@aeschli aeschli added the upstream Issue identified as 'upstream' component related (exists outside of VS Code Remote) label Nov 29, 2019
@TolganLight
Copy link

@ianovski
Copy link

Hello, I'm new to WSL2 and am experiencing this issue intermittently. A restart seems to resolve it temporarily but it's a bit of a hassle. I'm in Fast ring, on OS build 19536.10.

@aeschli
Copy link
Contributor

aeschli commented Dec 31, 2019

dup of #2037

@aeschli
Copy link
Contributor

aeschli commented Dec 31, 2019

For OS build 19536 we have #2060.

@vscodebot vscodebot bot locked and limited conversation to collaborators Jan 14, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
upstream Issue identified as 'upstream' component related (exists outside of VS Code Remote) wsl Issue in vscode-remote WSL
Projects
None yet
Development

No branches or pull requests

5 participants