{"record":{"id":"b0b1422e3a2d3945","repo":"GoogleContainerTools/skaffold","slug":"creating-container-for-v-v","errorCode":null,"errorMessage":"creating container for %v: %v","messagePattern":"creating container for (.+?): (.+?)","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/skaffold/k8sjob/util.go","lineNumber":194,"sourceCode":"\t\treturn true, err\n\t})\n}\n\nfunc isRetryableErr(k8sErr error) bool {\n\tisRetryable := false\n\tfor _, checkIsRetryableErr := range retryableErrChecks {\n\t\tisRetryable = isRetryable || checkIsRetryableErr(k8sErr)\n\t}\n\treturn isRetryable\n}\n\nfunc CheckIfPullImgErr(pod *corev1.Pod, jobName string) error {\n\tfor _, cs := range pod.Status.ContainerStatuses {\n\t\tif cs.State.Waiting == nil {\n\t\t\tcontinue\n\t\t}\n\t\tif checkIsPullImgErr(cs.State.Waiting.Reason) {\n\t\t\treturn fmt.Errorf(\"creating container for %v: %v\", jobName, cs.State.Waiting.Reason)\n\t\t}\n\t}\n\n\treturn nil\n}\n\nfunc checkIsPullImgErr(waitingReason string) bool {\n\treturn validator.ImagePullBackOff == waitingReason ||\n\t\tvalidator.ErrImagePullBackOff == waitingReason ||\n\t\tvalidator.ImagePullErr == waitingReason\n}\n","sourceCodeStart":176,"sourceCodeEnd":206,"githubUrl":"https://github.com/GoogleContainerTools/skaffold/blob/a1189de023efc32d4b8e11f395acc678aa555011/pkg/skaffold/k8sjob/util.go#L176-L206","documentation":"CheckIfPullImgErr inspects a pod's container statuses and, when a container is stuck in a Waiting state whose reason is an image-pull error (ImagePullBackOff/ErrImagePull), returns this error naming the job. It surfaces Kubernetes' own pull failure as a Go error so callers can abort quickly instead of waiting for logs that will never arrive.","triggerScenarios":"A pod for the job has containerStatuses[].state.waiting.reason matching a pull-image error — wrong/misspelled image name or tag, private registry requiring credentials not present in the cluster, or the image does not exist in the registry.","commonSituations":"Pushing to a registry the cluster can't authenticate to (missing imagePullSecrets), typo'd image tag, referencing a locally-built image never pushed to the cluster, rate limiting from Docker Hub.","solutions":["Verify the image exists: `docker pull <image>` locally or check the registry; fix the tag/name in the job manifest","Attach registry credentials: create a secret and set imagePullSecrets on the pod/job spec","If using a local image with kind/minikube, load it into the cluster (kind load docker-image / minikube image load) instead of expecting a pull","Check `kubectl describe pod` events to confirm ImagePullBackOff and the exact registry error","Handle registry rate limits by authenticating or using a mirror"],"exampleFix":"// before\nimage: myrepo/myimage:latst\n// after\nimage: myrepo/myimage:latest\n# plus, for private registries:\nimagePullSecrets:\n  - name: regcred","handlingStrategy":"try-catch","validationCode":"// Pre-validate the image exists before applying the job\nref, _ := reference.ParseNormalizedNamed(imageTag)\n// ensure tag is not :latest-accidental and image was pushed:\nout, err := exec.Command(\"docker\", \"manifest\", \"inspect\", imageTag).CombinedOutput()\nif err != nil {\n    return fmt.Errorf(\"image %s not found in registry: %s\", imageTag, out)\n}","typeGuard":"func hasPullErr(pod *corev1.Pod) (string, bool) {\n    for _, cs := range pod.Status.ContainerStatuses {\n        if cs.State.Waiting != nil &&\n            (cs.State.Waiting.Reason == \"ImagePullBackOff\" || cs.State.Waiting.Reason == \"ErrImagePull\") {\n            return cs.State.Waiting.Reason, true\n        }\n    }\n    return \"\", false\n}","tryCatchPattern":"if err := k8sjob.CheckIfPullImgErr(pod, jobName); err != nil {\n    // image-pull failure is terminal; don't retry blind\n    return fmt.Errorf(\"aborting: %w (check imagePullSecrets and tag)\", err)\n}","preventionTips":["Always pin exact image tags; never rely on a tag that may not exist","Configure imagePullSecrets for private registries in every namespace the job runs in","Pre-load local images into kind/minikube clusters before running jobs","Watch pod events (kubectl describe pod) during development to catch pull failures early"],"tags":["kubernetes","image-pull","container"],"backgroundTag":"imagepullbackoff","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"}