{"record":{"id":"2302de3096b2efba","repo":"derailed/k9s","slug":"mismatch-desired-d-vs-ready-d","errorCode":null,"errorMessage":"mismatch desired(%d) vs ready(%d)","messagePattern":"mismatch desired\\((.+?)\\) vs ready\\((.+?)\\)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"internal/render/rs.go","lineNumber":104,"sourceCode":"\t\tstrconv.Itoa(int(*rs.Spec.Replicas)),\n\t\tstrconv.Itoa(int(rs.Status.Replicas)),\n\t\tstrconv.Itoa(int(rs.Status.ReadyReplicas)),\n\t\tstrings.Join(cos, \",\"),\n\t\tstrings.Join(imgs, \",\"),\n\t\tmapToStr(rs.Labels),\n\t\tAsStatus(r.diagnose(&rs)),\n\t\tToAge(rs.GetCreationTimestamp()),\n\t}\n\n\treturn nil\n}\n\nfunc (ReplicaSet) diagnose(rs *appsv1.ReplicaSet) error {\n\tif rs.Status.Replicas != rs.Status.ReadyReplicas {\n\t\tif rs.Status.Replicas == 0 {\n\t\t\treturn fmt.Errorf(\"did not phase down correctly expecting 0 replicas but got %d\", rs.Status.ReadyReplicas)\n\t\t}\n\t\treturn fmt.Errorf(\"mismatch desired(%d) vs ready(%d)\", rs.Status.Replicas, rs.Status.ReadyReplicas)\n\t}\n\n\treturn nil\n}\n","sourceCodeStart":86,"sourceCodeEnd":109,"githubUrl":"https://github.com/derailed/k9s/blob/2d3ccc6ba2ce98c3781bfc441bb3e884f072774f/internal/render/rs.go#L86-L109","documentation":"ReplicaSet.diagnose compares rs.Status.Replicas with rs.Status.ReadyReplicas; when they differ (and replicas>0) it returns 'mismatch desired(N) vs ready(M)', rendered into the VALID column by AsStatus. 'desired' here is the current replica count, so the message means the RS has pods that are created but not ready. It is a workload health signal, not a rendering error, and it never escapes Render.","triggerScenarios":"Pods stuck unready: CrashLoopBackOff, ImagePullBackOff, insufficient CPU/memory, Pending on an unschedulable node, PDB or taint blocks; viewing the RS view mid-rollout while replacement pods start.","commonSituations":"Bad image tag or missing registry credentials; resource quotas exhausted; node pressure; rolling updates observed mid-progress; failing readiness probes.","solutions":["Run kubectl describe rs <name> and read Events for pod failures","Inspect unready pods (kubectl get pods -l <selector>, then describe) for the exact reason","Fix the root cause: image, resources, probes, or scheduling constraints","If mid-rollout, wait with kubectl rollout status rs/<name>"],"exampleFix":"# before: desired 2, ready 0 — pods in ImagePullBackOff\nkubectl get pods -l app=myrs\n# after: correct the image and let it roll\nkubectl set image rs/myrs app=repo/app:fixed-tag\nkubectl rollout status rs/myrs","handlingStrategy":"validation","validationCode":"# catch the condition before it renders\nkubectl get rs -o json | jq '.items[] | select(.status.replicas != .status.readyReplicas) | {name:.metadata.name, replicas:.status.replicas, ready:.status.readyReplicas}'","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Watch rollout completion with kubectl rollout status instead of eyeballing counts","Keep readiness probes, image tags, and resource requests correct so pods go ready","Run kubectl describe rs and pod events at the first VALID-column mismatch","Treat the message as workload health, not a UI failure"],"tags":["kubernetes","workloads","replicaset","cluster-state","health","k9s"],"backgroundTag":null,"analyzedSha":"2d3ccc6ba2ce98c3781bfc441bb3e884f072774f","analyzedAt":"2026-08-15T16:09:14.432Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}