{"record":{"id":"8642cd5eca9ec4af","repo":"nektos/act","slug":"unable-to-determine-if-image-already-exists-for-im","errorCode":null,"errorMessage":"unable to determine if image already exists for image '%s' (%s): %w","messagePattern":"unable to determine if image already exists for image '(.+?)' \\((.+?)\\): %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/container/docker_pull.go","lineNumber":35,"sourceCode":"\t\"github.com/nektos/act/pkg/common\"\n)\n\n// NewDockerPullExecutor function to create a run executor for the container\nfunc NewDockerPullExecutor(input NewDockerPullExecutorInput) common.Executor {\n\treturn func(ctx context.Context) error {\n\t\tlogger := common.Logger(ctx)\n\t\tlogger.Debugf(\"%sdocker pull %v\", logPrefix, input.Image)\n\n\t\tif common.Dryrun(ctx) {\n\t\t\treturn nil\n\t\t}\n\n\t\tpull := input.ForcePull\n\t\tif !pull {\n\t\t\timageExists, err := ImageExistsLocally(ctx, input.Image, input.Platform)\n\t\t\tlogger.Debugf(\"Image exists? %v\", imageExists)\n\t\t\tif err != nil {\n\t\t\t\treturn fmt.Errorf(\"unable to determine if image already exists for image '%s' (%s): %w\", input.Image, input.Platform, err)\n\t\t\t}\n\n\t\t\tif !imageExists {\n\t\t\t\tpull = true\n\t\t\t}\n\t\t}\n\n\t\tif !pull {\n\t\t\treturn nil\n\t\t}\n\n\t\timageRef := cleanImage(ctx, input.Image)\n\t\tlogger.Debugf(\"pulling image '%v' (%s)\", imageRef, input.Platform)\n\n\t\tcli, err := GetDockerClient(ctx)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}","sourceCodeStart":17,"sourceCodeEnd":53,"githubUrl":"https://github.com/nektos/act/blob/4f411281417e88660bea1c1a1749aa71ae0bd60f/pkg/container/docker_pull.go#L17-L53","documentation":"NewDockerPullExecutor first checks whether the image already exists locally (unless --pull or ForcePull is set) to skip unnecessary pulls. ImageExistsLocally needs a working Docker client and a parseable image reference; if that check itself fails, the pull is aborted with this wrapped error naming the image and platform.","triggerScenarios":"ImageExistsLocally fails: Docker daemon unreachable or erroring on ImageList, or the image reference string is invalid so normalization fails. Happens only when ForcePull is false and dry-run is off.","commonSituations":"Docker daemon stopped/crashed mid-run, DOCKER_HOST pointing at a dead socket, docker desktop restarting, or a typo in the job's container image / uses image string that is not a valid reference.","solutions":["Check the wrapped error: connection problems point to the daemon, parse problems point to the image name","docker ps to verify the daemon is up; restart Docker if needed","Fix or verify the image reference (docker pull <image> manually)","As a workaround, --pull forces the pull path, but fix the underlying daemon/reference issue first"],"exampleFix":"jobs:\n  test:\n    container:\n      # before: image: node:20 11  (typo -> invalid reference)\n      image: node:20","handlingStrategy":"retry","validationCode":"# shell: pre-flight before act\nimage=$(yq '.jobs.*.container.image | select(. != null)' .github/workflows/ci.yml | head -1)\ndocker pull \"$image\" # validates reference AND daemon reachability","typeGuard":null,"tryCatchPattern":"// Go: retry once after a short delay, then surface the wrapped cause\nvar err error\nfor i := 0; i < 2; i++ {\n    if err = NewDockerPullExecutor(input)(ctx); err == nil { break }\n    time.Sleep(2 * time.Second)\n}\nif err != nil { return fmt.Errorf(\"pull failed: %w\", err) }","preventionTips":["Keep the Docker daemon healthy; docker ps as a pre-flight in CI","Use fully-qualified, valid image references","Watch the wrapped error: connection vs. reference tells you the fix"],"tags":["docker","image-pull","daemon-connection","image-reference"],"backgroundTag":null,"analyzedSha":"4f411281417e88660bea1c1a1749aa71ae0bd60f","analyzedAt":"2026-08-15T09:19:46.307Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}