{"record":{"id":"08b730841d2f8c43","repo":"GoogleContainerTools/skaffold","slug":"nothing-to-deploy","errorCode":null,"errorMessage":"nothing to deploy","messagePattern":"nothing to deploy","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/skaffold/deploy/kubectl/kubectl.go","lineNumber":232,"sourceCode":"\t// if any hydrated manifests are passed to `skaffold apply`, only deploy these\n\t// also, manually set the labels to ensure the runID is added\n\tif len(k.hydratedManifests) > 0 {\n\t\t_, endTrace = instrumentation.StartTrace(ctx, \"Deploy_readHydratedManifests\")\n\t\tmanifests, err = k.kubectl.ReadManifests(ctx, k.hydratedManifests)\n\t\tif err != nil {\n\t\t\tendTrace(instrumentation.TraceEndError(err))\n\t\t\treturn err\n\t\t}\n\t\tmanifests, err = manifests.SetLabels(k.labeller.Labels(), manifest.NewResourceSelectorLabels(k.transformableAllowlist, k.transformableDenylist))\n\t\tendTrace()\n\t}\n\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tif len(manifests) == 0 {\n\t\treturn fmt.Errorf(\"nothing to deploy\")\n\t}\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\tchildCtx, endTrace = instrumentation.StartTrace(ctx, \"Deploy_LoadImages\")\n\tif err := k.imageLoader.LoadImages(childCtx, out, k.localImages, k.originalImages, builds); err != nil {\n\t\tendTrace(instrumentation.TraceEndError(err))\n\t\treturn err\n\t}\n\tendTrace()\n","sourceCodeStart":214,"sourceCodeEnd":250,"githubUrl":"https://github.com/GoogleContainerTools/skaffold/blob/a1189de023efc32d4b8e11f395acc678aa555011/pkg/skaffold/deploy/kubectl/kubectl.go#L214-L250","documentation":"After rendering/loading manifests, the kubectl deployer checks whether there is anything to deploy. If the manifest list is empty (no resources matched the configured manifests), Deploy aborts with 'nothing to deploy'. This guards against silently succeeding while deploying zero resources.","triggerScenarios":"len(manifests) == 0 in kubectl Deploy — the hydrated/rendered input produced no documents: empty hydrated manifests, --hydration filter removed everything, or the manifest files/paths resolved to empty output.","commonSituations":"`skaffold apply --hydrated-manifests=file` pointing at an empty file; kustomize/hydration output empty due to a misconfigured kustomization.yaml; all resources filtered out by labels/paths in the skaffold.yaml kubectl deploy config.","solutions":["Check that the configured manifest paths / hydrated manifests files exist and are non-empty (cat the file).","Fix kustomization.yaml / hydration so rendered output contains resources (run kustomize build manually).","Review skaffold.yaml kubectl deploy manifests config for wrong paths or filtering.","If intentionally deploying nothing, skip the deploy step instead of invoking Deploy."],"exampleFix":"// before: skaffold.yaml points at empty file\nmanifests: { rawYaml: [out/empty.yaml] }\n// after\nmanifests: { rawYaml: [k8s/*.yaml] }","handlingStrategy":"validation","validationCode":"// Ensure rendered manifests are non-empty before deploying\ninfo, err := os.Stat(hydratedFile)\nif err != nil || info.Size() == 0 {\n    return fmt.Errorf(\"hydrated manifests %s are empty; fix hydration\", hydratedFile)\n}","typeGuard":null,"tryCatchPattern":"if err := deployer.Deploy(ctx, out, artifacts); err != nil {\n    if strings.Contains(err.Error(), \"nothing to deploy\") {\n        log.Errorf(\"no manifests resolved — check skaffold.yaml manifest paths\")\n    }\n    return err\n}","preventionTips":["Verify configured manifest paths match real files (non-empty rendered output)","Run kustomize build / hydration locally and inspect output","Fail CI if hydration produces zero documents","Review skaffold.yaml kubectl manifests config for typos"],"tags":["kubectl","kubernetes","manifests","empty-input"],"backgroundTag":"no-manifests-to-deploy","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"}