{"record":{"id":"74da3ed9d1b6089b","repo":"kubernetes/kops","slug":"error-parsing-container-runtime-version-q-w","errorCode":null,"errorMessage":"error parsing container runtime version %q: %w","messagePattern":"error parsing container runtime version %q: %w","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"nodeup/pkg/model/containerd.go","lineNumber":166,"sourceCode":"\t\t\tContents: v,\n\t\t\tType:     nodetasks.FileType_File,\n\t\t\tMode:     new(\"0755\"),\n\t\t}\n\t\tc.AddTask(fileTask)\n\t}\n\n\t// Add configuration file for easier use of crictl\n\tb.addCrictlConfig(c)\n\n\tvar containerdVersion string\n\tif b.NodeupConfig.ContainerdConfig != nil {\n\t\tcontainerdVersion = fi.ValueOf(b.NodeupConfig.ContainerdConfig.Version)\n\t} else {\n\t\treturn fmt.Errorf(\"error finding contained version\")\n\t}\n\tsv, err := semver.ParseTolerant(containerdVersion)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"error parsing container runtime version %q: %w\", containerdVersion, err)\n\t}\n\tc.AddTask(b.buildSystemdService(sv))\n\n\tif err := b.buildSysconfigFile(c); err != nil {\n\t\treturn err\n\t}\n\n\treturn nil\n}\n\nfunc (b *ContainerdBuilder) buildSystemdService(containerdVersion semver.Version) *nodetasks.Service {\n\t// Based on https://github.com/containerd/containerd/blob/master/containerd.service\n\n\tmanifest := &systemd.Manifest{}\n\tmanifest.Set(\"Unit\", \"Description\", \"containerd container runtime\")\n\tmanifest.Set(\"Unit\", \"Documentation\", \"https://containerd.io\")\n\tmanifest.Set(\"Unit\", \"After\", \"network.target dbus.service\")\n","sourceCodeStart":148,"sourceCodeEnd":184,"githubUrl":"https://github.com/kubernetes/kops/blob/4c8573c808a73d578c5eadc86d410646ea0b0d73/nodeup/pkg/model/containerd.go#L148-L184","documentation":"Once the containerd version string is obtained from NodeupConfig.ContainerdConfig.Version, nodeup parses it with semver.ParseTolerant to drive version-dependent systemd unit generation. If the string is not a parseable semantic version, this wrapped error is returned at nodeup/pkg/model/containerd.go:166, including the offending version value and the underlying semver error via %w.","triggerScenarios":"spec.containerd.version is set to a value semver.ParseTolerant rejects — e.g. an empty string, a URL instead of a version, something like 'latest', '1.7', 'v1..0', or a tag with invalid semver characters.","commonSituations":"Typos in cluster.yaml (version: latest or version: 1.7), pasting a containerd download URL into the version field, or custom controllers/automation writing malformed versions into the cluster spec.","solutions":["Set spec.containerd.version to a valid semver string (e.g. 1.7.18) and run `kops update cluster` + rolling update","Use a kOps-supported containerd version from the kOps releases documented matrix","Remove stray prefixes/suffixes or invalid characters from the version field (bare '1.7.18' or 'v1.7.18' is tolerated, 'latest' is not)","Check the exact quoted value in the error message to see what string nodeup actually received"],"exampleFix":"# before (cluster.yaml)\ncontainerd:\n  version: latest\n# after\ncontainerd:\n  version: 1.7.18","handlingStrategy":"validation","validationCode":"# Validate the version is semver-parseable before applying:\nkops get cluster <name> -o yaml | yq '.spec.containerd.version' | grep -E '^(v)?[0-9]+\\.[0-9]+\\.[0-9]+([+.-].*)?$'","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Never use 'latest', URLs, or partial versions like '1.7' in spec.containerd.version","Consult the kOps supported containerd version matrix before bumping","Lint cluster manifests for semver fields in CI"],"tags":["nodeup","containerd","semver"],"backgroundTag":"invalid-version-string","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"}