{"record":{"id":"8785cfd01e43da42","repo":"kubernetes/kops","slug":"error-marshaling-manifest-to-yaml-v","errorCode":null,"errorMessage":"error marshaling manifest to yaml: %v","messagePattern":"error marshaling manifest to yaml: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"nodeup/pkg/model/kube_apiserver.go","lineNumber":246,"sourceCode":"\t}\n\n\tif err := b.writeKubeletAPICertificate(c, &kubeAPIServer); err != nil {\n\t\treturn err\n\t}\n\n\tif err := b.writeStaticCredentials(c, &kubeAPIServer); err != nil {\n\t\treturn err\n\t}\n\n\t{\n\t\tpod, err := b.buildPod(ctx, &kubeAPIServer)\n\t\tif err != nil {\n\t\t\treturn fmt.Errorf(\"error building kube-apiserver manifest: %v\", err)\n\t\t}\n\n\t\tmanifest, err := k8scodecs.ToVersionedYaml(pod)\n\t\tif err != nil {\n\t\t\treturn fmt.Errorf(\"error marshaling manifest to yaml: %v\", err)\n\t\t}\n\n\t\tc.AddTask(&nodetasks.File{\n\t\t\tPath:     \"/etc/kubernetes/manifests/kube-apiserver.manifest\",\n\t\t\tContents: fi.NewBytesResource(manifest),\n\t\t\tType:     nodetasks.FileType_File,\n\t\t})\n\t}\n\n\t// If we're using kube-apiserver-healthcheck, we need to set up the client cert etc\n\tif b.findHealthcheckManifest() != nil {\n\t\tif err := b.addHealthcheckSidecarTasks(c); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\tc.AddTask(&nodetasks.File{\n\t\tPath:        \"/var/log/kube-apiserver.log\",","sourceCodeStart":228,"sourceCodeEnd":264,"githubUrl":"https://github.com/kubernetes/kops/blob/4c8573c808a73d578c5eadc86d410646ea0b0d73/nodeup/pkg/model/kube_apiserver.go#L228-L264","documentation":"Wraps a failure of k8scodecs.ToVersionedYaml while serializing the kube-apiserver static pod manifest to YAML. The pod object built fine but could not be encoded, so the manifest file cannot be written.","triggerScenarios":"Thrown at nodeup/pkg/model/kube_apiserver.go:246 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Report to kOps maintainers — likely an unencodable field","Check for incompatible APIServerConfig options","Try a different kOps release"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"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"}