GoogleContainerTools/skaffold · error
parsing manifests file into manifest list object: %w
Error message
parsing manifests file into manifest list object: %w
What it means
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.
Source
Thrown at pkg/skaffold/deploy/util/util.go:188
Resource: r.Name,
}, nil
}
}
return false, schema.GroupVersionResource{}, fmt.Errorf("could not find resource for %s", gvk.String())
}
func GetManifestsFromHydratedManifests(ctx context.Context, hydratedManifests []string) (manifest.ManifestList, error) {
var manifests manifest.ManifestList
for _, path := range hydratedManifests {
f, err := os.Open(path)
if err != nil {
return nil, fmt.Errorf("opening hydrated manifest at %s: %w", path, err)
}
defer f.Close()
ms, err := manifest.Load(f)
if err != nil {
return nil, fmt.Errorf("parsing manifests file into manifest list object: %w", err)
}
manifests = append(manifests, ms...)
}
return manifests, nil
}
type tagErr struct {
tag string
err error
}
// ImageTags generates tags for a list of artifacts
func ImageTags(ctx context.Context, runCtx *runcontext.RunContext, tagger tag.Tagger, out io.Writer, artifacts []*latest.Artifact) (tag.ImageTags, error) {
start := time.Now()
maxWorkers := runtime.GOMAXPROCS(0)
if len(artifacts) > 0 {View on GitHub (pinned to a1189de023)
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
Example fix
// before
ms, err := manifest.Load(f)
if err != nil {
return nil, fmt.Errorf("parsing manifests file into manifest list object: %w", err)
}
// after
ms, err := manifest.Load(f)
if err != nil {
return nil, fmt.Errorf("parsing manifests file into manifest list object: %w", err)
} Defensive patterns
Strategy: validation
Validate before calling
func validateManifestYAML(path string) error {
data, err := os.ReadFile(path)
if err != nil {
return err
}
if len(bytes.TrimSpace(data)) == 0 {
return fmt.Errorf("manifest file %s is empty", path)
}
var docs []map[string]interface{}
if err := yaml.Unmarshal(data, &docs); err != nil {
return fmt.Errorf("manifest file %s is not valid YAML: %w", path, err)
}
return nil
} Try / catch
manifests, err := GetManifestsFromHydratedManifests(ctx, paths)
if err != nil {
if strings.Contains(err.Error(), "parsing manifests file") {
return fmt.Errorf("hydrated output invalid — regenerate via hydrate step: %w", err)
}
return err
} Prevention
- 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
When it happens
Trigger: 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).
Common situations: 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.
Related errors
- reading Kubernetes YAML: %w
- invalid local-registry-hosting ConfigMap
- CONFIG_MISSING_MANIFEST_FILE_ERR
- rendering manifests: %w
- rendering manifests: %w
AI-assisted analysis of GoogleContainerTools/skaffold@a1189de023 (2026-09-05).
Data as JSON: /api/errors/d2f8e0bee6b303da.
Report an issue: GitHub.