GoogleContainerTools/skaffold · error

getting manifests from hydrated manifests: %w

Error message

getting manifests from hydrated manifests: %w

What it means

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.

Source

Thrown at pkg/skaffold/runner/apply.go:41

	"time"

	deployutil "github.com/GoogleContainerTools/skaffold/v2/pkg/skaffold/deploy/util"
	"github.com/GoogleContainerTools/skaffold/v2/pkg/skaffold/event"
	"github.com/GoogleContainerTools/skaffold/v2/pkg/skaffold/graph"
	"github.com/GoogleContainerTools/skaffold/v2/pkg/skaffold/instrumentation"
	"github.com/GoogleContainerTools/skaffold/v2/pkg/skaffold/kubernetes/manifest"
)

// Apply sends Kubernetes manifests to the cluster.
func (r *SkaffoldRunner) Apply(ctx context.Context, out io.Writer) error {
	var manifests manifest.ManifestList
	var err error
	manifests, err = deployutil.GetManifestsFromHydratedManifests(ctx, r.runCtx.HydratedManifests())
	manifestsByConfig := manifest.NewManifestListByConfig()
	manifestsByConfig.Add(r.deployer.ConfigName(), manifests)

	if err != nil {
		return fmt.Errorf("getting manifests from hydrated manifests: %w", err)
	}
	if err := r.applyResources(ctx, out, nil, nil, manifestsByConfig); err != nil {
		return err
	}

	statusCheckOut, postStatusCheckFn, err := deployutil.WithStatusCheckLogFile(time.Now().Format(deployutil.TimeFormat)+".log", out, r.runCtx.Muted())
	postStatusCheckFn()
	if err != nil {
		return err
	}
	sErr := r.deployer.GetStatusMonitor().Check(ctx, statusCheckOut)
	return sErr
}

func (r *SkaffoldRunner) applyResources(ctx context.Context, out io.Writer, artifacts, _ []graph.Artifact, list manifest.ManifestListByConfig) error {
	deployOut, postDeployFn, err := deployutil.WithLogFile(time.Now().Format(deployutil.TimeFormat)+".log", out, r.runCtx.Muted())
	if err != nil {
		return err

View on GitHub (pinned to a1189de023)

Solutions

  1. Run `skaffold render` before `skaffold apply` so hydrated manifests exist
  2. Verify the hydrated manifests file path (default .kpt-pipeline/manifests.yaml or --hydrated-manifests flag) exists and contains valid YAML
  3. Regenerate the file if it was deleted or corrupted between steps
  4. Inspect the wrapped error to distinguish missing-file vs parse failure

Example fix

// before
skaffold apply --hydrated-manifests=missing.yaml
// after
skaffold render
skaffold apply
Defensive patterns

Strategy: validation

Validate before calling

for _, f := range hydratedManifests {
    fi, err := os.Stat(f)
    if err != nil || fi.Size() == 0 {
        return fmt.Errorf("hydrated manifest %s missing/empty — run `skaffold render` first", f)
    }
}

Try / catch

if err := r.Apply(ctx, out); err != nil && strings.Contains(err.Error(), "getting manifests from hydrated manifests") {
    return fmt.Errorf("no valid hydrated manifests; run `skaffold render` before `skaffold apply`: %w", err)
}

Prevention

When it happens

Trigger: 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.

Common situations: 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.

Related errors


AI-assisted analysis of GoogleContainerTools/skaffold@a1189de023 (2026-09-05). Data as JSON: /api/errors/fcb916fbe092493b. Report an issue: GitHub.