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

Errors while listing system generations #566

Open
iainvm opened this issue Oct 16, 2024 · 4 comments
Open

Errors while listing system generations #566

iainvm opened this issue Oct 16, 2024 · 4 comments
Labels
question Further information is requested

Comments

@iainvm
Copy link

iainvm commented Oct 16, 2024

Bug description

When running nixos-rebuild list-generations --flake . --json I'm getting errors from the ls command

I think this might be happening because I used WSL2-Linux-Kernel-Rolling to update my kernel to get WSL Memory Reclaiming to work. So the kernel is coming up as unknown, but this is only a guess

To Reproduce

Install updated kernel
Install NixOS WSL
Use flakes for system
Run nixos-rebuild list-generations --flake . --json

Logs

❯ nixos-rebuild list-generations --flake . --json        
ls: cannot access '/nix/store/0jdik0dwkivhfks4wd8hm0gj19ggynbz-nixos-system-potamoi-24.05.20240930.1719f27/lib/modules': No such file or directory
ls: cannot access '/nix/store/q42667alh58552sxiakxdy68hw5lfqpq-nixos-system-potamoi-24.05.20240930.1719f27/lib/modules': No such file or directory
ls: cannot access '/nix/store/dxvf9dn9w5xk6ivfsfdna168qcaq1nci-nixos-system-potamoi-24.05.20240930.1719f27/lib/modules': No such file or directory
ls: cannot access '/nix/store/0k8ywpi39xw1376pacj7mkbx061lfyin-nixos-system-potamoi-24.05.20240930.1719f27/lib/modules': No such file or directory
[
  {
    "generation": 17,
    "date": "2024-10-16T17:33:18Z",
    "nixosVersion": "24.05.20240930.1719f27",
    "kernelVersion": "Unknown",
    "configurationRevision": "",
    "specialisations": [
      "*"
    ],
    "current": true
  },
  ...
]

WSL version

WSL version: 2.3.24.0
Kernel version: 5.15.153.1-2
WSLg version: 1.0.65
MSRDC version: 1.2.5620
Direct3D version: 1.611.1-81528511
DXCore version: 10.0.26100.1-240331-1435.ge-release
Windows version: 10.0.19045.4894
@iainvm iainvm added the bug Something isn't working label Oct 16, 2024
@SuperSandro2000
Copy link
Member

A different kernel shouldn't matter.

You probably deleted the other store paths by accident and some symlinks are dangling. Try updating and the garbage collecting the nix store.

@SuperSandro2000 SuperSandro2000 added question Further information is requested and removed bug Something isn't working labels Oct 19, 2024
@iainvm
Copy link
Author

iainvm commented Oct 22, 2024

As I add more to my config the more of these errors I see when listing the generations, and I'm only executing sudo nixos-rebuild switch --flake . I don't think I've been deleting any files in the /nix/ folder

@nzbr
Copy link
Member

nzbr commented Oct 31, 2024

I am able to reproduce that on my installation. My guess is that nixos-rebuild list-generations tries to look at what kernel modules are included in the generations (probably to determine the kernel version), but fails, because there are no kernel modules on NixOS-WSL because the kernel isn't managed by NixOS

@nzbr
Copy link
Member

nzbr commented Feb 14, 2025

It seems Microsoft just re-introduced support for kernel modules, so this might be fixable with a symlink now

https://github.com/microsoft/WSL2-Linux-Kernel/releases/tag/linux-msft-wsl-6.6.75.1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

3 participants