{"record":{"id":"d730d1e78f0d5805","repo":"nektos/act","slug":"userns-invalid-user-mode","errorCode":null,"errorMessage":"--userns: invalid USER mode","messagePattern":"--userns: invalid USER mode","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/container/docker_cli.go","lineNumber":537,"sourceCode":"\t// collect all the labels for the container\n\tlabels, err := opts.ReadKVStrings(copts.labelsFile.GetSlice(), copts.labels.GetSlice())\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tpidMode := container.PidMode(copts.pidMode)\n\tif !pidMode.Valid() {\n\t\treturn nil, errors.New(\"--pid: invalid PID mode\")\n\t}\n\n\tutsMode := container.UTSMode(copts.utsMode)\n\tif !utsMode.Valid() {\n\t\treturn nil, errors.New(\"--uts: invalid UTS mode\")\n\t}\n\n\tusernsMode := container.UsernsMode(copts.usernsMode)\n\tif !usernsMode.Valid() {\n\t\treturn nil, errors.New(\"--userns: invalid USER mode\")\n\t}\n\n\tcgroupnsMode := container.CgroupnsMode(copts.cgroupnsMode)\n\tif !cgroupnsMode.Valid() {\n\t\treturn nil, errors.New(\"--cgroupns: invalid CGROUP mode\")\n\t}\n\n\trestartPolicy, err := opts.ParseRestartPolicy(copts.restartPolicy)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tloggingOpts, err := parseLoggingOpts(copts.loggingDriver, copts.loggingOpts.GetSlice())\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tsecurityOpts, err := parseSecurityOpts(copts.securityOpt.GetSlice())","sourceCodeStart":519,"sourceCodeEnd":555,"githubUrl":"https://github.com/nektos/act/blob/4f411281417e88660bea1c1a1749aa71ae0bd60f/pkg/container/docker_cli.go#L519-L555","documentation":"Error [83]: The Docker ImageInspect API call for the job image failed inside extractFromImageEnv. Act inspects the image to harvest its Dockerfile ENV variables and merge them into the job environment (special-casing PATH). Failure means the image was deleted between pull and exec, the daemon is unreachable, or the image reference is unresolvable at inspect time.","triggerScenarios":"cr.cli.ImageInspect(ctx, cr.input.Image) erroring: image removed (docker rmi / pruned concurrently), daemon connection dropped (DOCKER_HOST tcp socket restart), or image name/tag typo when the pull step was skipped.","commonSituations":"Running 'docker image prune -a' in another terminal mid-run; aggressive CI cleanup scripts between jobs; DOCKER_HOST pointing at a remote socket that times out; using local images with an implicit :latest tag that was retagged.","solutions":["Confirm the image exists: docker image inspect <image>","Re-pull explicitly: docker pull <image>, or let act pull by not preloading","Verify DOCKER_HOST/socket connectivity: docker info","If images are pruned by a side process, disable the prune or pull inside the job before the step runs","Pin an explicit tag instead of implicit :latest to avoid surprises"],"exampleFix":"# before: image pruned mid-run, inspect fails\n$ docker image prune -a -f & act run\n# after\n$ docker pull node:20 && act -j build","handlingStrategy":"try-catch","validationCode":"// Pre-flight before invoking act programmatically\nif _, err := cli.ImageInspect(ctx, image); err != nil {\n\t_, _ = cli.ImagePull(ctx, image, client.ImagePullOptions{})\n}","typeGuard":null,"tryCatchPattern":"if err := step(ctx); err != nil && strings.Contains(err.Error(), \"inspect image\") {\n\t// pull and retry once\n\t_ = pull(image)\n\terr = step(ctx)\n}","preventionTips":["Pin explicit image tags","Don't run docker image prune concurrently with act","Pre-pull job images in CI before invoking act"],"tags":["docker","image-inspect","environment","daemon"],"backgroundTag":null,"analyzedSha":"4f411281417e88660bea1c1a1749aa71ae0bd60f","analyzedAt":"2026-08-15T09:19:46.307Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}