{"record":{"id":"68da56d1a8c46780","repo":"kubernetes/kops","slug":"error-parsing-nodeupconfig-q-v","errorCode":null,"errorMessage":"error parsing NodeupConfig %q: %v","messagePattern":"error parsing NodeupConfig %q: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"critical","filePath":"upup/pkg/fi/nodeup/command.go","lineNumber":154,"sourceCode":"\tcase nodeConfig != nil:\n\t\tif err := utils.YamlUnmarshal([]byte(nodeConfig.NodeupConfig), &nodeupConfig); err != nil {\n\t\t\treturn fmt.Errorf(\"error parsing BootConfig config response: %v\", err)\n\t\t}\n\t\tnodeupConfigHash = sha256.Sum256([]byte(nodeConfig.NodeupConfig))\n\t\tif nodeupConfig.CAs == nil {\n\t\t\tnodeupConfig.CAs = make(map[string]string)\n\t\t}\n\t\tnodeupConfig.CAs[fi.CertificateIDCA] = bootConfig.ConfigServer.CACertificates\n\tcase bootConfig.InstanceGroupName != \"\":\n\t\tnodeupConfigLocation := configBase.Join(\"igconfig\", bootConfig.InstanceGroupRole.ToLowerString(), bootConfig.InstanceGroupName, \"nodeupconfig.yaml\")\n\n\t\tb, err := nodeupConfigLocation.ReadFile(ctx)\n\t\tif err != nil {\n\t\t\treturn fmt.Errorf(\"error loading NodeupConfig %q: %v\", nodeupConfigLocation, err)\n\t\t}\n\n\t\tif err = utils.YamlUnmarshal(b, &nodeupConfig); err != nil {\n\t\t\treturn fmt.Errorf(\"error parsing NodeupConfig %q: %v\", nodeupConfigLocation, err)\n\t\t}\n\t\tnodeupConfigHash = sha256.Sum256(b)\n\tdefault:\n\t\treturn fmt.Errorf(\"no instance group defined in nodeup config\")\n\t}\n\n\tif bootConfig.NodeupConfigHash != \"\" {\n\t\tif want, got := bootConfig.NodeupConfigHash, base64.StdEncoding.EncodeToString(nodeupConfigHash[:]); got != want {\n\t\t\treturn fmt.Errorf(\"nodeup config hash mismatch (was %q, expected %q)\", got, want)\n\t\t}\n\t}\n\n\terr = evaluateSpec(&nodeupConfig, bootConfig.CloudProvider, region)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tarchitecture, err := architectures.FindArchitecture()","sourceCodeStart":136,"sourceCodeEnd":172,"githubUrl":"https://github.com/kubernetes/kops/blob/4c8573c808a73d578c5eadc86d410646ea0b0d73/upup/pkg/fi/nodeup/command.go#L136-L172","documentation":"nodeup reads the cluster's NodeupConfig YAML from the state store (configBase/igconfig/<role>/<instancegroup>/nodeupconfig.yaml) and unmarshals it into nodeup.Config. This error means the file was fetched successfully but utils.YamlUnmarshal could not parse it into the Config struct — the YAML is malformed or its fields don't match the expected schema. It is thrown during NodeUpCommand.Run, before any provisioning work happens.","triggerScenarios":"Calling NodeUpCommand.Run() with bootConfig.InstanceGroupName set (VFS path, not config-server path) where the nodeupconfig.yaml at the joined VFS path contains invalid YAML (bad indentation, tabs, duplicate keys) or fields with wrong types (e.g. a string where nodeup.Config expects a bool/int/map), or the file was written by an incompatible kOps version.","commonSituations":"Hand-edited nodeupconfig.yaml in the state store; partial/truncated upload to S3/GCS/object storage; state store produced by a newer or older kOps version whose Config schema differs; corruption in the object store serving the file.","solutions":["Fetch the exact file shown in the error and validate it: kops toolbox dump won't help — instead download it (e.g. aws s3 cp s3://<statestore>/cluster/igconfig/<role>/<ig>/nodeupconfig.yaml -) and run it through a YAML linter / yaml.Unmarshal to spot syntax or type problems.","Check the kOps version that wrote the state store versus the nodeup binary version; mismatched schemas cause unmarshal failures. Upgrade nodeup/kops so both use the same Config schema, or re-run 'kops update cluster' to regenerate the config.","Regenerate and push the cluster configuration with 'kops update cluster' (then 'kops rolling-update cluster' as needed) so a known-good nodeupconfig.yaml is written to the state store.","As a last resort, restore the file from the state store backup or re-create the instance group ('kops replace -f ig.yaml') to rewrite nodeupconfig.yaml."],"exampleFix":"// before: hand-edited nodeupconfig.yaml with a tab character\n\tconfigStore:\n\t\tsecrets: s3://bucket/secrets\n// after: use spaces only and valid types\nconfigStore:\n  secrets: s3://bucket/secrets","handlingStrategy":"validation","validationCode":"// Validate nodeupconfig.yaml parses before invoking nodeup\nb, err := os.ReadFile(\"nodeupconfig.yaml\")\nif err != nil { return err }\nvar cfg nodeup.Config\nif err := yaml.Unmarshal(b, &cfg); err != nil {\n    return fmt.Errorf(\"nodeupconfig.yaml is invalid: %w\", err)\n}","typeGuard":null,"tryCatchPattern":"err := cmd.Run(out)\nif err != nil && strings.Contains(err.Error(), \"error parsing NodeupConfig\") {\n    // inspect the yaml file at the reported path and fix syntax/schema\n}","preventionTips":["Never hand-edit nodeupconfig.yaml in the state store; change the cluster spec and re-run kops update cluster","Run 'kops update cluster' with the same kOps version that built the nodeup binary","Validate generated YAML with a linter in CI after templating"],"tags":["nodeup","yaml","config-parsing","bootstrap"],"backgroundTag":"yaml-unmarshal-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"}