{"record":{"id":"0f70b2f33ee83809","repo":"nektos/act","slug":"uts-invalid-uts-mode","errorCode":null,"errorMessage":"--uts: invalid UTS mode","messagePattern":"--uts: invalid UTS mode","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/container/docker_cli.go","lineNumber":532,"sourceCode":"\tenvVariables, err := opts.ReadKVEnvStrings(copts.envFile.GetSlice(), copts.env.GetSlice())\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\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())","sourceCodeStart":514,"sourceCodeEnd":550,"githubUrl":"https://github.com/nektos/act/blob/4f411281417e88660bea1c1a1749aa71ae0bd60f/pkg/container/docker_cli.go#L514-L550","documentation":"Error [82]: Docker daemon API ContainerCreate call failed after act assembled Config/HostConfig/NetworkingConfig/Platform. The wrapped error comes from the daemon: bad image reference, name conflict, invalid host config (bad mount/bind/cap), platform not available, or API version mismatch. Act had already pulled/inspected the image, so this is about container creation specifically.","triggerScenarios":"cr.cli.ContainerCreate returning non-nil: container name already in use (--name or job container name collision), invalid bind-mount source path, unknown capability in CapAdd/CapDrop, invalid platform spec, or daemon API version older than the client library expects.","commonSituations":"A previous act run left a stopped container with the same name (crashed runs don't always clean up; run 'docker ps -a | grep act-'); binding a host path that doesn't exist; using network/cap flags not supported by old Docker on CI; Docker Desktop freshly restarted and temporary state lost.","solutions":["Run 'docker ps -a' and remove leftover act containers: docker rm -f $(docker ps -aq --filter name=act-)","Check the wrapped daemon message — it names the exact offending field (bind, cap, name, platform)","Verify bind source paths exist on the host; create them or fix absolute paths","Upgrade the Docker daemon (or set DOCKER_API_VERSION) so daemon matches the moby client act uses","Re-run with act -v to see the merged HostConfig logged right before creation"],"exampleFix":"# before: leftover container blocks create\n$ docker ps -a --filter name=act-job\n# after\n$ docker rm -f act-job\n$ act -j job","handlingStrategy":"try-catch","validationCode":"// Before running act: ensure no name conflicts\n// docker ps -a --filter name=act- ; remove leftovers","typeGuard":null,"tryCatchPattern":"if err := containerRun(ctx); err != nil {\n\tif strings.Contains(err.Error(), \"failed to create container\") {\n\t\t// daemon message is wrapped after the colon; surface it and clean up\n\t\t_ = cli.ContainerRemove(ctx, name, client.ContainerRemoveOptions{Force: true})\n\t}\n\treturn err\n}","preventionTips":["Run 'docker rm -f $(docker ps -aq --filter name=act-)' between failed runs","Verify bind source paths exist before starting act","Keep Docker Engine updated to match act's client API"],"tags":["docker","container-create","daemon","cleanup"],"backgroundTag":null,"analyzedSha":"4f411281417e88660bea1c1a1749aa71ae0bd60f","analyzedAt":"2026-08-15T09:19:46.307Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}