{"record":{"id":"31993d558417b564","repo":"kubernetes/kops","slug":"unsupported-distro-q","errorCode":null,"errorMessage":"unsupported distro %q","messagePattern":"unsupported distro %q","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"util/pkg/distributions/identify.go","lineNumber":112,"sourceCode":"\t}\n\tif strings.HasPrefix(distro, \"rhel-9.\") {\n\t\treturn DistributionRhel9, nil\n\t}\n\tif strings.HasPrefix(distro, \"rhel-10.\") {\n\t\treturn DistributionRhel10, nil\n\t}\n\tif strings.HasPrefix(distro, \"rocky-8.\") {\n\t\treturn DistributionRocky8, nil\n\t}\n\tif strings.HasPrefix(distro, \"rocky-9.\") {\n\t\treturn DistributionRocky9, nil\n\t}\n\tif strings.HasPrefix(distro, \"rocky-10.\") {\n\t\treturn DistributionRocky10, nil\n\t}\n\t// Some distros are not supported\n\tklog.V(2).Infof(\"Contents of /etc/os-release:\\n%s\", osReleaseBytes)\n\treturn Distribution{}, fmt.Errorf(\"unsupported distro %q\", distro)\n}\n","sourceCodeStart":94,"sourceCodeEnd":114,"githubUrl":"https://github.com/kubernetes/kops/blob/4c8573c808a73d578c5eadc86d410646ea0b0d73/util/pkg/distributions/identify.go#L94-L114","documentation":"After parsing /etc/os-release, FindDistribution builds a distro string like \"ID-VERSION_ID\" and matches it against a whitelist of supported distributions. If the string matches no case (e.g. \"fedora-40\", \"alpine-3.20\", an unrecognized major version like \"rocky-11\"), it logs the os-release contents at V(2) and returns this error. The file was readable, but the distro is simply not one kOps supports.","triggerScenarios":"Calling FindDistribution on a host whose ID=VERSION_ID combination has no case in the switch — e.g. alpine, fedora, opensuse, an EOL/renamed distro, or a version not yet in the list (e.g. rocky-11 or a new ubuntu point release that maps differently). Called from Run, Find, RenderLocal, systemdSystemPath.","commonSituations":"Testing kOps/nodeup on a developer laptop running Fedora or Arch; using an experimental community AMI built on an unsupported distro; a distro version bump (e.g. centos 8 -> stream) that changed the ID/VERSION_ID; Alpine-based minimal images for nodes.","solutions":["Switch nodes to a supported distro image (debian, ubuntu, rocky, flatcar, amazon-linux, etc.)","Enable klog V(2) to see the /etc/os-release contents logged with the error and confirm what distro/version string was produced","If the distro is a supported one at a new version, upgrade kOps — newer releases add new version cases (e.g. rocky-10)","If you fork kOps, add a case to the distro switch in identify.go for your ID-VERSION_ID"],"exampleFix":"// before\n# cluster.yaml node image: Fedora-Cloud-Base-40\n// after\n# node image: Ubuntu 22.04 (or another supported distro)","handlingStrategy":"validation","validationCode":"// pre-flight: identify and reject unsupported distros before provisioning\nname := getDistroFromImage(nodeImage) // resolve before booting nodes\nsupported := []string{\"ubuntu\", \"debian\", \"rocky\", \"flatcar\", \"amazon\"}\nif !slices.ContainsFunc(supported, func(s string) bool { return strings.HasPrefix(name, s) }) {\n    return fmt.Errorf(\"node image distro %q is not supported by this kOps version\", name)\n}","typeGuard":"func isSupportedDistroString(distro string) bool {\n    switch {\n    case strings.HasPrefix(distro, \"ubuntu-\"), strings.HasPrefix(distro, \"debian-\"),\n        strings.HasPrefix(distro, \"rocky-\"), strings.HasPrefix(distro, \"flatcar\"),\n        strings.HasPrefix(distro, \"amazon-linux\"):\n        return true\n    }\n    return false\n}","tryCatchPattern":"distro, err := distributions.FindDistribution(\"/\")\nif err != nil {\n    klog.V(2).Infof(\"os-release contents: %v\", osReleaseBytes) // re-check what was seen\n    return fmt.Errorf(\"this OS is not supported by kOps: %w; use a supported distro image\", err)\n}","preventionTips":["Choose node images only from kOps' supported distro list for your kOps version","Run klog at V(2) to capture the logged /etc/os-release contents when the error occurs","When a supported distro ships a new major version, verify the new kOps release added its case before upgrading","Avoid hobbyist/minimal images (alpine, fedora raw) for kOps nodes"],"tags":["os-detection","linux-distributions","compatibility"],"backgroundTag":"unsupported-distro","analyzedSha":"4c8573c808a73d578c5eadc86d410646ea0b0d73","analyzedAt":"2026-09-05T04:13:19.212Z","contentChangedAt":"2026-09-05T04:13:19.212Z","schemaVersion":2},"datasetVersion":"2026-09-12T12:17:11.808Z"}