{"record":{"id":"b708cca6a2bb2427","repo":"derailed/k9s","slug":"container-is-not-ready","errorCode":null,"errorMessage":"container is not ready","messagePattern":"container is not ready","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"internal/render/container.go","lineNumber":154,"sourceCode":"\t\tclient.ToPercentageStr(cur.mem, res.mem),\n\t\tclient.ToPercentageStr(cur.mem, res.lmem),\n\t\ttoMc(res.gpu) + \":\" + toMc(res.lgpu),\n\t\tToContainerPorts(cr.Container.Ports),\n\t\tAsStatus(c.diagnose(state, ready)),\n\t\tToAge(cr.Age),\n\t}\n\n\treturn nil\n}\n\n// Happy returns true if resource is happy, false otherwise.\nfunc (Container) diagnose(state, ready string) error {\n\tif state == \"Completed\" {\n\t\treturn nil\n\t}\n\n\tif ready == falseStr {\n\t\treturn errors.New(\"container is not ready\")\n\t}\n\treturn nil\n}\n\n// ----------------------------------------------------------------------------\n// Helpers...\n\nfunc containerRequests(co *v1.Container) v1.ResourceList {\n\treq := co.Resources.Requests\n\tif len(req) != 0 {\n\t\treturn req\n\t}\n\tlim := co.Resources.Limits\n\tif len(lim) != 0 {\n\t\treturn lim\n\t}\n\n\treturn nil","sourceCodeStart":136,"sourceCodeEnd":172,"githubUrl":"https://github.com/derailed/k9s/blob/2d3ccc6ba2ce98c3781bfc441bb3e884f072774f/internal/render/container.go#L136-L172","documentation":"Container.diagnose drives the rollup health of the containers view: state 'Completed' is accepted as terminal-OK, otherwise a ready flag of false yields 'container is not ready'. It marks the row/container as unhealthy for display and for parent health aggregation — it does not block any operation.","triggerScenarios":"Listing containers for a pod where a container reports ready=false — startup probes not yet satisfied, crash loops, failed readiness probes, init containers still running.","commonSituations":"Inspecting pods during rollout (new containers not ready yet); apps with long startup times without a startupProbe; misconfigured readiness probes failing after deploys; Jobs whose sidecars show not-ready while the main container completed.","solutions":["Describe the container's probes: kubectl describe pod <p> and check readiness/startup probe configuration and thresholds.","For slow-starting apps add a startupProbe so readiness is not judged during boot.","If the state is transient (rollout), simply wait and re-list — the flag clears when ready flips true."],"exampleFix":null,"handlingStrategy":"validation","validationCode":"func containerHealthy(state, ready string) bool {\n    return state == \"Completed\" || ready != \"false\"\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Add startupProbes for slow-starting containers.","Verify readiness probe thresholds during rollouts before treating the flag as an incident.","Remember 'Completed' containers are intentionally not flagged."],"tags":["go","kubernetes","container","readiness","health-status"],"backgroundTag":null,"analyzedSha":"2d3ccc6ba2ce98c3781bfc441bb3e884f072774f","analyzedAt":"2026-08-15T16:09:14.432Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}