{"record":{"id":"62bb299e463aee56","repo":"kubernetes/kops","slug":"error-parsing-manifest-v","errorCode":null,"errorMessage":"error parsing manifest: %v","messagePattern":"error parsing manifest: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/model/manifests.go","lineNumber":46,"sourceCode":"\t\"k8s.io/klog/v2\"\n)\n\n// ParseManifest parses a typed set of objects from a []byte\nfunc ParseManifest(data []byte) ([]runtime.Object, error) {\n\tdecoder := yaml.NewYAMLOrJSONDecoder(bytes.NewReader(data), 4096)\n\tdeser := scheme.Codecs.UniversalDeserializer()\n\n\tvar objects []runtime.Object\n\n\tfor {\n\t\text := runtime.RawExtension{}\n\t\tif err := decoder.Decode(&ext); err != nil {\n\t\t\tif err == io.EOF {\n\t\t\t\tbreak\n\t\t\t}\n\t\t\tfmt.Fprintf(os.Stderr, \"%s\", string(data))\n\t\t\tklog.Infof(\"manifest: %s\", string(data))\n\t\t\treturn nil, fmt.Errorf(\"error parsing manifest: %v\", err)\n\t\t}\n\n\t\tobj, _, err := deser.Decode([]byte(ext.Raw), nil, nil)\n\t\tif err != nil {\n\t\t\treturn nil, fmt.Errorf(\"error parsing object in manifest: %v\", err)\n\t\t}\n\n\t\tobjects = append(objects, obj)\n\t}\n\n\treturn objects, nil\n}\n","sourceCodeStart":28,"sourceCodeEnd":59,"githubUrl":"https://github.com/kubernetes/kops/blob/4c8573c808a73d578c5eadc86d410646ea0b0d73/pkg/model/manifests.go#L28-L59","documentation":"Returned by ParseManifest when the YAML/JSON stream itself cannot be decoded — a syntax error such as bad indentation, tabs, or an invalid scalar — before any document is deserialized into a typed object. The raw manifest is echoed to stderr and klog to aid diagnosis.","triggerScenarios":"Thrown at pkg/model/manifests.go:46 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Validate the manifest with yamllint or `kubectl apply --dry-run=client -f`","Check multi-document separators (---) and quoting of values kOps expects as strings","Fix the reported line/column in the manifest supplied via AdditionalObjects or addons"],"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"}