rancher-sandbox / rancher-desktop

Container Management and Kubernetes on the Desktop
https://rancherdesktop.io
Apache License 2.0
5.8k stars 272 forks source link

Rancher desktop locks Windows Terminal Preview when starting #1489

Open giggio opened 2 years ago

giggio commented 2 years ago

Rancher Desktop Version

1.23.3

Rancher Desktop K8s Version

1.0.1

Which container runtime are you using?

moby (docker cli)

What operating system are you using?

Windows

Operating System / Build Version

Microsoft Windows [Version 10.0.22000.469]

What CPU architecture are you using?

x64

Linux only: what package format did you use to install Rancher Desktop?

No response

Windows User Only

No.

Actual Behavior

Rancher desktop crashed on start.

Steps to Reproduce

  1. Open Windows Terminal Preview
  2. Open a WSL distro in Windows Terminal Preview
  3. Run Rancher desktop

Result

Both apps lock up:

image

Force closing Windows Terminal Preview also crashes Rancher with this error:


Kubernetes Error
Error Starting Kubernetes
Error: wsl.exe exited with code 1
Last command run:
wsl --distribution rancher-desktop --exec /usr/local/bin/wsl-service k3s start

Context:
Starting WSL environment

Some recent logfile lines:
2022-02-03T23:23:21.113Z: Running command wsl --distribution rancher-desktop --exec cp /mnt/c/Users/user/AppData/Local/Temp/rd-buildkitd-FvNQQr/buildkitd /etc/conf.d/buildkitd...
2022-02-03T23:23:21.175Z: Running command wsl --distribution rancher-desktop --exec chmod 644 /etc/conf.d/buildkitd...
2022-02-03T23:23:21.240Z: Running command wsl --distribution rancher-desktop --exec wslpath -a -u C:\Users\user\AppData\Local\rancher-desktop\logs...
2022-02-03T23:23:21.301Z: Running command wsl --distribution rancher-desktop --exec wslpath -a -u C:\Users\user\AppData\Local\Temp\rd-k3s-F8NJIO\k3s...
2022-02-03T23:23:21.362Z: Running command wsl --distribution rancher-desktop --exec cp /mnt/c/Users/user/AppData/Local/Temp/rd-k3s-F8NJIO/k3s /etc/conf.d/k3s...
2022-02-03T23:23:21.424Z: Running command wsl --distribution rancher-desktop --exec chmod 644 /etc/conf.d/k3s...
2022-02-03T23:23:21.484Z: Running command wsl --distribution rancher-desktop --exec /sbin/rc-update --update...
2022-02-03T23:23:21.576Z: Running command wsl --distribution rancher-desktop --exec /usr/local/bin/wsl-service k3s start...
2022-02-03T23:23:21.637Z: WSL: executing: /usr/local/bin/wsl-service k3s start: Error: wsl.exe exited with code 1

Expected Behavior

Rancher starts normally.

Additional Information

This bug is intermitent. It only happens every other Rancher start. Sometimes it starts fine, other it crashes Windows Terminal.

This is Windows 11, and Windows Terminal Preview is the default terminal:

image

What I believe is happening is that Rancher is running several scripts in a visible way, and they get to open on Windows Terminal. I notice that Windows Terminal gets focus several times during Rancher desktop launch, and a tab opens and disappears very fast.

For some reason this is making Windows Terminal crash.

Also, Rancher desktop does not finish starting when this happens.

I tried changing the default terminal to the Windows console host, and the error does not happen anymore. I started Rancher desktop several times and could not see it anymore.

image

Once I changed back, the behavior happened again. It is definitely the fact that Windows Terminal is the default terminal that is leading to this.

The problem does not happen with Windows Terminal, only with the preview, which is release a month sooner. I just updated mine today with a recent version, it is version 1.13.10336.0.

ericpromislow commented 2 years ago

How exactly do you launch Rancher Desktop?

stefanfritsch commented 2 years ago

You can change the title back, this also happens to me on a release version of Windows Terminal (1.12.10334.0).

I've installed Rancher Desktop with winget, then I open it from the start menu. It tries to install kubernetes (dockerd, v1.22) but if the default console host is Terminal then it hangs indefinitely. Switching to the Console Host solves the problem.

giggio commented 2 years ago

I launch it from the Windows Start Screen or from Windows Power Toys Run.