vscode-remote-release icon indicating copy to clipboard operation
vscode-remote-release copied to clipboard

"Opening Remote..." message persists forever (WSL2)

Open gwillen opened this issue 4 years ago • 13 comments

Version info from about dialog:

Version: 1.53.1 (user setup) Commit: 5d424b828ada08e1eb9f95d6cb41120234ef57c7 Date: 2021-02-08T23:29:42.785Z Electron: 11.2.1 Chrome: 87.0.4280.141 Node.js: 12.18.3 V8: 8.7.220.31-electron.0 OS: Windows_NT x64 10.0.19042

Windows version info:

Edition Windows 10 Pro Version 20H2 Installed on ‎11/‎30/‎2020 OS build 19042.746 Experience Windows Feature Experience Pack 120.2212.551.0

Remote OS Version: WSL2 / Ubuntu-20.04

Steps to Reproduce:

  1. Type "code <directory>" from inside another VS Code Remote WSL terminal window (OR use the "Remote-WSL: New Window" command)
  2. A new VS Code window opens, with "Opening Remote..." in the bottom left corner, and "Starting VS Code in WSL (Ubuntu-20.04): Starting Linux Subsystem" in the bottom right corner. This state persists indefinitely. All my other VS Code Remote WSL windows are fine, and continue to work normally.
  3. In the debug console, I have the following (pasted from saved console log file):
workbench.desktop.main.js:formatted:16514 [Extension Host] rejected promise not handled within 1 second: TypeError: Cannot read property 'length' of undefined
b @ workbench.desktop.main.js:formatted:16514
workbench.desktop.main.js:formatted:16514 [Extension Host] stack trace: TypeError: Cannot read property 'length' of undefined	at c:\Users\gwillen\.vscode\extensions\ms-vscode-remote.remote-wsl-0.53.3\dist\extension.js:1:49294	at c:\Users\gwillen\.vscode\extensions\ms-vscode-remote.remote-wsl-0.53.3\dist\extension.js:1:49585	at c:\Users\gwillen\.vscode\extensions\ms-vscode-remote.remote-wsl-0.53.3\dist\extension.js:1:31006	at c:\Users\gwillen\.vscode\extensions\ms-vscode-remote.remote-wsl-0.53.3\dist\extension.js:1:31220	at Immediate.<anonymous> (c:\Users\gwillen\.vscode\extensions\ms-vscode-remote.remote-wsl-0.53.3\dist\extension.js:1:32778)	at processImmediate (internal/timers.js:456:21)
b @ workbench.desktop.main.js:formatted:16514
workbench.desktop.main.js:formatted:263165 [[object Object]]Cannot read property 'length' of undefined
$onExtensionRuntimeError @ workbench.desktop.main.js:formatted:263165
workbench.desktop.main.js:formatted:263166 TypeError: Cannot read property 'length' of undefined
	at c:\Users\gwillen\.vscode\extensions\ms-vscode-remote.remote-wsl-0.53.3\dist\extension.js:1:49294
	at c:\Users\gwillen\.vscode\extensions\ms-vscode-remote.remote-wsl-0.53.3\dist\extension.js:1:49585
	at c:\Users\gwillen\.vscode\extensions\ms-vscode-remote.remote-wsl-0.53.3\dist\extension.js:1:31006
	at c:\Users\gwillen\.vscode\extensions\ms-vscode-remote.remote-wsl-0.53.3\dist\extension.js:1:31220
	at Immediate.<anonymous> (c:\Users\gwillen\.vscode\extensions\ms-vscode-remote.remote-wsl-0.53.3\dist\extension.js:1:32778)
	at processImmediate (internal/timers.js:456:21)
$onExtensionRuntimeError @ workbench.desktop.main.js:formatted:263166
DevTools failed to load SourceMap: Could not load content for https://ticino.blob.core.windows.net/sourcemaps/5d424b828ada08e1eb9f95d6cb41120234ef57c7/core/vs/workbench/workbench.desktop.main.js.map: Load canceled due to load timeout

In the terminal where VS Code is starting its remote connection, I have the following:

