{"record":{"id":"0ed6ca0588e7ea97","repo":"kubernetes/kops","slug":"not-all-objects-were-healthy","errorCode":null,"errorMessage":"not all objects were healthy","messagePattern":"not all objects were healthy","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"channels/pkg/channels/clientapplier.go","lineNumber":85,"sourceCode":"\t}\n\tif err := s.SetDesiredObjects(applyableObjects); err != nil {\n\t\treturn err\n\t}\n\n\tresults, err := s.ApplyOnce(ctx)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"failed to apply objects: %w\", err)\n\t}\n\n\t// TODO: Implement pruning\n\n\tif !results.AllApplied() {\n\t\treturn fmt.Errorf(\"not all objects were applied\")\n\t}\n\n\t// TODO: Check object health status\n\tif !results.AllHealthy() {\n\t\treturn fmt.Errorf(\"not all objects were healthy\")\n\t}\n\n\treturn nil\n}\n","sourceCodeStart":67,"sourceCodeEnd":90,"githubUrl":"https://github.com/kubernetes/kops/blob/4c8573c808a73d578c5eadc86d410646ea0b0d73/channels/pkg/channels/clientapplier.go#L67-L90","documentation":"After confirming all objects were applied, ClientApplier.Apply verifies health via results.AllHealthy(). If any applied object is not healthy, this error is returned. The objects exist on the cluster but have not converged to a healthy state (e.g. a Deployment not yet available or a CR reporting an unhealthy status).","triggerScenarios":"results.AllHealthy() returning false — an object was created/patched but its health check fails, e.g. a Deployment with unavailable replicas, a CRD not established, or a resource stuck Pending.","commonSituations":"Applying an addon whose pods fail to schedule (insufficient capacity, taints), images that can't be pulled, CRDs still being processed, or checking health immediately after apply without allowing convergence time.","solutions":["kubectl get/describe the applied objects to find which are unhealthy and why.","Check pod events for scheduling/image errors if a Deployment is unhealthy.","Wait for the resource to become ready (rollout status) and re-check; consider adding retry/wait logic around Apply.","Ensure CRDs are Established before applying their custom resources.","Fix the underlying workload issue exposed by the manifest (replicas, resources, image tags)."],"exampleFix":"// before\nerr := applier.Apply(ctx, manifest)\n// after\nerr := applier.Apply(ctx, manifest)\nif err != nil { return err }\n// allow workloads to converge, then verify\nif err := wait.PollUntilContextTimeout(ctx, 5*time.Second, 5*time.Minute, true, func(ctx context.Context) (bool, error) {\n    return deploymentsHealthy(ctx, client), nil\n}); err != nil { return err }","handlingStrategy":"fallback","validationCode":null,"typeGuard":"func isUnhealthyResult(err error) bool {\n    return strings.Contains(err.Error(), \"not all objects were healthy\")\n}","tryCatchPattern":"if err := applier.Apply(ctx, manifest); err != nil {\n    if isUnhealthyResult(err) {\n        // objects exist; inspect which are unhealthy and wait for convergence\n        return waitForConvergence(ctx, manifest)\n    }\n    return err\n}","preventionTips":["Allow convergence time after apply before judging health (poll rollout status).","Check pod scheduling (taints, capacity, image pull) for Deployments.","Ensure CRDs are Established before applying dependent CRs.","kubectl describe failing objects to see health conditions early."],"tags":["kubernetes","health","applyset","convergence"],"backgroundTag":"kubernetes-resources-unhealthy","analyzedSha":"4c8573c808a73d578c5eadc86d410646ea0b0d73","analyzedAt":"2026-09-05T04:13:19.212Z","contentChangedAt":"2026-09-05T04:13:19.212Z","schemaVersion":2},"datasetVersion":"2026-09-12T07:17:12.445Z"}