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

Rancher Desktop won't start and always chooses the Debian WSL distro for some reason #4560

Closed
rdeusser opened this issue Apr 27, 2023 · 7 comments · Fixed by #5642
Closed
Assignees
Labels
kind/bug Something isn't working platform/windows triage/confirmed Issue has been reproduced by dev team
Milestone

Comments

@rdeusser
Copy link

Actual Behavior

I can't get Rancher Desktop to start. I looked in the background.log file and I see this:

2023-04-27T15:45:27.191Z: Stopping background process Win32 socket proxy.
2023-04-27T15:45:28.103Z: Error starting up: Error: C:\WINDOWS\system32\wsl.exe exited with code 1
    at ChildProcess.<anonymous> (C:\Program Files\Rancher Desktop\resources\app.asar\dist\app\background.js:1:8136)
    at ChildProcess.emit (node:events:527:28)
    at ChildProcess._handle.onexit (node:internal/child_process:291:12) {
  stdout: '',
  code: 1,
  command: [
    'C:\\WINDOWS\\system32\\wsl.exe',
    '--distribution',
    'Debian',
    '--exec',
    '/bin/wslpath',
    '-a',
    '-u',
    'C:\\Program Files\\Rancher Desktop\\resources\\resources\\linux\\bin\\docker-compose'
  ]
}

I use the Debian distro for something else so I can't remove it, but I'm unsure what's making Rancher Desktop choose it. Output of wsl --list --verbose is:

  NAME                    STATE           VERSION
* rancher-desktop         Stopped         2
  rancher-desktop-data    Stopped         2
  Debian                  Stopped         2

Steps to Reproduce

Open Rancher Desktop via desktop icon.

Result

No window or tray icon appears.

Expected Behavior

Rancher Desktop should be choosing rancher-desktop or rancher-desktop-data as the distro.

Additional Information

No response

Rancher Desktop Version

1.8.1

Rancher Desktop K8s Version

N/A

Which container engine are you using?

moby (docker cli)

What operating system are you using?

Windows

Operating System / Build Version

Windows 11

What CPU architecture are you using?

x64

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

None

Windows User Only

Not sure any of this matters yet since Rancher Desktop won't even start.

@rdeusser rdeusser added the kind/bug Something isn't working label Apr 27, 2023
@gunamata
Copy link
Contributor

gunamata commented May 4, 2023

It looks similar to #3785

@jandubois , It looks we need to prioritize implementing the try/catch block as you suggested in your comment to gracefully ignore problematic distros.

@gunamata gunamata added platform/windows triage/next-candidate Discuss if it should be moved to "Next" milestone labels May 4, 2023
@gaktive gaktive added triage/need-to-repro Needs to be reproduced by dev team and removed triage/next-candidate Discuss if it should be moved to "Next" milestone labels May 8, 2023
@dpmerrill dpmerrill self-assigned this Jul 24, 2023
@jandubois
Copy link
Member

I can reproduce the problem:

  • Install Debian distro (in addition to Ubuntu)

  • Create an /etc/wsl.conf file to disable automount (probably could do this with %USERPROFILE%\.wslconfig as well, but didn't test this):

    root@rd-w11-test-1:~# cat /etc/wsl.conf
    [automount]
    enabled = false
    
  • Make sure the distro is stopped, so wsl.conf is processed again: wsl -t Debian

  • Verify that automount has been disabled:

    root@rd-w11-test-1:~# wslpath -a -u "C:\\Program Files\\Rancher  Desktop\\resources\\resources\\linux\\bin\\docker-compose"
    wslpath: C:\Program Files\Rancher Desktop\resources\resources\linux\bin\docker-compose: No such file or directory
    
  • Verify that %AppData%\rancher-desktop\settings.json doesn't include Debian in the WSL integrations:

    ...,
    "WSL":{"integrations":{"Ubuntu-22.04":true}},
    ...
  • Try to start Rancher Desktop

No Window will be shown, and background.log will show the wslpath error from the description above.

Required actions

  • No code should be executed inside distros that have not been explicitly marked for WSL integration.

  • The getLinuxToolPath function needs to explicitly check for errors and its callers need to deal with them. Rancher Desktop needs to display an error that WSL integration has failed for this distro (in case the user explicitly requests it to be enabled).

@mook-as
Copy link
Contributor

mook-as commented Aug 22, 2023

No code should be executed inside distros that have not been explicitly marked for WSL integration.

I disagree, sort of: we should unhook any previously done integrations in that case, but silently ignore any failures. (Think of the case where you turn off Ubuntu-22.04 in your example.)

@jandubois
Copy link
Member

we should unhook any previously done integrations in that case, but silently ignore any failures

Yes, agreed. I was wondering how we could have existing integrations when the distro is not listed in settings.json, but I guess running factory-reset could do that.

I guess one could argue that factory-reset should undo integrations too, but that is a bigger can of worms.

@jandubois
Copy link
Member

I guess one could argue that factory-reset should undo integrations too, but that is a bigger can of worms.

Given that the integrations will be cleaned up on each start, deleting them as part of factory-reset is not that important.

However, they don't seem to be removed when you uninstall Rancher Desktop, which seems like a bigger problem: #5380.

@jandubois jandubois added this to the 1.11 milestone Aug 23, 2023
@jandubois jandubois added triage/confirmed Issue has been reproduced by dev team and removed triage/need-to-repro Needs to be reproduced by dev team labels Aug 23, 2023
dpmerrill added a commit to dpmerrill/rancher-desktop that referenced this issue Oct 3, 2023
dpmerrill added a commit to dpmerrill/rancher-desktop that referenced this issue Oct 4, 2023
@jandubois
Copy link
Member

Please verify that any fix for this issue also covers #4966!

@naskoblg
Copy link

I had same issue with fresh install of 1.11, after I was using 0.74 long time ago on the same host.
I was able to start rancher desktop by opening a cmd as Administrator and I have executed rdctl factory-reset
Hope this helps

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Something isn't working platform/windows triage/confirmed Issue has been reproduced by dev team
Projects
None yet
Development

Successfully merging a pull request may close this issue.

8 participants