[2021-02-10 01:39:14.711] Resolving wsl+Ubuntu-20.04, resolveAttempt: 1
[2021-02-10 01:39:14.743] Starting VS Code Server inside WSL (Ubuntu-20.04)
[2021-02-10 01:39:14.744] Extension version: 0.53.3, Windows build: 19042. Multi distro support: available. WSL path support: enabled
[2021-02-10 01:39:14.744] No shell environment set or found for current distro.
[2021-02-10 01:39:14.846] Connecting to daemon started by other Remote-WSL window... 5.4.72-microsoft-standard-WSL2 Ubuntu-20.04
[2021-02-10 01:39:14.846] PortResolved: {"host":"172.23.139.149","port":33897,"wslVersion":"5.4.72-microsoft-standard-WSL2 Ubuntu-20.04"}

Trying with different directories, or closing the window and trying again, gives the same result. I don't know if there's some kind of maximum limit to the number of connections I can have to the remote; I tend to work with a lot of windows open at once. (Currently only 4, but it doesn't seem to close connections when I close windows, since reopening a closed workspace seems to get me an intact shell session.)

I see the following processes running as me inside WSL:

gwillen   4887  4886  0 17:33 pts/0    00:00:00 sh -c "$VSCODE_WSL_EXT_LOCATION/scripts/wslServer.sh" 5d424b828ada08e1eb9f95d6cb41120234ef57c7 stable .vscode-server 0
gwillen   4888  4887  0 17:33 pts/0    00:00:00 sh /mnt/c/Users/gwillen/.vscode/extensions/ms-vscode-remote.remote-wsl-0.52.0/scripts/wslServer.sh 5d424b828ada08e1eb9f95d6cb41120234ef57c7 stable .vscode-server 0
gwillen   4913  4888  0 17:33 pts/0    00:00:00 sh /home/gwillen/.vscode-server/bin/5d424b828ada08e1eb9f95d6cb41120234ef57c7/server.sh  --port=0 --use-host-proxy --enable-remote-auto-shutdown --print-ip-address
gwillen   4915  4913  0 17:33 pts/0    00:00:11 /home/gwillen/.vscode-server/bin/5d424b828ada08e1eb9f95d6cb41120234ef57c7/node /home/gwillen/.vscode-server/bin/5d424b828ada08e1eb9f95d6cb41120234ef57c7/out/vs/server/main.js  --port=0 --use-host-proxy --enable-remote-auto-shutdown --print-ip-address
gwillen   4954  4915  0 17:33 pts/0    00:00:02 /home/gwillen/.vscode-server/bin/5d424b828ada08e1eb9f95d6cb41120234ef57c7/node /home/gwillen/.vscode-server/bin/5d424b828ada08e1eb9f95d6cb41120234ef57c7/out/bootstrap-fork --type=extensionHost --uriTransformerPath=/home/gwillen/.vscode-server/bin/5d424b828ada08e1eb9f95d6cb41120234ef57c7/out/vs/server/uriTransformer.js --useHostProxy=
gwillen   4979  4915  0 17:33 pts/0    00:00:05 /home/gwillen/.vscode-server/bin/5d424b828ada08e1eb9f95d6cb41120234ef57c7/node /home/gwillen/.vscode-server/bin/5d424b828ada08e1eb9f95d6cb41120234ef57c7/out/bootstrap-fork --type=extensionHost --uriTransformerPath=/home/gwillen/.vscode-server/bin/5d424b828ada08e1eb9f95d6cb41120234ef57c7/out/vs/server/uriTransformer.js --useHostProxy=
gwillen   4990  4915  0 17:33 pts/0    00:00:00 /home/gwillen/.vscode-server/bin/5d424b828ada08e1eb9f95d6cb41120234ef57c7/node /home/gwillen/.vscode-server/bin/5d424b828ada08e1eb9f95d6cb41120234ef57c7/out/bootstrap-fork --type=watcherService
gwillen   5027  4915  0 17:33 pts/0    00:00:01 /home/gwillen/.vscode-server/bin/5d424b828ada08e1eb9f95d6cb41120234ef57c7/node /home/gwillen/.vscode-server/bin/5d424b828ada08e1eb9f95d6cb41120234ef57c7/out/bootstrap-fork --type=watcherService
gwillen   5045  4915  0 17:33 pts/1    00:00:00 /bin/bash
gwillen   5054  4915  0 17:33 pts/2    00:00:00 /bin/bash
gwillen   5065  4915  0 17:33 pts/3    00:00:00 /bin/bash
gwillen   5133  4954  0 17:33 pts/0    00:00:01 /home/gwillen/.vscode-server/extensions/ms-vscode.cpptools-1.2.0/bin/cpptools
gwillen   5203  4954  0 17:33 pts/0    00:00:00 /home/gwillen/.vscode-server/bin/5d424b828ada08e1eb9f95d6cb41120234ef57c7/node /home/gwillen/.vscode-server/bin/5d424b828ada08e1eb9f95d6cb41120234ef57c7/extensions/json-language-features/server/dist/node/jsonServerMain --node-ipc --clientProcessId=4954
gwillen   5251  5133  0 17:33 pts/0    00:00:00 /home/gwillen/.vscode-server/extensions/ms-vscode.cpptools-1.2.0/bin/cpptools-srv 5133 {CB2D4F11-E8EE-42D3-AFF5-A9467E584925}
gwillen   5313  4979  0 17:33 pts/0    00:00:00 /usr/bin/python3 /home/gwillen/.vscode-server/extensions/ms-python.python-2021.1.502429796/pythonFiles/pyvsc-run-isolated.py /home/gwillen/.vscode-server/extensions/ms-python.python-2021.1.502429796/pythonFiles/completion.py
gwillen   5315  5313  0 17:33 pts/0    00:00:00 /usr/bin/python3 /home/gwillen/.vscode-server/extensions/ms-python.python-2021.1.502429796/pythonFiles/lib/python/jedi/inference/compiled/subprocess/__main__.py /home/gwillen/.vscode-server/extensions/ms-python.python-2021.1.502429796/pythonFiles/lib/python 3.8.5
gwillen   5323  4915  0 17:34 pts/4    00:00:00 /bin/bash

Does this issue occur when you try this locally?: N/A Does this issue occur when you try this locally and all extensions are disabled?: N/A

gwillen avatar Feb 10 '21 01:02 gwillen

(Argh, somehow I accidentally created the issue halfway through typing the title. Please stand by while I fill in the details.)

gwillen avatar Feb 10 '21 01:02 gwillen

After completely exiting and restarting VS Code, the problem has resolved, so I don't have a way to reproduce it on command. I will not be offended if it gets closed as a one-off (I can always reopen if I find a way to reproduce.) But I'm hoping that maybe I gave enough detail for someone to identify the issue.

gwillen avatar Feb 10 '21 02:02 gwillen

@gwillen Thank you! I caught the same problem and your comment saved me.

fumiyakk avatar Feb 11 '21 02:02 fumiyakk

Thanks for reporting and for the detailed writeup @gwillen. Since it sounds like restarting VS Code has resolved the issue, I'm going to close this as you mentioned, but if you are able to repro or if more folks start running into this, please let us know, and I'd be happy to reopen/discuss further.

bamurtaugh avatar Feb 23 '21 23:02 bamurtaugh

Reopening for @paulcoffee85 comment: https://github.com/microsoft/vscode-remote-release/issues/7990#issue-1573720321.

@paulcoffee85 can you please provide more information so that we can try to repro, like what steps you took and exactly what you're seeing? Thanks!

bamurtaugh avatar Feb 07 '23 19:02 bamurtaugh

I had this problem after running a windows repair program.

Got it fixed by:

  1. Go to "Turn Windows features on or off"
  2. Disable Virtual Machine Platform (got an error the frist time but then it was fine)
  3. Restart
  4. Enable the feature and restart again

Hope it helps someone.

nesumneno avatar Feb 12 '23 09:02 nesumneno

I had this problem after running a windows repair program.

Got it fixed by:

  1. Go to "Turn Windows features on or off"
  2. Disable Virtual Machine Platform (got an error the frist time but then it was fine)
  3. Restart
  4. Enable the feature and restart again

Hope it helps someone.

I had the same problem and had tried many methods. This one is the first one that worked. Thanks! Other methods included (1) updating the wsl-remote extension on VSCode on Windows, (2) removing the wsl server on a wsl terminal. I am only mentioning them for completeness, in case someone finds a use for them.

lydietoure avatar Feb 24 '23 18:02 lydietoure

This BUG is a year old now and costing Microsoft reputation Billions. The root of the problem is Docker Desktop starting forever ... it needs to run first but be installed last. Fragile like Jelly in a Frying pan. That BAD! Docker Desktop stability sync with WSL with WSL integration ... more like NON-integration, is so BAAAAAD! After WSL, Docker Desktop is the worlds buggiest FUGGY WUGGY BUG SOFTWARE on the planet!
The root cause of that is using .NET instead of ordinary C++. So the root cause is simply .NET use.

KonanTheLibrarian avatar Feb 27 '23 09:02 KonanTheLibrarian

I started facing this issue recently. I've no idea what caused it. VS Code works fine for files found locally on Windows but not for files on WSL.

How to reproduce error

  1. Open new Window on VS Code.
  2. Open a remote Window and choose either option Connect to WSL or Connect to WSL distro.

bug GIF

Sample WSL log

If I keep waiting, the connection never succeeds and the terminal becomes :

[2023-04-14 05:42:01.338] Resolving wsl+Ubuntu, resolveAttempt: 1
[2023-04-14 05:42:01.574] Starting VS Code Server inside WSL (wsl2)
[2023-04-14 05:42:01.574] Extension version: 0.77.0
[2023-04-14 05:42:01.574] Windows build: 19045. Multi distro support: available. WSL path support: enabled
[2023-04-14 05:42:01.574] No shell environment set or found for current distro.
[2023-04-14 05:42:02.029] WSL daemon log file: 
[2023-04-14 05:42:02.034] Probing if server is already installed: C:\WINDOWS\System32\wsl.exe -d Ubuntu -e sh -c "if [ -d ~/.vscode-server/bin/704ed70d4fd1c6bd6342c436f1ede30d1cff4710 ]; then printf 'install-found '; fi; if [ -f /etc/alpine-release ]; then printf alpine-; fi; uname -m"
[2023-04-14 05:42:09.920] Probing result: install-found x86_64
[2023-04-14 05:42:09.922] Server install found in WSL
[2023-04-14 05:42:09.924] Launching C:\WINDOWS\System32\wsl.exe -d Ubuntu sh -c '"$VSCODE_WSL_EXT_LOCATION/scripts/wslServer.sh" 704ed70d4fd1c6bd6342c436f1ede30d1cff4710 stable code-server .vscode-server --host=127.0.0.1 --port=0 --connection-token=4157027954-1722786015-626084263-2266722464 --use-host-proxy --without-browser-env-var --disable-websocket-compression --accept-server-license-terms --telemetry-level=all'
[2023-04-14 05:42:10.554] Setting up server environment: Looking for /home/mcl/.vscode-server/server-env-setup. Not found.
[2023-04-14 05:42:10.554] WSL version: 5.15.90.1-microsoft-standard-WSL2 Ubuntu
[2023-04-14 05:42:10.554] WSL-shell-PID: 14
[2023-04-14 05:42:10.554] Node executable: /home/mcl/.vscode-server/bin/704ed70d4fd1c6bd6342c436f1ede30d1cff4710/node
[2023-04-14 05:42:10.554] Starting server: /home/mcl/.vscode-server/bin/704ed70d4fd1c6bd6342c436f1ede30d1cff4710/bin/code-server --host=127.0.0.1 --port=0 --connection-token=4157027954-1722786015-626084263-2266722464 --use-host-proxy --without-browser-env-var --disable-websocket-compression --accept-server-license-terms --telemetry-level=all
[2023-04-14 05:42:11.174] *
[2023-04-14 05:42:11.174] * Visual Studio Code Server
[2023-04-14 05:42:11.174] *
[2023-04-14 05:42:11.174] * By using the software, you agree to
[2023-04-14 05:42:11.174] * the Visual Studio Code Server License Terms (https://aka.ms/vscode-server-license) and
[2023-04-14 05:42:11.174] * the Microsoft Privacy Statement (https://privacy.microsoft.com/en-US/privacystatement).
[2023-04-14 05:42:11.174] *
[2023-04-14 05:42:11.174] Server bound to 127.0.0.1:36645 (IPv4)
[2023-04-14 05:42:11.174] Extension host agent listening on 36645
[2023-04-14 05:42:11.174] 
[2023-04-14 05:42:11.200] Started local proxy server on 63831.
[2023-04-14 05:42:11.200] WSL resolver response: 127.0.0.1:63831
[2023-04-14 05:42:11.200] To debug connection issues, open a local browser on http://127.0.0.1:63831/version
[2023-04-14 05:46:11.356] Resolving wsl+Ubuntu, resolveAttempt: 2
[2023-04-14 05:46:11.356] Returning resolved promise.
[2023-04-14 05:50:11.444] Resolving wsl+Ubuntu, resolveAttempt: 3
[2023-04-14 05:50:11.444] Returning resolved promise.
[2023-04-14 05:54:11.499] Resolving wsl+Ubuntu, resolveAttempt: 4
[2023-04-14 05:54:11.499] Returning resolved promise.

Versions

I am using WSL2 with Ubuntu 20.04.5 LTS on Windows 10 Pro. The WSL extension has version v0.77.0.

VS Code version
Version: 1.77.3 (user setup)
Commit: 704ed70d4fd1c6bd6342c436f1ede30d1cff4710
Date: 2023-04-12T09:16:02.548Z
Electron: 19.1.11
Chromium: 102.0.5005.196
Node.js: 16.14.2
V8: 10.2.154.26-electron.0
OS: Windows_NT x64 10.0.19045
Sandboxed: Yes

What I tried

  • Restarting VS Code and computer.
  • As per the instructions in the sample WSL log, I opened a local browser at http://127.0.0.1:63831/version but nothing shows up.
  • Using wsl --shutdown on PowerShell.
  • Ensuring that VS Code and WSL extension is updated to the latest version.
  • Uninstalling then re-installing WSL extension.
  • Using an older version of the WSL extension.
  • Disabling all extensions except WSL extension.

How I fixed the issue

I followed the instructions from this issue #4219. Basically, I simply had to get rid of the .vscode-server folder and then restart VS Code.

creme332 avatar Apr 14 '23 06:04 creme332

I had this problem after running a windows repair program.

Got it fixed by:

  1. Go to "Turn Windows features on or off"
  2. Disable Virtual Machine Platform (got an error the frist time but then it was fine)
  3. Restart
  4. Enable the feature and restart again

Hope it helps someone.

Fixed for me! Thank you a lot!!!

Danielgomesp avatar Jul 07 '23 12:07 Danielgomesp

This is now happening to me as well.

  • rm -fr ~/.vscode-server in WSL and starting VSCode again does not help.
  • rm -fr ~/.vscode-server in WSL and rebooting Windows fixes the issue for me.
  • I recently started putting Windows to sleep instead of turning it completely off. This roughly coincidences when I started experiencing WSL connect issues

tksuoran avatar Aug 06 '23 16:08 tksuoran

  • rm -fr ~/.vscode-server in WSL and rebooting Windows fixes the issue for me.

Thank you! This worked for me as well.

mhhollomon avatar Sep 20 '23 13:09 mhhollomon

I'm getting this issue as well. Rebooting doesn't help. Downgrading Visual Studio Code also doesn't help.

In my case, Docker isn't installed (I see it mentioned in a previous comment)

I also see Virtual Machine Platform was mentioned. How is disabling it supposed to help?

Is there any additional information I can provide to help troubleshoot this?

IAmHopp avatar Feb 06 '24 17:02 IAmHopp

I encountered this issue today and restarting vs code did help. I actually used task manager to kill vs code. The moment I hit "end task", I noticed one WSL window had a dialog. I don't have a screenshot of the dialog, but I'm pretty sure it is the one after this dialog times out. You will see 3 button like reconnect, close, or something. I suspect that window is taking the priority to reconnect, but it's waiting for user input, so the whole connection to WSL is clogged. All others are basically queued.

tautomer avatar Feb 27 '24 09:02 tautomer

This is now happening to me as well.

  • rm -fr ~/.vscode-server in WSL and starting VSCode again does not help.
  • rm -fr ~/.vscode-server in WSL and rebooting Windows fixes the issue for me.
  • I recently started putting Windows to sleep instead of turning it completely off. This roughly coincidences when I started experiencing WSL connect issues

This help me out, it tortured me for days, thank you.

emVisible avatar Mar 25 '24 07:03 emVisible

For me, it’s:

  1. Remove vscode-server in your distro.
  2. Exit your distro.
  3. Run wsl --shutdown on windows terminal

Then, open VSCode.

kalion avatar Jul 19 '24 20:07 kalion