{"record":{"id":"5c62ad500ddcb364","repo":"kubernetes/kops","slug":"re-marshaling-kops-channels-manifest-w","errorCode":null,"errorMessage":"re-marshaling kops-channels manifest: %w","messagePattern":"re-marshaling kops-channels manifest: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"nodeup/pkg/model/channels.go","lineNumber":110,"sourceCode":"\t}\n\tdata, err := p.ReadFile(ctx)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"reading kops-channels manifest %s: %w\", b.NodeupConfig.ChannelsManifest, err)\n\t}\n\n\t// SELinux is per-IG via containerdConfig, so the decoration can only be applied at nodeup.\n\t// Skip the parse/reserialize round-trip when there's nothing to add.\n\tif b.NodeupConfig.ContainerdConfig == nil || !b.NodeupConfig.ContainerdConfig.SeLinuxEnabled {\n\t\treturn data, nil\n\t}\n\tpod := &v1.Pod{}\n\tif err := yaml.Unmarshal(data, pod); err != nil {\n\t\treturn nil, fmt.Errorf(\"parsing kops-channels manifest: %w\", err)\n\t}\n\tkubemanifest.AddHostPathSELinuxContext(pod, b.NodeupConfig)\n\tout, err := k8scodecs.ToVersionedYaml(pod)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"re-marshaling kops-channels manifest: %w\", err)\n\t}\n\treturn out, nil\n}\n","sourceCodeStart":92,"sourceCodeEnd":114,"githubUrl":"https://github.com/kubernetes/kops/blob/4c8573c808a73d578c5eadc86d410646ea0b0d73/nodeup/pkg/model/channels.go#L92-L114","documentation":"After successfully unmarshaling and adding SELinux hostPath contexts, nodeup re-serializes the Pod via k8scodecs.ToVersionedYaml. If the codec fails to produce versioned YAML (serialization/codec registry error), the failure is wrapped with this message. This is rare and indicates an internal encoding problem rather than user configuration.","triggerScenarios":"Build() on a master node with SeLinuxEnabled=true; yaml.Unmarshal and AddHostPathSELinuxContext succeeded, but k8scodecs.ToVersionedYaml(pod) returns an error (e.g. codec/scheme registry failure marshaling the modified Pod).","commonSituations":"kops build with a broken/incompatible k8s.io/api or apimachinery codec registration; extremely unusual field values injected by AddHostPathSELinuxContext; corrupted kops binary.","solutions":["Upgrade/downgrade to a released kops version matching the node's nodeup binary; this is typically a build-level bug.","Rebuild kops/nodeup from source ensuring k8s.io/api and apimachinery versions are consistent (run 'make gomod' and 'make kops').","Verify no custom patches to kubemanifest.AddHostPathSELinuxContext or k8scodecs are producing malformed objects.","As a workaround, disable containerdConfig.seLinuxEnabled so the re-marshal path is skipped."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"if err := nodeupRun(ctx); err != nil && strings.Contains(err.Error(), \"re-marshaling kops-channels manifest\") {\n\t// internal codec failure: retry once, then surface for a kops version bump\n\tif err := nodeupRun(ctx); err != nil {\n\t\treturn fmt.Errorf(\"persistent channels manifest marshal failure, upgrade kops: %w\", err)\n\t}\n\treturn nil\n}","preventionTips":["Use only official kops releases; codec failures usually indicate a broken local build.","Run 'make gomod' when building from source to keep k8s.io deps consistent.","Avoid forks patching k8scodecs/kubemanifest without codec tests.","Report the full wrapped error upstream; it should never occur in normal operation."],"tags":["go","nodeup","serialization","channels","selinux"],"backgroundTag":"yaml-serialization-failed","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"}