{"record":{"id":"fcb916fbe092493b","repo":"GoogleContainerTools/skaffold","slug":"getting-manifests-from-hydrated-manifests-w","errorCode":null,"errorMessage":"getting manifests from hydrated manifests: %w","messagePattern":"getting manifests from hydrated manifests: %w","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/skaffold/runner/apply.go","lineNumber":41,"sourceCode":"\t\"time\"\n\n\tdeployutil \"github.com/GoogleContainerTools/skaffold/v2/pkg/skaffold/deploy/util\"\n\t\"github.com/GoogleContainerTools/skaffold/v2/pkg/skaffold/event\"\n\t\"github.com/GoogleContainerTools/skaffold/v2/pkg/skaffold/graph\"\n\t\"github.com/GoogleContainerTools/skaffold/v2/pkg/skaffold/instrumentation\"\n\t\"github.com/GoogleContainerTools/skaffold/v2/pkg/skaffold/kubernetes/manifest\"\n)\n\n// Apply sends Kubernetes manifests to the cluster.\nfunc (r *SkaffoldRunner) Apply(ctx context.Context, out io.Writer) error {\n\tvar manifests manifest.ManifestList\n\tvar err error\n\tmanifests, err = deployutil.GetManifestsFromHydratedManifests(ctx, r.runCtx.HydratedManifests())\n\tmanifestsByConfig := manifest.NewManifestListByConfig()\n\tmanifestsByConfig.Add(r.deployer.ConfigName(), manifests)\n\n\tif err != nil {\n\t\treturn fmt.Errorf(\"getting manifests from hydrated manifests: %w\", err)\n\t}\n\tif err := r.applyResources(ctx, out, nil, nil, manifestsByConfig); err != nil {\n\t\treturn err\n\t}\n\n\tstatusCheckOut, postStatusCheckFn, err := deployutil.WithStatusCheckLogFile(time.Now().Format(deployutil.TimeFormat)+\".log\", out, r.runCtx.Muted())\n\tpostStatusCheckFn()\n\tif err != nil {\n\t\treturn err\n\t}\n\tsErr := r.deployer.GetStatusMonitor().Check(ctx, statusCheckOut)\n\treturn sErr\n}\n\nfunc (r *SkaffoldRunner) applyResources(ctx context.Context, out io.Writer, artifacts, _ []graph.Artifact, list manifest.ManifestListByConfig) error {\n\tdeployOut, postDeployFn, err := deployutil.WithLogFile(time.Now().Format(deployutil.TimeFormat)+\".log\", out, r.runCtx.Muted())\n\tif err != nil {\n\t\treturn err","sourceCodeStart":23,"sourceCodeEnd":59,"githubUrl":"https://github.com/GoogleContainerTools/skaffold/blob/a1189de023efc32d4b8e11f395acc678aa555011/pkg/skaffold/runner/apply.go#L23-L59","documentation":"During `skaffold apply`, Apply reads the hydrated manifests written by a prior render step via GetManifestsFromHydratedManifests. If that read/parse fails (no hydrated manifests file, empty, or invalid YAML list), this error wraps the cause before any resources are applied.","triggerScenarios":"Apply (runner/apply.go) invoked via `skaffold apply` without a prior render producing hydrated manifests, or hydratedManifests() pointing to files that are missing/empty/unparseable.","commonSituations":"Running `skaffold apply` in a fresh checkout without running `skaffold render` first; custom --hydrated-manifests path that doesn't exist; hydrated manifests file truncated or edited by another tool.","solutions":["Run `skaffold render` before `skaffold apply` so hydrated manifests exist","Verify the hydrated manifests file path (default .kpt-pipeline/manifests.yaml or --hydrated-manifests flag) exists and contains valid YAML","Regenerate the file if it was deleted or corrupted between steps","Inspect the wrapped error to distinguish missing-file vs parse failure"],"exampleFix":"// before\nskaffold apply --hydrated-manifests=missing.yaml\n// after\nskaffold render\nskaffold apply","handlingStrategy":"validation","validationCode":"for _, f := range hydratedManifests {\n    fi, err := os.Stat(f)\n    if err != nil || fi.Size() == 0 {\n        return fmt.Errorf(\"hydrated manifest %s missing/empty — run `skaffold render` first\", f)\n    }\n}","typeGuard":null,"tryCatchPattern":"if err := r.Apply(ctx, out); err != nil && strings.Contains(err.Error(), \"getting manifests from hydrated manifests\") {\n    return fmt.Errorf(\"no valid hydrated manifests; run `skaffold render` before `skaffold apply`: %w\", err)\n}","preventionTips":["Always run render before apply in pipelines","Persist hydrated manifests as a CI artifact between render and apply jobs","Verify custom --hydrated-manifests paths exist before invoking apply"],"tags":["apply","hydrated-manifests","skaffold"],"backgroundTag":"hydrated-manifests-missing","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"}