{"record":{"id":"a7e73173a9dba4a3","repo":"k3s-io/k3s","slug":"default-runtime-s-was-not-found","errorCode":null,"errorMessage":"default runtime %s was not found","messagePattern":"default runtime (.+?) was not found","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/agent/containerd/config_linux.go","lineNumber":83,"sourceCode":"\tif disableCgroup {\n\t\tlogrus.Warn(\"cgroup v2 controllers are not delegated for rootless. Disabling cgroup.\")\n\t} else {\n\t\t// note: this mutatation of the passed agent.Config is later used to set the\n\t\t// kubelet's cgroup-driver flag. This may merit moving to somewhere else in order\n\t\t// to avoid mutating the configuration while setting up containerd.\n\t\tcfg.AgentConfig.Systemd = !isRunningInUserNS && controllers[\"cpuset\"] && os.Getenv(\"INVOCATION_ID\") != \"\"\n\t}\n\n\t// set the path to include the default runtimes and remove the aditional path entries\n\t// that we added after finding the runtimes\n\toriginalPath := os.Getenv(\"PATH\")\n\tos.Setenv(\"PATH\", runtimesPath+string(os.PathListSeparator)+originalPath)\n\textraRuntimes := findContainerRuntimes()\n\tos.Setenv(\"PATH\", originalPath)\n\n\t// Verifies if the DefaultRuntime can be found\n\tif _, ok := extraRuntimes[cfg.DefaultRuntime]; !ok && cfg.DefaultRuntime != \"\" {\n\t\treturn fmt.Errorf(\"default runtime %s was not found\", cfg.DefaultRuntime)\n\t}\n\n\tcontainerdConfig := templates.ContainerdConfig{\n\t\tNodeConfig:            cfg,\n\t\tDisableCgroup:         disableCgroup,\n\t\tSystemdCgroup:         cfg.AgentConfig.Systemd,\n\t\tIsRunningInUserNS:     isRunningInUserNS,\n\t\tEnableUnprivileged:    kernel.CheckKernelVersion(4, 11, 0),\n\t\tNonrootDevices:        cfg.Containerd.NonrootDevices,\n\t\tPrivateRegistryConfig: cfg.AgentConfig.Registry,\n\t\tExtraRuntimes:         extraRuntimes,\n\t\tProgram:               version.Program,\n\t\tNoDefaultEndpoint:     cfg.Containerd.NoDefault,\n\t}\n\n\tselEnabled, selConfigured, err := selinuxStatus()\n\tif err != nil {\n\t\treturn fmt.Errorf(\"failed to detect selinux: %w\", err)","sourceCodeStart":65,"sourceCodeEnd":101,"githubUrl":"https://github.com/k3s-io/k3s/blob/6ba341e396edc16b8dcae978a7c5e3ac7ee5606e/pkg/agent/containerd/config_linux.go#L65-L101","documentation":"On Linux, the agent temporarily prepends its bundled runtimes directory to PATH, discovers available container runtimes via findContainerRuntimes(), then verifies cfg.DefaultRuntime (from --default-runtime / containerd config) is among them. If the name is not in the discovered set (and non-empty), it fails fast with this error before the containerd config is written.","triggerScenarios":"--default-runtime=nvidia (or crun, kata, ...) on a node where that runtime binary is not installed or not on the effective PATH; or a name mismatch with the discovered key (e.g. 'nvidia' vs 'nvidia-container-runtime').","commonSituations":"GPU nodes without nvidia-container-toolkit installed; runtimes installed in a nonstandard directory not on PATH; config copied from a GPU node onto a CPU node.","solutions":["Install the runtime on the node (e.g. nvidia-container-toolkit) and confirm with 'which nvidia-container-runtime'","Match the exact runtime name that discovery expects (see the error text)","Drop --default-runtime to fall back to containerd's default (runc)"],"exampleFix":"# before\n--default-runtime nvidia   # toolkit not installed\n\n# after\napt-get install -y nvidia-container-toolkit\n--default-runtime nvidia   # now discoverable on PATH","handlingStrategy":"validation","validationCode":"if cfg.DefaultRuntime != \"\" {\n    if _, err := exec.LookPath(cfg.DefaultRuntime); err != nil {\n        return fmt.Errorf(\"default runtime %s not installed on this node\", cfg.DefaultRuntime)\n    }\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Install the runtime (e.g. nvidia-container-toolkit) and verify with 'which' before setting --default-runtime","Keep per-node config: do not copy GPU-node flags onto CPU nodes"],"tags":["containerd","runtime","linux","config","gpu"],"backgroundTag":null,"analyzedSha":"6ba341e396edc16b8dcae978a7c5e3ac7ee5606e","analyzedAt":"2026-08-15T16:27:54.286Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}