{"record":{"id":"b1da1e7a27ac1e06","repo":"GoogleContainerTools/skaffold","slug":"could-not-read-the-hydrated-manifest-from-v-w","errorCode":null,"errorMessage":"could not read the hydrated manifest from %v: %w","messagePattern":"could not read the hydrated manifest from (.+?): %w","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/skaffold/deploy/kpt/kpt.go","lineNumber":321,"sourceCode":"\t\tif err = os.WriteFile(kptFilePath, configByte, 0644); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\treturn nil\n}\n\nfunc (k *Deployer) Deploy(ctx context.Context, out io.Writer, builds []graph.Artifact, _ manifest.ManifestListByConfig) error {\n\tif err := kptInitFunc(ctx, out, k); err != nil {\n\t\treturn err\n\t}\n\n\tinstrumentation.AddAttributesToCurrentSpanFromContext(ctx, map[string]string{\n\t\t\"DeployerType\": deployerName,\n\t})\n\t_, endTrace := instrumentation.StartTrace(ctx, \"Deploy_ReadHydratedManifests\")\n\tmanifests, err := k.getManifests(ctx)\n\tif err != nil {\n\t\tevent.DeployInfoEvent(fmt.Errorf(\"could not read the hydrated manifest from %v: %w\", k.applyDir, err))\n\t}\n\tendTrace()\n\n\t// Add debug transformations\n\tdebugHelpersRegistry, err := config.GetDebugHelpersRegistry(k.globalConfig)\n\tif err != nil {\n\t\treturn err\n\t}\n\tif manifests, err = manifest.ApplyTransforms(manifests, builds, k.insecureRegistries, debugHelpersRegistry); err != nil {\n\t\treturn err\n\t}\n\n\t_, endTrace = instrumentation.StartTrace(ctx, \"Deploy_CollectNamespaces\")\n\tnamespaces, err := manifests.CollectNamespaces()\n\tif err != nil {\n\t\tevent.DeployInfoEvent(fmt.Errorf(\"could not fetch deployed resource namespace. \"+\n\t\t\t\"This might cause port-forward and deploy health-check to fail: %w\", err))\n\t}","sourceCodeStart":303,"sourceCodeEnd":339,"githubUrl":"https://github.com/GoogleContainerTools/skaffold/blob/a1189de023efc32d4b8e11f395acc678aa555011/pkg/skaffold/deploy/kpt/kpt.go#L303-L339","documentation":"The kpt deployer reads hydrated manifests from k.applyDir before deploying. If reading that directory fails (getManifests error), the deployer reports this DeployInfoEvent describing the unreadable hydrated manifest path. It is logged as an event rather than aborting immediately, but downstream deploy steps will lack manifests.","triggerScenarios":"k.getManifests(ctx) fails during Deploy — e.g. applyDir does not exist, is not readable, or hydration (kpt fn render) never produced output files at k.applyDir.","commonSituations":"kpt pipeline hydration failed silently in a prior step; wrong `--kpt-hydrated-manifests` / applyDir path; running apply on a fresh checkout without hydrating first; filesystem permissions on the output directory.","solutions":["Check the log for the wrapped root cause (%w) and fix the underlying read error (missing/renamed applyDir, permissions).","Run the kpt hydration step (`kpt fn render`) and verify manifests exist in the applyDir before deploying.","Correct the skaffold kpt deployer's applyDir/hydratedManifests configuration paths.","Re-run `skaffold dev/deploy` after cleaning the hydration output directory."],"exampleFix":"// before: deploying without hydrating\nskaffold apply --kpt-hydrated-manifests=out/hydrated\n// after: hydrate first\nkpt fn render -i base -o out/hydrated\nskaffold apply --kpt-hydrated-manifests=out/hydrated","handlingStrategy":"validation","validationCode":"// Check hydrated manifests exist before applying\nif _, err := os.Stat(k.applyDir); err != nil {\n    return fmt.Errorf(\"applyDir %s missing; run kpt fn render first: %w\", k.applyDir, err)\n}","typeGuard":null,"tryCatchPattern":"// Wrap and surface the DeployInfoEvent root cause\ncmd, err := run()\nif errors.As(err, &fsErr) {\n    log.Fatalf(\"hydrated manifest unreadable at %s: %v\", applyDir, fsErr)\n}","preventionTips":["Always run the hydration step (kpt fn render) before skaffold apply","Verify applyDir exists and is readable in CI before deploying","Use fixed, absolute paths for hydrated manifests","Fail fast on hydration errors instead of letting the deployer discover them"],"tags":["kpt","kubernetes","manifests","file-io"],"backgroundTag":"hydrated-manifest-read-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"}