{"record":{"id":"12323c4aef70ff18","repo":"kubernetes/kops","slug":"error-parsing-configuration-q-v","errorCode":null,"errorMessage":"error parsing configuration %q: %v","messagePattern":"error parsing configuration %q: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"upup/pkg/fi/nodeup/command.go","lineNumber":97,"sourceCode":"\tCacheDir       string\n\tConfigLocation string\n\tTarget         string\n}\n\n// Run is responsible for perform the nodeup process\nfunc (c *NodeUpCommand) Run(out io.Writer) error {\n\tctx := context.Background()\n\n\tvar bootConfig nodeup.BootConfig\n\tif c.ConfigLocation != \"\" {\n\t\tb, err := vfs.Context.ReadFile(c.ConfigLocation)\n\t\tif err != nil {\n\t\t\treturn fmt.Errorf(\"error loading configuration %q: %v\", c.ConfigLocation, err)\n\t\t}\n\n\t\terr = utils.YamlUnmarshal(b, &bootConfig)\n\t\tif err != nil {\n\t\t\treturn fmt.Errorf(\"error parsing configuration %q: %v\", c.ConfigLocation, err)\n\t\t}\n\t} else {\n\t\treturn fmt.Errorf(\"ConfigLocation is required\")\n\t}\n\n\tif c.CacheDir == \"\" {\n\t\treturn fmt.Errorf(\"CacheDir is required\")\n\t}\n\n\tregion, err := getRegion(ctx, &bootConfig)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tvar configBase vfs.Path\n\n\t// If we're using a config server instead of vfs, nodeConfig will hold our configuration\n\tvar nodeConfig *nodeup.NodeConfig","sourceCodeStart":79,"sourceCodeEnd":115,"githubUrl":"https://github.com/kubernetes/kops/blob/4c8573c808a73d578c5eadc86d410646ea0b0d73/upup/pkg/fi/nodeup/command.go#L79-L115","documentation":"After successfully reading the boot config bytes, nodeup parses them into nodeup.BootConfig with utils.YamlUnmarshal. This error means the file was fetched but is not valid YAML or does not match the BootConfig schema (e.g. wrong type for a field, truncated file, HTML error page saved instead of YAML).","triggerScenarios":"NodeUpCommand.Run where utils.YamlUnmarshal fails on the bytes read from ConfigLocation: malformed YAML syntax, a field with the wrong type, an empty/corrupted file, or a non-config file at the path.","commonSituations":"Hand-edited nodeupconfig with YAML indentation errors; S3 object written truncated; a proxy/error page stored at the path; using a config format from an incompatible kops version (schema drift).","solutions":["Run the file through a YAML validator / 'yamllint' and fix syntax errors","Check field names and types against the nodeup.BootConfig struct for your kops version","Re-download or re-generate the config file (kubectl kops get cluster --cloudonly / redeploy) to rule out truncation","Ensure the kops version that created the config matches the nodeup binary version"],"exampleFix":"// before (nodeupconfig)\nconfigServer:\n  servers:\n   - url 443\n// after\nconfigServer:\n  servers:\n  - url: \"https://api.internal.cluster.example.com:443\"","handlingStrategy":"validation","validationCode":"// validate the YAML parses into BootConfig before running\nb, _ := os.ReadFile(localCopy)\nvar bc nodeup.BootConfig\nif err := yaml.Unmarshal(b, &bc); err != nil {\n  return fmt.Errorf(\"nodeup config invalid: %w\", err)\n}","typeGuard":"func isValidYAML(b []byte) bool {\n  var v interface{}\n  return yaml.Unmarshal(b, &v) == nil\n}","tryCatchPattern":"if err := cmd.Run(os.Stdout); err != nil {\n  if strings.HasPrefix(err.Error(), \"error parsing configuration\") {\n    klog.Errorf(\"nodeup config is malformed YAML or wrong schema: %v\", err)\n    os.Exit(1)\n  }\n  return err\n}","preventionTips":["Never hand-edit the generated nodeup config; regenerate it with kops tooling","Validate YAML with yamllint before uploading to the state store","Keep nodeup and kops versions in lockstep to avoid BootConfig schema drift"],"tags":["nodeup","yaml","configuration","parse-error"],"backgroundTag":"yaml-parse-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"}