kubernetes/kops · error
error parsing container runtime version %q: %w
Error message
error parsing container runtime version %q: %w
What it means
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.
Source
Thrown at nodeup/pkg/model/containerd.go:166
Contents: v,
Type: nodetasks.FileType_File,
Mode: new("0755"),
}
c.AddTask(fileTask)
}
// Add configuration file for easier use of crictl
b.addCrictlConfig(c)
var containerdVersion string
if b.NodeupConfig.ContainerdConfig != nil {
containerdVersion = fi.ValueOf(b.NodeupConfig.ContainerdConfig.Version)
} else {
return fmt.Errorf("error finding contained version")
}
sv, err := semver.ParseTolerant(containerdVersion)
if err != nil {
return fmt.Errorf("error parsing container runtime version %q: %w", containerdVersion, err)
}
c.AddTask(b.buildSystemdService(sv))
if err := b.buildSysconfigFile(c); err != nil {
return err
}
return nil
}
func (b *ContainerdBuilder) buildSystemdService(containerdVersion semver.Version) *nodetasks.Service {
// Based on https://github.com/containerd/containerd/blob/master/containerd.service
manifest := &systemd.Manifest{}
manifest.Set("Unit", "Description", "containerd container runtime")
manifest.Set("Unit", "Documentation", "https://containerd.io")
manifest.Set("Unit", "After", "network.target dbus.service")
View on GitHub (pinned to 4c8573c808)
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
Example fix
# before (cluster.yaml) containerd: version: latest # after containerd: version: 1.7.18
Defensive patterns
Strategy: validation
Validate before calling
# Validate the version is semver-parseable before applying: kops get cluster <name> -o yaml | yq '.spec.containerd.version' | grep -E '^(v)?[0-9]+\.[0-9]+\.[0-9]+([+.-].*)?$'
Prevention
- 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
When it happens
Trigger: 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.
Common situations: 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.
Related errors
- unable to find any containerd binaries in assets
- error finding contained version
- error building containerd flags: %v
- building json: %w
- unable to parse version string: %q
AI-assisted analysis of kubernetes/kops@4c8573c808 (2026-09-05).
Data as JSON: /api/errors/74da3ed9d1b6089b.
Report an issue: GitHub.