{"record":{"id":"2f8059507bb0184e","repo":"GoogleContainerTools/skaffold","slug":"statuscode-build-docker-get-digest-err","errorCode":"StatusCode_BUILD_DOCKER_GET_DIGEST_ERR","errorMessage":"getting imageID for %s: %s","messagePattern":"getting imageID for (.+?): (.+?)","errorType":"error_code","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/skaffold/docker/errors.go","lineNumber":35,"sourceCode":"package docker\n\nimport (\n\t\"fmt\"\n\n\tsErrors \"github.com/GoogleContainerTools/skaffold/v2/pkg/skaffold/errors\"\n\t\"github.com/GoogleContainerTools/skaffold/v2/proto/v1\"\n)\n\nfunc remoteDigestGetErr(err error) error {\n\treturn sErrors.NewError(err,\n\t\t&proto.ActionableErr{\n\t\t\tMessage: err.Error(),\n\t\t\tErrCode: proto.StatusCode_BUILD_REGISTRY_GET_DIGEST_ERR,\n\t\t})\n}\n\nfunc localDigestGetErr(tag string, err error) error {\n\terr = fmt.Errorf(\"getting imageID for %s: %s\", tag, err)\n\treturn sErrors.NewError(err,\n\t\t&proto.ActionableErr{\n\t\t\tMessage: err.Error(),\n\t\t\tErrCode: proto.StatusCode_BUILD_DOCKER_GET_DIGEST_ERR,\n\t\t})\n}\n","sourceCodeStart":17,"sourceCodeEnd":42,"githubUrl":"https://github.com/GoogleContainerTools/skaffold/blob/a1189de023efc32d4b8e11f395acc678aa555011/pkg/skaffold/docker/errors.go#L17-L42","documentation":"localDigestGetErr builds a structured skaffold error (code StatusCode_BUILD_DOCKER_GET_DIGEST_ERR) wrapping the failure to resolve the imageID for a tag via the local Docker daemon. ImageID calls it when ImageInspectWithRaw / digest lookup on the local daemon returns an error, meaning skaffold could not determine the digest/ID of the built or referenced image.","triggerScenarios":"Calling ImageID(ctx, cfg, tag) where the local daemon's image inspect fails: the image does not exist locally (e.g. pushed to remote and pruned locally), the tag string is malformed, the daemon is unreachable/restarting, or the daemon API call returns an unexpected error.","commonSituations":"Image built on a remote cluster/remote Docker host while skaffold inspects the local daemon; image pruned by `docker system prune` between build and digest lookup; Docker Desktop not running; wrong context (DOCKER_HOST pointing at a different daemon that lacks the image).","solutions":["Verify the image exists on the daemon skaffold is talking to: `docker images <tag>` under the same DOCKER_HOST/context.","Check Docker is running and reachable (`docker info`); restart Docker Desktop/daemon if unresponsive.","If using remote/remote-build setups, point DOCKER_HOST (or skaffold's docker config) at the daemon that holds the image.","Re-run the build so the image is recreated, then retry the digest lookup."],"exampleFix":"// before: image only exists on remote daemon\n$ skaffold dev  # -> getting imageID for gcr.io/app:v1: no such image\n\n// after: target the daemon holding the image\n$ export DOCKER_HOST=ssh://buildhost\n$ skaffold dev","handlingStrategy":"retry","validationCode":"// Go: confirm the tag resolves locally before relying on ImageID\nctx := context.Background()\ncli, _ := client.NewClientWithOpts(client.FromEnv, client.WithAPIVersionNegotiation())\nif _, _, err := cli.ImageInspectWithRaw(ctx, tag); err != nil {\n    return fmt.Errorf(\"image %s not present on this daemon (check DOCKER_HOST): %w\", tag, err)\n}","typeGuard":null,"tryCatchPattern":"id, err := docker.ImageID(ctx, cfg, tag)\nif err != nil {\n    var sErr *sErrors.Error\n    if errors.As(err, &sErr) && sErr.ErrCode == proto.StatusCode_BUILD_DOCKER_GET_DIGEST_ERR {\n        time.Sleep(2 * time.Second)\n        id, err = docker.ImageID(ctx, cfg, tag) // daemon may have been restarting\n    }\n    if err != nil {\n        return fmt.Errorf(\"verify image exists on DOCKER_HOST=%s: %w\", os.Getenv(\"DOCKER_HOST\"), err)\n    }\n}","preventionTips":["Always build and inspect against the same DOCKER_HOST/context.","Avoid `docker system prune` between build and digest lookup in CI pipelines.","Add a readiness check (`docker info`) before build steps.","Prefer digest-pinned tags for images built on other hosts."],"tags":["docker","daemon","image","digest"],"backgroundTag":"image-not-found","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"}