Steps to Reproduce:
code .
[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
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
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.
What does the WSL log show? (Use Remote-WSL: Show Log)
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
[::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.
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?
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.
Here is the issue I posted in the WSL repo. https://github.com/microsoft/WSL/issues/4693
I am going to collect logs as suggested above and associate them with the issue I just opened.
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.
Experiencing this also: https://github.com/microsoft/vscode/issues/87549
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.
For OS build 19536 we have #2060.
Most helpful comment
Here is the issue I posted in the WSL repo. https://github.com/microsoft/WSL/issues/4693
I am going to collect logs as suggested above and associate them with the issue I just opened.