{"record":{"id":"5c3a8c8b6de66dc4","repo":"derailed/k9s","slug":"container-ready-check-failed-d-of-d","errorCode":null,"errorMessage":"container ready check failed: %d of %d","messagePattern":"container ready check failed: (.+?) of (.+?)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"internal/render/pod.go","lineNumber":247,"sourceCode":"\tcr, _, _, _ := p.ContainerStats(st.ContainerStatuses)\n\tct := len(st.ContainerStatuses)\n\n\ticr, ict, _ := p.initContainerStats(spec.InitContainers, st.InitContainerStatuses)\n\tcr += icr\n\tct += ict\n\n\tready := hasPodReadyCondition(st.Conditions)\n\trgr, rgt := p.readinessGateStats(spec, &st)\n\n\treturn p.diagnose(phase, cr, ct, ready, rgr, rgt)\n}\n\nfunc (*Pod) diagnose(phase string, cr, ct int, ready bool, rgr, rgt int) error {\n\tif phase == Completed {\n\t\treturn nil\n\t}\n\tif cr != ct || ct == 0 {\n\t\treturn fmt.Errorf(\"container ready check failed: %d of %d\", cr, ct)\n\t}\n\tif rgt > 0 && rgr != rgt {\n\t\treturn fmt.Errorf(\"readiness gate check failed: %d of %d\", rgr, rgt)\n\t}\n\tif !ready {\n\t\treturn fmt.Errorf(\"pod condition ready is false\")\n\t}\n\tif phase == Terminating {\n\t\treturn fmt.Errorf(\"pod is terminating\")\n\t}\n\n\treturn nil\n}\n\n// ----------------------------------------------------------------------------\n// Helpers...\n\nfunc asNominated(n string) string {","sourceCodeStart":229,"sourceCodeEnd":265,"githubUrl":"https://github.com/derailed/k9s/blob/2d3ccc6ba2ce98c3781bfc441bb3e884f072774f/internal/render/pod.go#L229-L265","documentation":"Pod.diagnose first gate: if the count of ready containers differs from total containers (cr != ct), or the pod declares zero containers (ct == 0), it reports 'container ready check failed: X of Y'. Completed pods short-circuit before this check.","triggerScenarios":"Multi-container pod where sidecar/main containers are still starting or crashing; init containers finished but app container not ready; ct == 0 for degenerate pod specs.","commonSituations":"Slow image pulls; crashlooping sidecars (envoy, log shippers); readiness probes not yet passing; pods viewed seconds after creation.","solutions":["kubectl describe pod <name> to see container states and probe results","kubectl logs <pod> -c <container> for the not-ready container","Fix the container (image, command, probe, resources) so it reaches Ready","Give it a moment if the pod was just created — pull and probe delays are normal"],"exampleFix":"# before: probe hits wrong port, container never ready\nreadinessProbe:\n  httpGet: {path: /ready, port: 80}\n# after\nreadinessProbe:\n  httpGet: {path: /ready, port: 8080}","handlingStrategy":"fallback","validationCode":"ready, total := 0, len(pod.Spec.Containers)\nfor _, cs := range pod.Status.ContainerStatuses {\n\tif cs.Ready {\n\t\tready++\n\t}\n}\nif ready == total && total > 0 {\n\t// container-level check will pass\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Make readiness probes match the actual serving port/path","Pre-pull images or use sane pull policies to shorten not-ready windows","Don't alert on container-ready mismatches for freshly created pods — give probes time"],"tags":["pod","containers","readiness","kubernetes"],"backgroundTag":null,"analyzedSha":"2d3ccc6ba2ce98c3781bfc441bb3e884f072774f","analyzedAt":"2026-08-15T16:09:14.432Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}