{"record":{"id":"ed10b5353385ea35","repo":"kubernetes/kops","slug":"error-converting-nodeup-config-to-yaml-v","errorCode":null,"errorMessage":"error converting nodeup config to yaml: %v","messagePattern":"error converting nodeup config to yaml: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/model/bootstrapscript.go","lineNumber":122,"sourceCode":"\t}\n\n\tkeysets := make(map[string]*fi.Keyset)\n\tfor _, caTask := range b.caTasks {\n\t\tname := *caTask.Name\n\t\tkeyset := caTask.Keyset()\n\t\tif keyset == nil {\n\t\t\treturn nil, fmt.Errorf(\"failed to get keyset from %q\", name)\n\t\t}\n\t\tkeysets[name] = keyset\n\t}\n\tconfig, bootConfig, err := b.builder.NodeUpConfigBuilder.BuildConfig(ig, wellKnownAddresses, keysets)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tconfigData, err := utils.YamlMarshal(config)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"error converting nodeup config to yaml: %v\", err)\n\t}\n\tsum256 := sha256.Sum256(configData)\n\tbootConfig.NodeupConfigHash = base64.StdEncoding.EncodeToString(sum256[:])\n\tb.nodeupConfig.Resource = fi.NewBytesResource(configData)\n\n\tif ig.Spec.Manager == kops.InstanceManagerKarpenter {\n\t\tassetBuilder := assets.NewAssetBuilder(vfs.NewVFSContext(), cluster.Spec.Assets, false)\n\t\tnodeUpAssets := make(map[architectures.Architecture]*assets.MirroredAsset)\n\t\tfor _, arch := range architectures.GetSupported() {\n\t\t\tasset, err := wellknownassets.NodeUpAsset(assetBuilder, arch)\n\t\t\tif err != nil {\n\t\t\t\treturn nil, err\n\t\t\t}\n\t\t\tnodeUpAssets[arch] = asset\n\t\t}\n\n\t\tvar nodeupScript resources.NodeUpScript\n\t\tnodeupScript.NodeUpAssets = nodeUpAssets","sourceCodeStart":104,"sourceCodeEnd":140,"githubUrl":"https://github.com/kubernetes/kops/blob/4c8573c808a73d578c5eadc86d410646ea0b0d73/pkg/model/bootstrapscript.go#L104-L140","documentation":"After building the nodeup configuration struct, kubeEnv serializes it to YAML with utils.YamlMarshal to store as the nodeup config resource. If marshalling fails (the config contains a type not representable in YAML), the error is wrapped and bootstrap script generation fails.","triggerScenarios":"A nodeup.BootConfig / NodeUpConfig populated with data that cannot be marshalled to YAML during `kops update cluster` — e.g. unexpected types introduced by custom builder output or a kops/nodeup version mismatch in config structs.","commonSituations":"Running a mismatched kops binary against plugins/extensions injecting unsupported fields; internal bugs after kops version upgrades; binary incompatibility between nodeup config struct versions.","solutions":["Use a kops binary whose version matches your cluster/state store (no mixed-version binaries).","Retry after identifying the wrapped marshal cause; report to kops if it reproduces on stock config (likely a bug).","Clear any third-party hooks/builders injecting non-serializable values and re-run `kops update cluster`."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"if err := kopsUpdate(); err != nil {\n  if strings.Contains(err.Error(), \"error converting nodeup config to yaml\") {\n    // check for kops binary/state-store version mismatch and report bug if stock\n    return fmt.Errorf(\"nodeup config marshal failed; verify matching kops version: %w\", err)\n  }\n  return err\n}","preventionTips":["Run a kops binary version matching the cluster's state store.","Avoid third-party patches that add non-serializable fields to nodeup config.","Upgrade kops and nodeup together."],"tags":["nodeup","yaml","serialization","bootstrap"],"backgroundTag":"yaml-marshal-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"}