GoogleContainerTools/skaffold · warning

STATUSCHECK_UNKNOWN

STATUSCHECK_UNKNOWN

Error message

unable to determine current service state of pod %q

What it means

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.

Source

Thrown at pkg/diag/validator/validator.go:169

			for _, c := range pod.Status.InitContainerStatuses {
				if c.State.Waiting != nil {
					return statusCode, []string{}, fmt.Errorf("waiting for init container %s to start", c.Name)
				} else if c.State.Running != nil {
					sc, l := getPodLogs(pod, c.Name, statusCode)
					return sc, l, fmt.Errorf("waiting for init container %s to complete", c.Name)
				}
			}
		}
		return statusCode, logs, err
	}

	if c, ok := isPodStatusUnknown(pod); ok {
		log.Entry(context.TODO()).Debugf("Pod %q condition status of type %s is unknown", pod.Name, c.Type)
		return proto.StatusCode_STATUSCHECK_UNKNOWN, nil, errors.New(c.Message)
	}

	log.Entry(context.TODO()).Debugf("Unable to determine current service state of pod %q", pod.Name)
	return proto.StatusCode_STATUSCHECK_UNKNOWN, nil, fmt.Errorf("unable to determine current service state of pod %q", pod.Name)
}

func isPodReady(pod *v1.Pod) bool {
	for _, c := range pod.Status.Conditions {
		if c.Type == v1.PodReady && c.Status == v1.ConditionTrue {
			return true
		}
	}
	return false
}

func isPodNotScheduled(pod *v1.Pod) (v1.PodCondition, bool) {
	for _, c := range pod.Status.Conditions {
		if c.Type == v1.PodScheduled && c.Status == v1.ConditionFalse {
			return c, true
		}
	}
	return v1.PodCondition{}, false

View on GitHub (pinned to a1189de023)

Solutions

  1. 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.
  2. Wait and re-run the status check — transient races often resolve once the kubelet syncs pod status.
  3. Check node health (kubectl get nodes); a NotReady node leaves pod statuses incomplete.
  4. If it persists, restart the pod (kubectl delete pod <name>) so the scheduler and kubelet rebuild its status.
Defensive patterns

Strategy: retry

Validate before calling

if pod.Status.Phase == v1.PodPending && len(pod.Status.Conditions) == 0 { return errors.New("pod status not yet populated; retry shortly") }

Type guard

func podStatusClassifiable(pod *v1.Pod) bool { return len(pod.Status.Conditions) > 0 || len(pod.Status.ContainerStatuses) > 0 }

Try / catch

_, _, 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)) }

Prevention

When it happens

Trigger: 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.

Common situations: 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.

Related errors


AI-assisted analysis of GoogleContainerTools/skaffold@a1189de023 (2026-09-05). Data as JSON: /api/errors/02d7c9657a017406. Report an issue: GitHub.