rancher-sandbox / rancher-desktop

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

Rancher Desktop fails to find cached kubernetes version #5456

Open IsaSih opened 1 year ago

IsaSih commented 1 year ago

Actual Behavior

lima fails to start the application with a combination of experimental settings, as the following:

"experimental": {
    "virtualMachine": {
      "type": "qemu",
      "useRosetta": false,
      "socketVMNet": false,
      "mount": {
        "type": "9p",
        "9p": {
          "securityModel": "mapped-xattr",
          "protocolVersion": "9p2000",
          "msizeInKib": 4,
          "cacheMode": "loose"
        }

Steps to Reproduce

  1. Start Rancher Desktop
  2. Go to Preferences > Virtual Machine > Mount Type
  3. Select a combination of of experimental settings, as the following:
"experimental": {
    "virtualMachine": {
      "type": "qemu",
      "useRosetta": false,
      "socketVMNet": false,
      "mount": {
        "type": "9p",
        "9p": {
          "securityModel": "mapped-xattr",
          "protocolVersion": "9p2000",
          "msizeInKib": 4,
          "cacheMode": "loose"
        }
  1. Hit Apply
  2. Wait for Kubernetes to start

Result

Rancher Desktop fails to start Kubernetes because it looks for the cache directory that does not exist.

Last command run: limactl shell --workdir=. 0 sudo bin/install-k3s v1.27.4+k3s1 /Users/isasih/Library/Caches/rancher-desktop/k3s

Fatal error:

'bin/install-k3s',
    'v1.27.4+k3s1',
    '/Users/isasih/Library/Caches/rancher-desktop/k3s'
  ],
  stdout: 'Directory /Users/isasih/Library/Caches/rancher-desktop/k3s/v1.27.4+k3s1 does not exist\n',
  stderr: '',
  code: 1,
  [Symbol(child-process.command)]: '/Applications/Rancher Desktop.app/Contents/Resources/resources/darwin/lima/bin/limactl shell --workdir=. 0 sudo bin/install-k3s v1.27.4+k3s1 /Users/isasih/Library/Caches/rancher-desktop/k3s'
}

Logs: Archive.zip Archive.zip

Expected Behavior

Rancher Desktop must successfully restart with a combination of any experimental settings that are within the range specified

Additional Information

No response

Rancher Desktop Version

1.9.1-668-gafe9a483

Rancher Desktop K8s Version

1.27.4

Which container engine are you using?

moby (docker cli)

What operating system are you using?

macOS

Operating System / Build Version

macOS Monterey

What CPU architecture are you using?

x64

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

None

Windows User Only

No response

jandubois commented 1 year ago

I can confirm the issue. I don't get an error dialog; Rancher Desktop seems to quit, but I see the error in background.log.

The problem is not that the cache directory doesn't exist, but that the mount isn't working.

I've not tested further, but I suspect that some combinations of 9p mount options don't work/make sense, and we should reject them in validation. Needs a comprehensive set of tests to figure this out.