{"record":{"id":"282356fa18ff379c","repo":"kubernetes/kops","slug":"error-parsing-addon-v","errorCode":null,"errorMessage":"error parsing addon %v","messagePattern":"error parsing addon (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/clusteraddons/load.go","lineNumber":61,"sourceCode":"\tklog.V(2).Infof(\"Loading addon from %q\", resolved)\n\taddonBytes, err := vfsContext.ReadFile(resolved)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"error reading addon %q: %v\", resolved, err)\n\t}\n\taddon, err := ParseClusterAddon(addonBytes)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"error parsing addon %q: %v\", resolved, err)\n\t}\n\tklog.V(4).Infof(\"Addon contents: %s\", string(addonBytes))\n\n\treturn addon, nil\n}\n\n// ParseClusterAddon parses a ClusterAddon object\nfunc ParseClusterAddon(raw []byte) (*ClusterAddon, error) {\n\tobjects, err := kubemanifest.LoadObjectsFrom(raw)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"error parsing addon %v\", err)\n\t}\n\n\treturn &ClusterAddon{Raw: string(raw), Objects: objects}, nil\n}\n","sourceCodeStart":43,"sourceCodeEnd":66,"githubUrl":"https://github.com/kubernetes/kops/blob/4c8573c808a73d578c5eadc86d410646ea0b0d73/pkg/clusteraddons/load.go#L43-L66","documentation":"ParseClusterAddon uses kubemanifest.LoadObjectsFrom to decode raw bytes into Kubernetes objects. If decoding fails (invalid YAML, unknown/unsupported objects, schema errors) it returns this error wrapping the decoder's message. This is the lowest-level addon parse error in the load path.","triggerScenarios":"ParseClusterAddon called (by LoadClusterAddon) with bytes that are not decodable as Kubernetes manifests — malformed YAML, wrong indentation, unsupported API group/version, or binary garbage.","commonSituations":"Custom/community addons written against newer Kubernetes API versions than the decoder accepts; hand-written addon YAML with syntax errors; files that are JSON/YAML mixes or empty.","solutions":["Fix the YAML syntax in the addon source based on the wrapped decoder error (line/column info).","Ensure all objects use API versions supported by the kops manifest loader.","Validate the manifest locally with kubectl apply --dry-run=client before adding it as a cluster addon."],"exampleFix":"// before (addon yaml)\napiVersion: v1\nkind: ConfigMap\n metadata:\n   name: x\n// after\napiVersion: v1\nkind: ConfigMap\nmetadata:\n  name: x","handlingStrategy":"validation","validationCode":"// pre-validate addon bytes as decodable YAML\nvar check interface{}\nif err := yaml.Unmarshal(raw, &check); err != nil {\n  return fmt.Errorf(\"addon YAML invalid: %v\", err)\n}","typeGuard":null,"tryCatchPattern":"addon, err := ParseClusterAddon(raw)\nif err != nil {\n  return fmt.Errorf(\"addon content rejected: %w; fix the YAML/API versions in the addon source\", err)\n}","preventionTips":["Lint addon YAML with kubectl apply --dry-run=client or yamllint before registering.","Keep addon manifests on API versions the kops manifest loader supports.","Store addons as plain YAML/JSON files, never binary or templated output."],"tags":["clusteraddons","yaml","parsing","kubemanifest"],"backgroundTag":"manifest-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"}