{"record":{"id":"c82116631888f467","repo":"k3s-io/k3s","slug":"nix-store-not-found-in-path-install-nix-https-c82116","errorCode":null,"errorMessage":"nix-store not found in PATH: install nix (https://nixos.org/download) to use the nix snapshotter","messagePattern":"nix-store not found in PATH: install nix \\(https://nixos\\.org/download\\) to use the nix snapshotter","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/containerd/utility_linux.go","lineNumber":29,"sourceCode":"\tstargz \"github.com/containerd/stargz-snapshotter/service\"\n\t\"github.com/pdtpartners/nix-snapshotter/pkg/nix\"\n)\n\nfunc OverlaySupported(root string) error {\n\treturn overlayutils.Supported(root)\n}\n\nfunc FuseoverlayfsSupported(root string) error {\n\treturn fuseoverlayfs.Supported(root)\n}\n\nfunc StargzSupported(root string) error {\n\treturn stargz.Supported(root)\n}\n\nfunc NixSupported(root string) error {\n\tif _, err := exec.LookPath(\"nix-store\"); err != nil {\n\t\treturn errors.New(\"nix-store not found in PATH: install nix (https://nixos.org/download) to use the nix snapshotter\")\n\t}\n\treturn nix.Supported(root)\n}\n","sourceCodeStart":11,"sourceCodeEnd":33,"githubUrl":"https://github.com/k3s-io/k3s/blob/6ba341e396edc16b8dcae978a7c5e3ac7ee5606e/pkg/containerd/utility_linux.go#L11-L33","documentation":"NixSupported probes for the nix snapshotter before enabling it: exec.LookPath('nix-store') fails, so the nix snapshotter cannot be used. The error names the remedy explicitly (install nix).","triggerScenarios":"Containerd configured to use the nix snapshotter (e.g., --snapshotter nix or image-store selection) on a host where nix is not installed or not on the service's PATH.","commonSituations":"Config copied from a NixOS-style setup onto a plain Linux host; nix installed per-user but k3s runs as a systemd service with a minimal PATH; container image missing the nix binary.","solutions":["Install nix (https://nixos.org/download) and confirm `nix-store --version` works from the same environment k3s runs in (systemd service context).","If nix is not actually wanted, switch back to the default snapshotter: restart with --snapshotter overlayfs (or remove the nix image-store config).","For multi-user nix installs, ensure /nix/var/nix/daemon socket is reachable by the k3s service user."],"exampleFix":"# before\nk3s server --snapshotter nix   # nix-store: not found\n# after (either)\nnix-env -iA nixpkgs.nix && k3s server --snapshotter nix\n# or fall back to the default\nk3s server --snapshotter overlayfs","handlingStrategy":"validation","validationCode":"// Check the binary exists before selecting the snapshotter:\nif cfg.Snapshotter == \"nix\" {\n\tif _, err := exec.LookPath(\"nix-store\"); err != nil {\n\t\tlog.Fatalf(\"--snapshotter nix requires nix; install from https://nixos.org/download\")\n\t}\n}","typeGuard":null,"tryCatchPattern":"if err := containerd.NixSupported(root); err != nil {\n\tif strings.Contains(err.Error(), \"nix-store not found in PATH\") {\n\t\tcfg.Snapshotter = \"overlayfs\" // deliberate downgrade, or abort to install nix\n\t}\n}","preventionTips":["Bake nix into node images only on hosts that will actually use the nix snapshotter.","Remember systemd services have minimal PATH; install nix system-wide (multi-user) for k3s.","Default new clusters to overlayfs unless nix semantics are required."],"tags":["k3s","containerd","nix","snapshotter","linux"],"backgroundTag":null,"analyzedSha":"6ba341e396edc16b8dcae978a7c5e3ac7ee5606e","analyzedAt":"2026-08-15T16:27:54.286Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}