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 GUI is hidden if the k3s releases cannot be fetched from GitHub #7853

Closed
jandubois opened this issue Dec 3, 2024 · 7 comments
Milestone

Comments

@jandubois
Copy link
Member

jandubois commented Dec 3, 2024

Update: The missing GUI seems to be due to not being able to fetch k3s releases from GitHub and not due to the version channel not returning useful data.


I've been getting this error many times on Windows. Rancher Desktop doesn't show the GUI at all, but has 4 processes running in the background. The background.log file is completely empty but k8s.log contains this error:

2024-12-03T22:03:06.338Z: Error reading cached version data, discarding: Error: ENOENT: no such file or directory, open 'C:\Users\SUSE\AppData\Local\rancher-desktop\cache\k3s-versions.json'
    at async open (node:internal/fs/promises:639:25)
    at async Object.readFile (node:internal/fs/promises:1249:14)
    at async J.readCache (C:\Program Files\Rancher Desktop\resources\app.asar\dist\app\background.js:2:135370)
    at async C:\Program Files\Rancher Desktop\resources\app.asar\dist\app\background.js:2:140544 {
  errno: -4058,
  code: 'ENOENT',
  syscall: 'open',
  path: 'C:\\Users\\SUSE\\AppData\\Local\\rancher-desktop\\cache\\k3s-versions.json'
}
2024-12-03T22:03:06.786Z: Error reading cached version data, discarding: Error: ENOENT: no such file or directory, open 'C:\Users\SUSE\AppData\Local\rancher-desktop\cache\k3s-versions.json'
    at async open (node:internal/fs/promises:639:25)
    at async Object.readFile (node:internal/fs/promises:1249:14)
    at async J.readCache (C:\Program Files\Rancher Desktop\resources\app.asar\dist\app\background.js:2:135370)
    at async J.updateCache (C:\Program Files\Rancher Desktop\resources\app.asar\dist\app\background.js:2:138506)
    at async C:\Program Files\Rancher Desktop\resources\app.asar\dist\app\background.js:2:140679 {
  errno: -4058,
  code: 'ENOENT',
  syscall: 'open',
  path: 'C:\\Users\\SUSE\\AppData\\Local\\rancher-desktop\\cache\\k3s-versions.json'
}
2024-12-03T22:03:06.787Z: Updating release version cache with 0 items in cache
@mook-as
Copy link
Contributor

mook-as commented Dec 3, 2024

That's fine? It just means you don't have a cache (probably a factory reset or equivalent), so it's just going to download the list of k3s versions off the internet.

@jandubois jandubois added this to the 1.17 milestone Dec 3, 2024
@jandubois
Copy link
Member Author

That's fine?

It is not fine because it does not display any UI at all. The window doesn't show up, and the notification icon is not created either. But the processes are running. The file is never downloaded (I think, maybe rarely it is).

You cannot restart the app because it will immediately exit because it is a second instance.

You can kill the 4 running processes with task-manager, but most likely the same thing is going to happen again.

What works is killing the processes and manually copying the file into the cache directory.

It still is weird though, as the settings file will have Kubernetes enabled, but the version set to the empty string. So once I copy the file into the cache directory, Rancher Desktop picks the lowest available version (1.21.0 or something like it) instead of the current stable version.

Of course this is all secondary, the user should not end up in this situation to begin with, and it is not realistic to expect them to copy the versions file manually.

@mook-as
Copy link
Contributor

mook-as commented Dec 4, 2024

Right, so the fact that the cache is missing is fine. The fact that the app doesn't start up when the cache is missing (or possibly, due to a different issue, depending on what's going on) isn't fine. But as written, the issue just has the (probable) red herring.

jandubois added a commit to jandubois/rancher-desktop that referenced this issue Dec 4, 2024
See rancher-sandbox#7853

You need to copy k3s-versions.json into the BATS directory to
activate the workaround.

Signed-off-by: Jan Dubois <[email protected]>
@jandubois jandubois changed the title Error reading cached version data, discarding: Error: ENOENT: no such file or directory Rancher Desktop GUI is hidden if the k3s-versions.json file cannot be downloaded Dec 4, 2024
@jandubois
Copy link
Member Author

The fact that the app doesn't start up when the cache is missing (or possibly, due to a different issue, depending on what's going on) isn't fine.

Yes, this is what this issue is about, that the GUI does not show up. Likely related to #7461, which may not be working the way it claims it does.

The contents of k8s.log may very well be irrelevant, but the problem is triggered by the file not being available, which is what the error message shows.

