{"record":{"id":"e7e80e80cd59cfab","repo":"kubernetes/kops","slug":"unknown-or-unsupported-distro-v-e7e80e","errorCode":null,"errorMessage":"unknown or unsupported distro: %v","messagePattern":"unknown or unsupported distro: (.+?)","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"upup/pkg/fi/nodeup/nodetasks/service.go","lineNumber":169,"sourceCode":"\tproperties := make(map[string]string)\n\tfor _, line := range strings.Split(string(output), \"\\n\") {\n\t\tif line == \"\" {\n\t\t\tcontinue\n\t\t}\n\t\ttokens := strings.SplitN(line, \"=\", 2)\n\t\tif len(tokens) != 2 {\n\t\t\tklog.Warningf(\"Ignoring line in systemd show output: %q\", line)\n\t\t\tcontinue\n\t\t}\n\t\tproperties[tokens[0]] = tokens[1]\n\t}\n\treturn properties, nil\n}\n\nfunc (_ *Service) systemdSystemPath() (string, error) {\n\td, err := distributions.FindDistribution(\"/\")\n\tif err != nil {\n\t\treturn \"\", fmt.Errorf(\"unknown or unsupported distro: %v\", err)\n\t}\n\n\tif d.IsDebianFamily() {\n\t\treturn debianSystemdSystemPath, nil\n\t} else if d.IsRHELFamily() {\n\t\treturn centosSystemdSystemPath, nil\n\t} else if d == distributions.DistributionFlatcar {\n\t\treturn flatcarSystemdSystemPath, nil\n\t} else if d == distributions.DistributionContainerOS {\n\t\treturn containerosSystemdSystemPath, nil\n\t} else {\n\t\treturn \"\", fmt.Errorf(\"unsupported systemd system\")\n\t}\n}\n\nfunc (e *InstallService) Find(_ *fi.InstallContext) (*InstallService, error) {\n\tactual, err := e.Service.Find(nil)\n\tif actual == nil || err != nil {","sourceCodeStart":151,"sourceCodeEnd":187,"githubUrl":"https://github.com/kubernetes/kops/blob/4c8573c808a73d578c5eadc86d410646ea0b0d73/upup/pkg/fi/nodeup/nodetasks/service.go#L151-L187","documentation":"nodeup's Service task resolves the systemd unit directory by detecting the Linux distribution at runtime via distributions.FindDistribution(\"/\"). When that detection itself fails (it cannot identify the OS from /etc/os-release or equivalents), the task wraps the underlying error as \"unknown or unsupported distro\" and aborts, because it cannot know where to write unit files.","triggerScenarios":"Service.Find or Service.RenderLocal runs on a node whose root filesystem lacks a recognizable /etc/os-release (or the detection helper returns an error), so systemdSystemPath cannot map the distro to debianSystemdSystemPath / centosSystemdSystemPath / flatcar / COS paths.","commonSituations":"Bootstrapping nodes on unofficial or custom minimal images (e.g. hand-built images with the os-release file stripped), niche distros not in kOps' supported list (Alpine, Arch), or a corrupted/missing /etc/os-release after image hardening.","solutions":["Verify /etc/os-release exists on the node image and contains valid ID/ID_LIKE fields","Use a kOps-supported OS image (Debian/Ubuntu, RHEL-family, Flatcar, Container-Optimized OS)","If building a custom image, base it on a supported distro family so ID_LIKE maps to debian or rhel","Check nodeup version against supported OS matrix; older nodeup may not know newer distro releases"],"exampleFix":"# before (broken node image)\n$ ls /etc/os-release\nls: cannot access '/etc/os-release': No such file or directory\n// after: bake a supported base image so /etc/os-release exists\n// e.g. Dockerfile FROM debian:bookworm (which ships /etc/os-release)","handlingStrategy":"validation","validationCode":"// Run on the node before nodeup:\nif [ ! -f /etc/os-release ]; then echo 'os-release missing; unsupported distro' >&2; exit 1; fi\n. /etc/os-release; echo \"$ID $ID_LIKE\"","typeGuard":null,"tryCatchPattern":"// Go caller of nodeup internals\nif _, err := svc.systemdSystemPath(); err != nil {\n\tif strings.Contains(err.Error(), \"unknown or unsupported distro\") {\n\t\treturn fmt.Errorf(\"node image not supported: %w\", err)\n\t}\n\treturn err\n}","preventionTips":["Verify /etc/os-release exists in every custom node image before bootstrapping","Keep to kOps' supported OS list for node images","Pin image + kOps version pairs that CI has validated"],"tags":["nodeup","systemd","os-detection","distro-support"],"backgroundTag":"unsupported-distro","analyzedSha":"4c8573c808a73d578c5eadc86d410646ea0b0d73","analyzedAt":"2026-09-05T04:13:19.212Z","contentChangedAt":"2026-09-05T04:13:19.212Z","schemaVersion":2},"datasetVersion":"2026-09-12T07:17:12.445Z"}