{"record":{"id":"fd1e21fdbde4bfbc","repo":"GoogleContainerTools/skaffold","slug":"failed-to-deploy-w","errorCode":null,"errorMessage":"failed to deploy: %w","messagePattern":"failed to deploy: %w","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cmd/skaffold/app/cmd/run.go","lineNumber":69,"sourceCode":"\t\tif !opts.SkipTests {\n\t\t\terr = r.Test(ctx, out, bRes)\n\t\t\tif err != nil {\n\t\t\t\treturn fmt.Errorf(\"failed to test: %w\", err)\n\t\t\t}\n\t\t}\n\n\t\t// Render\n\t\tmanifestList, err := r.Render(ctx, out, bRes, false)\n\t\tif err != nil {\n\t\t\treturn fmt.Errorf(\"rendering manifests: %w\", err)\n\t\t}\n\t\tif opts.RenderOnly {\n\t\t\treturn manifest.Write(manifestList.String(), opts.RenderOutput, out)\n\t\t}\n\n\t\terr = r.DeployAndLog(ctx, out, bRes, manifestList)\n\t\tif err != nil {\n\t\t\treturn fmt.Errorf(\"failed to deploy: %w\", err)\n\t\t}\n\n\t\ttips.PrintForRun(out, opts)\n\n\t\treturn nil\n\t})\n}\n","sourceCodeStart":51,"sourceCodeEnd":77,"githubUrl":"https://github.com/GoogleContainerTools/skaffold/blob/a1189de023efc32d4b8e11f395acc678aa555011/cmd/skaffold/app/cmd/run.go#L51-L77","documentation":"This error wraps any failure from the deploy phase of `skaffold run`. After builds and rendering succeed, r.DeployAndLog applies the manifests to the Kubernetes cluster; any deploy error (kubectl/helm failure, cluster unreachable) is wrapped here.","triggerScenarios":"Running `skaffold run` when DeployAndLog fails: kubectl apply errors, cluster connection refused, namespace missing, image pull failures, or helm deploy failures.","commonSituations":"kubectl context points to a nonexistent cluster; RBAC denies apply; invalid manifest rejected by API server; wrong kubeconfig in CI.","solutions":["Read the wrapped cause after 'failed to deploy:' for the kubectl/helm error","Verify cluster connectivity: kubectl cluster-info and kubectl config current-context","Run `skaffold deploy` (after a successful build) to isolate the deploy step","Fix the underlying cause: correct kubecontext, create missing namespaces, or fix rejected manifests"],"exampleFix":"// before\nkubectl config use-context prod-cluster // cluster unreachable\n// after\nkubectl config use-context dev-cluster && skaffold run","handlingStrategy":"try-catch","validationCode":"kubectl cluster-info --context $(kubectl config current-context) >/dev/null && echo 'cluster reachable'","typeGuard":null,"tryCatchPattern":"err := r.DeployAndLog(ctx, out, bRes, manifestList)\nif err != nil {\n\tif errors.Is(err, context.DeadlineExceeded) {\n\t\t// retry or increase timeout\n\t}\n\treturn fmt.Errorf(\"failed to deploy: %w\", err)\n}","preventionTips":["Verify kubecontext and cluster reachability before running skaffold run","Pre-validate manifests with `kubectl apply --dry-run=server`","Use --default-repo and correct registry credentials to avoid pull errors","Isolate deploy issues by running `skaffold deploy` separately"],"tags":["skaffold","deploy","kubernetes","cluster"],"backgroundTag":"deploy-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"}