{"record":{"id":"34ad33ec8637033a","repo":"k3s-io/k3s","slug":"nix-store-not-found-in-path-install-nix-https","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":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/agent/containerd/config_linux.go","lineNumber":140,"sourceCode":"\n\treturn containerd.New(addr)\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":122,"sourceCodeEnd":144,"githubUrl":"https://github.com/k3s-io/k3s/blob/6ba341e396edc16b8dcae978a7c5e3ac7ee5606e/pkg/agent/containerd/config_linux.go#L122-L144","documentation":"Returned by NixSupported() when the nix snapshotter is requested but the nix-store binary is not on PATH. k3s supports multiple containerd snapshotters (fuseoverlayfs, stargz, nix); the nix one shells out to nix-store, so k3s probes for the executable with exec.LookPath before delegating to nix.Supported(root). The error is a hard prerequisite failure, not a runtime snapshotter error.","triggerScenarios":"Starting the agent with --snapshotter=nix (or a config enabling the nix snapshotter) on a host where nix-store is not installed or not in the service's PATH; running k3s as a systemd service whose PATH does not include /nix/var/nix/profiles/default/bin or the profile where nix is installed.","commonSituations":"Nix installed per-user (via nix-env) so root/systemd cannot see nix-store; single-user nix installation not linked into the global PATH; container images that enable the nix snapshotter without installing nix.","solutions":["Install nix (https://nixos.org/download) on the node and confirm `nix-store --version` works for the same user/context k3s runs as","If nix is installed but not found, add its bin dir to PATH for the k3s systemd unit (e.g. Environment=PATH=/nix/var/nix/profiles/default/bin:/usr/bin:... ) and `systemctl daemon-reload`","If you did not intend to use nix, drop --snapshotter=nix and use the default snapshotter"],"exampleFix":"# before\nk3s agent --snapshotter=nix ...\n# -> nix-store not found in PATH\n\n# after (install nix, then)\nnix-store --version\nk3s agent --snapshotter=nix ...","handlingStrategy":"validation","validationCode":"if nodeConfig.Snapshotter == \"nix\" {\n    if _, err := exec.LookPath(\"nix-store\"); err != nil {\n        return fmt.Errorf(\"cannot use nix snapshotter: install nix first (https://nixos.org/download)\")\n    }\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Provision nodes with nix installed system-wide before selecting the nix snapshotter","For systemd deployments, extend the unit PATH to include /nix/var/nix/profiles/default/bin","Add a preflight `command -v nix-store` gate in node bootstrap scripts"],"tags":["containerd","snapshotter","nix","environment","path"],"backgroundTag":null,"analyzedSha":"6ba341e396edc16b8dcae978a7c5e3ac7ee5606e","analyzedAt":"2026-08-15T16:27:54.286Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}