{"record":{"id":"12922975b8ced306","repo":"helm/helm","slug":"pod-s-failed","errorCode":null,"errorMessage":"pod %s failed","messagePattern":"pod (.+?) failed","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/kube/wait.go","lineNumber":333,"sourceCode":"\treturn false, nil\n}\n\n// waitForPodSuccess is a helper that waits for a pod to complete.\n//\n// This operates on an event returned from a watcher.\nfunc (hw *legacyWaiter) waitForPodSuccess(obj runtime.Object, name string) (bool, error) {\n\to, ok := obj.(*corev1.Pod)\n\tif !ok {\n\t\treturn true, fmt.Errorf(\"expected %s to be a *v1.Pod, got %T\", name, obj)\n\t}\n\n\tswitch o.Status.Phase {\n\tcase corev1.PodSucceeded:\n\t\tslog.Debug(\"pod succeeded\", \"pod\", o.Name)\n\t\treturn true, nil\n\tcase corev1.PodFailed:\n\t\tslog.Error(\"pod failed\", \"pod\", o.Name)\n\t\treturn true, fmt.Errorf(\"pod %s failed\", o.Name)\n\tcase corev1.PodPending:\n\t\tslog.Debug(\"pod pending\", \"pod\", o.Name)\n\tcase corev1.PodRunning:\n\t\tslog.Debug(\"pod running\", \"pod\", o.Name)\n\tcase corev1.PodUnknown:\n\t\tslog.Debug(\"pod unknown\", \"pod\", o.Name)\n\t}\n\n\treturn false, nil\n}\n\nfunc (hw *legacyWaiter) contextWithTimeout(timeout time.Duration) (context.Context, context.CancelFunc) {\n\treturn contextWithTimeout(hw.ctx, timeout)\n}\n","sourceCodeStart":315,"sourceCodeEnd":348,"githubUrl":"https://github.com/helm/helm/blob/2a29f1770b62844b27197d2507377361d45ad7c0/pkg/kube/wait.go#L315-L348","documentation":"Returned by legacyWaiter.waitForPodSuccess (pkg/kube/wait.go:333) when a watched Pod's Status.Phase is PodFailed. --wait treats a failed Pod as terminal (the message names the pod), stopping the wait immediately instead of blocking until timeout.","triggerScenarios":"helm install/upgrade --wait on a release with bare Pods (or hook pods) whose phase becomes Failed: container exits non-zero, image pull failure ends the pod, node pressure evicts with phase Failed, or OOMKill.","commonSituations":"Bare pod charts running setup jobs that crash; init containers failing on missing secrets; images with wrong entrypoints; memory limits causing OOMKilled containers.","solutions":["Fetch the pod's status and logs: kubectl describe pod <name> and kubectl logs <name> --all-containers.","Fix the container failure (command, image, env, resource limits).","If the pod is doing one-shot work, model it as a Job with backoffLimit so retries happen before Helm fails.","Raise memory/CPU limits if the failure is OOMKilled/Evicted."],"exampleFix":"# before: one-shot pod dies and fails the release\nresources:\n  limits:\n    memory: 64Mi\n\n# after: limits that fit the workload (and prefer a Job for retries)\nresources:\n  limits:\n    memory: 256Mi","handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"if err := installWithWait(); err != nil {\n\tif m := regexp.MustCompile(`pod (\\S+) failed`).FindStringSubmatch(err.Error()); m != nil {\n\t\t// pull kubectl logs for m[1] and present the container failure\n\t}\n}","preventionTips":["Model one-shot work as Jobs (with retries) rather than bare Pods.","Set resource limits that fit the container to avoid OOMKill/Eviction failures.","Verify image tags and entrypoints in CI before deploying with --wait."],"tags":["kubernetes","pod","wait","failure","crashloop"],"backgroundTag":null,"analyzedSha":"2a29f1770b62844b27197d2507377361d45ad7c0","analyzedAt":"2026-08-15T22:02:47.490Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}