{"record":{"id":"d2f8e0bee6b303da","repo":"GoogleContainerTools/skaffold","slug":"parsing-manifests-file-into-manifest-list-object","errorCode":null,"errorMessage":"parsing manifests file into manifest list object: %w","messagePattern":"parsing manifests file into manifest list object: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/skaffold/deploy/util/util.go","lineNumber":188,"sourceCode":"\t\t\t\tResource: r.Name,\n\t\t\t}, nil\n\t\t}\n\t}\n\n\treturn false, schema.GroupVersionResource{}, fmt.Errorf(\"could not find resource for %s\", gvk.String())\n}\n\nfunc GetManifestsFromHydratedManifests(ctx context.Context, hydratedManifests []string) (manifest.ManifestList, error) {\n\tvar manifests manifest.ManifestList\n\tfor _, path := range hydratedManifests {\n\t\tf, err := os.Open(path)\n\t\tif err != nil {\n\t\t\treturn nil, fmt.Errorf(\"opening hydrated manifest at %s: %w\", path, err)\n\t\t}\n\t\tdefer f.Close()\n\t\tms, err := manifest.Load(f)\n\t\tif err != nil {\n\t\t\treturn nil, fmt.Errorf(\"parsing manifests file into manifest list object: %w\", err)\n\t\t}\n\t\tmanifests = append(manifests, ms...)\n\t}\n\n\treturn manifests, nil\n}\n\ntype tagErr struct {\n\ttag string\n\terr error\n}\n\n// ImageTags generates tags for a list of artifacts\nfunc ImageTags(ctx context.Context, runCtx *runcontext.RunContext, tagger tag.Tagger, out io.Writer, artifacts []*latest.Artifact) (tag.ImageTags, error) {\n\tstart := time.Now()\n\tmaxWorkers := runtime.GOMAXPROCS(0)\n\n\tif len(artifacts) > 0 {","sourceCodeStart":170,"sourceCodeEnd":206,"githubUrl":"https://github.com/GoogleContainerTools/skaffold/blob/a1189de023efc32d4b8e11f395acc678aa555011/pkg/skaffold/deploy/util/util.go#L170-L206","documentation":"After opening a hydrated manifest file, GetManifestsFromHydratedManifests parses it via manifest.Load into a ManifestList. If the file content is not a valid manifest (corrupt YAML, empty file, wrong format), this error wraps the parse failure. It indicates the hydrated output is not deployable manifest content.","triggerScenarios":"Calling GetManifestsFromHydratedManifests on files that are empty, truncated, contain invalid YAML, or are not Kubernetes manifests (e.g. a log file or partial write landed in the manifest list).","commonSituations":"A hydrate/transform step crashed mid-write leaving truncated YAML; Kustomize/Helm output generation failed but wrote a stub file; encoding issues or template placeholders left unparsed; a non-manifest file was passed in hydratedManifests.","solutions":["Validate each file parses: kubectl apply --dry-run=client -f <path> to find the malformed file","Re-run the hydrate step to regenerate clean manifest output","Check the producing tool (kustomize/helm) for errors that produced invalid YAML","Confirm only manifest files are included in the hydratedManifests list"],"exampleFix":"// before\nms, err := manifest.Load(f)\nif err != nil {\n\treturn nil, fmt.Errorf(\"parsing manifests file into manifest list object: %w\", err)\n}\n// after\nms, err := manifest.Load(f)\nif err != nil {\n\treturn nil, fmt.Errorf(\"parsing manifests file into manifest list object: %w\", err)\n}","handlingStrategy":"validation","validationCode":"func validateManifestYAML(path string) error {\n\tdata, err := os.ReadFile(path)\n\tif err != nil {\n\t\treturn err\n\t}\n\tif len(bytes.TrimSpace(data)) == 0 {\n\t\treturn fmt.Errorf(\"manifest file %s is empty\", path)\n\t}\n\tvar docs []map[string]interface{}\n\tif err := yaml.Unmarshal(data, &docs); err != nil {\n\t\treturn fmt.Errorf(\"manifest file %s is not valid YAML: %w\", path, err)\n\t}\n\treturn nil\n}","typeGuard":null,"tryCatchPattern":"manifests, err := GetManifestsFromHydratedManifests(ctx, paths)\nif err != nil {\n\tif strings.Contains(err.Error(), \"parsing manifests file\") {\n\t\treturn fmt.Errorf(\"hydrated output invalid — regenerate via hydrate step: %w\", err)\n\t}\n\treturn err\n}","preventionTips":["Run kubectl apply --dry-run=client on hydrated output before deploying","Ensure hydrate/transform tools (kustomize, helm) succeed and write complete files","Check for empty or truncated files after generation","Reject unparsed template placeholders in manifest output"],"tags":["yaml","manifests","parsing","kubernetes"],"backgroundTag":"manifest-parse-failed","analyzedSha":"a1189de023efc32d4b8e11f395acc678aa555011","analyzedAt":"2026-09-05T12:09:27.064Z","contentChangedAt":"2026-09-05T12:09:27.064Z","schemaVersion":2},"datasetVersion":"2026-09-12T17:17:11.597Z"}