{"record":{"id":"02d7c9657a017406","repo":"GoogleContainerTools/skaffold","slug":"statuscheck-unknown","errorCode":"STATUSCHECK_UNKNOWN","errorMessage":"unable to determine current service state of pod %q","messagePattern":"unable to determine current service state of pod %q","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"pkg/diag/validator/validator.go","lineNumber":169,"sourceCode":"\t\t\tfor _, c := range pod.Status.InitContainerStatuses {\n\t\t\t\tif c.State.Waiting != nil {\n\t\t\t\t\treturn statusCode, []string{}, fmt.Errorf(\"waiting for init container %s to start\", c.Name)\n\t\t\t\t} else if c.State.Running != nil {\n\t\t\t\t\tsc, l := getPodLogs(pod, c.Name, statusCode)\n\t\t\t\t\treturn sc, l, fmt.Errorf(\"waiting for init container %s to complete\", c.Name)\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn statusCode, logs, err\n\t}\n\n\tif c, ok := isPodStatusUnknown(pod); ok {\n\t\tlog.Entry(context.TODO()).Debugf(\"Pod %q condition status of type %s is unknown\", pod.Name, c.Type)\n\t\treturn proto.StatusCode_STATUSCHECK_UNKNOWN, nil, errors.New(c.Message)\n\t}\n\n\tlog.Entry(context.TODO()).Debugf(\"Unable to determine current service state of pod %q\", pod.Name)\n\treturn proto.StatusCode_STATUSCHECK_UNKNOWN, nil, fmt.Errorf(\"unable to determine current service state of pod %q\", pod.Name)\n}\n\nfunc isPodReady(pod *v1.Pod) bool {\n\tfor _, c := range pod.Status.Conditions {\n\t\tif c.Type == v1.PodReady && c.Status == v1.ConditionTrue {\n\t\t\treturn true\n\t\t}\n\t}\n\treturn false\n}\n\nfunc isPodNotScheduled(pod *v1.Pod) (v1.PodCondition, bool) {\n\tfor _, c := range pod.Status.Conditions {\n\t\tif c.Type == v1.PodScheduled && c.Status == v1.ConditionFalse {\n\t\t\treturn c, true\n\t\t}\n\t}\n\treturn v1.PodCondition{}, false","sourceCodeStart":151,"sourceCodeEnd":187,"githubUrl":"https://github.com/GoogleContainerTools/skaffold/blob/a1189de023efc32d4b8e11f395acc678aa555011/pkg/diag/validator/validator.go#L151-L187","documentation":"Fallback error returned when Skaffold cannot classify the pod's state from its status conditions and container states; the code is STATUSCHECK_UNKNOWN. The pod exists but its status does not match any known ready/failed/initializing pattern, so Skaffold reports it as unknown.","triggerScenarios":"getPodStatus: isPodStatusUnknown finds no unknown-condition pod, and no prior branch (initializing, waiting, terminated) matched, so the function falls through to the final return with fmt.Errorf on the pod name.","commonSituations":"Transient API-server/controller races right after pod creation (status not yet populated); stale or partial pod status from an overloaded kubelet; unusual custom conditions; node NotReady leaving status incomplete.","solutions":["Run kubectl describe pod <name> and kubectl get pod -o yaml to see the raw status and conditions; the real cause is usually visible there.","Wait and re-run the status check — transient races often resolve once the kubelet syncs pod status.","Check node health (kubectl get nodes); a NotReady node leaves pod statuses incomplete.","If it persists, restart the pod (kubectl delete pod <name>) so the scheduler and kubelet rebuild its status."],"exampleFix":null,"handlingStrategy":"retry","validationCode":"if pod.Status.Phase == v1.PodPending && len(pod.Status.Conditions) == 0 { return errors.New(\"pod status not yet populated; retry shortly\") }","typeGuard":"func podStatusClassifiable(pod *v1.Pod) bool { return len(pod.Status.Conditions) > 0 || len(pod.Status.ContainerStatuses) > 0 }","tryCatchPattern":"_, _, err := getPodStatus(pod); var unknown *statusErr; if errors.As(err, &unknown) && unknown.Code == proto.StatusCode_STATUSCHECK_UNKNOWN { time.Sleep(3 * time.Second); return getPodStatus(refreshPod(ctx, pod.Name)) }","preventionTips":["Re-fetch the pod from the API before classifying to avoid stale status","Give pods a grace period after creation before status checks","Check node readiness first — NotReady nodes yield incomplete pod status","Treat UNKNOWN as transient; only alert after repeated occurrences"],"tags":["kubernetes","pod","status-check","unknown-state"],"backgroundTag":"pod-status-unknown","analyzedSha":"a1189de023efc32d4b8e11f395acc678aa555011","analyzedAt":"2026-09-05T12:09:27.064Z","contentChangedAt":"2026-09-05T12:09:27.064Z","schemaVersion":2},"datasetVersion":"2026-09-12T17:17:11.597Z"}