A secondary issue might be figuring out why the file does not exist, but that is a situation that can legitimately exist (but I don't think is the case here).

jandubois added a commit to jandubois/rancher-desktop that referenced this issue Dec 4, 2024
See rancher-sandbox#7853

You need to copy k3s-versions.json into the BATS directory to
activate the workaround.

Signed-off-by: Jan Dubois <[email protected]>
@jandubois
Copy link
Member Author

The problem turns out fetching GitHub releases failing due to rate limits:

2024-12-04T22:41:07.766Z: Updating release version cache with 0 items in cache
2024-12-04T22:41:07.998Z: Got K3s update channel data: stable,latest,testing,v1.16,v1.16-testing,v1.17,v1.17-testing,v1.18,v1.18-testing,v1.19,v1.20,v1.21,v1.22,v1.23,v1.24,v1.25,v1.26,v1.27,v1.28,v1.29,v1.30,v1.31
2024-12-04T22:41:07.999Z: Recommended versions: {
  stable: 'v1.30.6+k3s1',
  latest: 'v1.31.2+k3s1',
  testing: 'v1.31.3-rc2+k3s1',
  'v1.16': 'v1.16.15+k3s1',
  'v1.16-testing': 'v1.16.14-rc1+k3s1',
  'v1.17': 'v1.17.17+k3s1',
  'v1.17-testing': 'v1.17.17-rc1+k3s1',
  'v1.18': 'v1.18.20+k3s1',
  'v1.18-testing': 'v1.18.20-rc1+k3s1',
  'v1.19': 'v1.19.16+k3s1',
  'v1.20': 'v1.20.15+k3s1',
  'v1.21': 'v1.21.14+k3s1',
  'v1.22': 'v1.22.17+k3s1',
  'v1.23': 'v1.23.17+k3s1',
  'v1.24': 'v1.24.17+k3s1',
  'v1.25': 'v1.25.16+k3s4',
  'v1.26': 'v1.26.15+k3s1',
  'v1.27': 'v1.27.16+k3s1',
  'v1.28': 'v1.28.15+k3s1',
  'v1.29': 'v1.29.10+k3s1',
  'v1.30': 'v1.30.6+k3s1',
  'v1.31': 'v1.31.2+k3s1'
}
2024-12-04T22:41:08.458Z: Fetching releases from https://api.github.com/repos/k3s-io/k3s/releases?per_page=100 -> rate limit exceeded
2024-12-04T22:41:09.893Z: Fetching releases from https://api.github.com/repos/k3s-io/k3s/releases?per_page=100 -> rate limit exceeded
2024-12-04T22:41:11.385Z: Fetching releases from https://api.github.com/repos/k3s-io/k3s/releases?per_page=100 -> rate limit exceeded
2024-12-04T22:41:12.874Z: Fetching releases from https://api.github.com/repos/k3s-io/k3s/releases?per_page=100 -> rate limit exceeded
2024-12-04T22:41:14.301Z: Fetching releases from https://api.github.com/repos/k3s-io/k3s/releases?per_page=100 -> rate limit exceeded
2024-12-04T22:41:15.749Z: Fetching releases from https://api.github.com/repos/k3s-io/k3s/releases?per_page=100 -> rate limit exceeded
2024-12-04T22:41:17.225Z: Fetching releases from https://api.github.com/repos/k3s-io/k3s/releases?per_page=100 -> rate limit exceeded
2024-12-04T22:41:18.678Z: Fetching releases from https://api.github.com/repos/k3s-io/k3s/releases?per_page=100 -> rate limit exceeded
2024-12-04T22:41:20.130Z: Fetching releases from https://api.github.com/repos/k3s-io/k3s/releases?per_page=100 -> rate limit exceeded

Issue #7877 will bundle k3s-versions.json with the installer, so we don't need to wait to fetch releases etc.

This is remains open and should cover aborting the retries for fetching k3s releases from GitHub: if we get a failure, we just give up and continue with the current list (falling back to the bundled list if the current list has been deleted).

@jandubois jandubois reopened this Dec 5, 2024
@jandubois jandubois modified the milestones: 1.17, 1.18 Dec 5, 2024
@jandubois jandubois changed the title Rancher Desktop GUI is hidden if the k3s-versions.json file cannot be downloaded Rancher Desktop GUI is hidden if the k3s releases cannot be fetched from GitHub Dec 5, 2024
@mook-as
Copy link
Contributor

mook-as commented Dec 9, 2024

If we had a current list, this would never happen (the update would run in the background), so this would not have been an issue. Remember that the cache file had to be deleted first to trigger the issue.

Currently, we can't manage without the version list existing; things just fall over because we assume at least one k3s version is available. (Which is why we block showing the UI until the versions list has been fetched.) #7877 would fix things. But otherwise, we have too much logic depending on some version existing to solve this reasonably.

@jandubois
Copy link
Member Author

#7877 would fix things.

I think we can just close this issue and put #7877 into the next release.

matejkramny pushed a commit to matejkramny/rancher-desktop that referenced this issue Dec 10, 2024
See rancher-sandbox#7853

You need to copy k3s-versions.json into the BATS directory to
activate the workaround.

Signed-off-by: Jan Dubois <[email protected]>
Signed-off-by: Matej Kramny <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants