GoogleContainerTools/skaffold · warning
STATUSCHECK_POD_INITIALIZING
STATUSCHECK_POD_INITIALIZING
Error message
waiting for init container %s to start
What it means
This pod-status error (code STATUSCHECK_POD_INITIALIZING) means the pod is still in the initializing phase because one of its init containers is stuck in Waiting state (not yet started). Skaffold raises it while probing container statuses so the user knows initialization has not completed.
Source
Thrown at pkg/diag/validator/validator.go:153
// If the event type PodScheduled with status False is found then we check if it is due to taints and tolerations.
if c, ok := isPodNotScheduled(pod); ok {
log.Entry(context.TODO()).Debugf("Pod %q not scheduled: checking tolerations", pod.Name)
sc, err := getUntoleratedTaints(c.Reason, c.Message)
return sc, nil, err
}
// we can check the container status if the pod has been scheduled successfully. This can be determined by having the event
// PodScheduled with status True, or a ContainerReady or PodReady event with status False.
if isPodScheduledButNotReady(pod) {
log.Entry(context.TODO()).Debugf("Pod %q scheduled but not ready: checking container statuses", pod.Name)
// TODO(dgageot): Add EphemeralContainerStatuses
cs := append(pod.Status.InitContainerStatuses, pod.Status.ContainerStatuses...)
// See https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle/#container-states
statusCode, logs, err := getContainerStatus(pod, cs)
if statusCode == proto.StatusCode_STATUSCHECK_POD_INITIALIZING {
// Determine if an init container is still running and fetch the init logs.
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)
}
View on GitHub (pinned to a1189de023)
Solutions
- Run kubectl describe pod <name> and inspect the init container's Waiting reason (ErrImagePull/CrashLoopBackOff) and fix that root cause.
- Fix the init container image reference or registry credentials (imagePullSecrets) if it cannot be pulled.
- If the init container depends on an external service, verify that service is reachable before/at pod start.
- Increase kubectl logs <pod> -c <init-container> output to confirm where the init step is hanging, and fix the command or its dependencies.
Example fix
# before: init container references a private image without credentials // after: attach pull secret to the pod spec // imagePullSecrets: // - name: regcred
Defensive patterns
Strategy: validation
Validate before calling
pod, _ := client.CoreV1().Pods(ns).Get(ctx, name, metav1.GetOptions{}); for _, ic := range pod.Status.InitContainerStatuses { if ic.State.Waiting != nil { return fmt.Errorf("init container %s not started: %s %s", ic.Name, ic.State.Waiting.Reason, ic.State.Waiting.Message) } } Type guard
func initContainerStarted(pod *v1.Pod) bool { for _, c := range pod.Status.InitContainerStatuses { if c.State.Waiting != nil || c.State.Terminated != nil && c.State.Terminated.ExitCode != 0 { return false } } return true } Prevention
- Keep init containers tiny and give them timeout+failure exits
- Pre-pull init container images (same base as app image)
- Test initContainer dependencies (DB, mesh) exist before deploying
- Use kubectl describe pod to check Waiting reasons during CI
When it happens
Trigger: getPodStatus detects statusCode STATUSCHECK_POD_INITIALIZING and finds an entry in pod.Status.InitContainerStatuses whose State.Waiting is non-nil, returning 'waiting for init container <name> to start'.
Common situations: Init container image stuck in ImagePullBackOff; init container command misconfigured; pod waiting on initContainer dependencies (service mesh, secrets, volume setup); cluster DNS/registry issues blocking image pull.
Related errors
- waiting for init container %s to complete
- STATUSCHECK_UNKNOWN
- rs.ae.Message (actionable error message from status check)
- pod has failed
- STATUSCHECK_CONTAINER_TERMINATED
AI-assisted analysis of GoogleContainerTools/skaffold@a1189de023 (2026-09-05).
Data as JSON: /api/errors/18cbe2edb482a843.
Report an issue: GitHub.