nektos/act · error
--uts: invalid UTS mode
Error message
--uts: invalid UTS mode
What it means
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.
Source
Thrown at pkg/container/docker_cli.go:532
envVariables, err := opts.ReadKVEnvStrings(copts.envFile.GetSlice(), copts.env.GetSlice())
if err != nil {
return nil, err
}
// collect all the labels for the container
labels, err := opts.ReadKVStrings(copts.labelsFile.GetSlice(), copts.labels.GetSlice())
if err != nil {
return nil, err
}
pidMode := container.PidMode(copts.pidMode)
if !pidMode.Valid() {
return nil, errors.New("--pid: invalid PID mode")
}
utsMode := container.UTSMode(copts.utsMode)
if !utsMode.Valid() {
return nil, errors.New("--uts: invalid UTS mode")
}
usernsMode := container.UsernsMode(copts.usernsMode)
if !usernsMode.Valid() {
return nil, errors.New("--userns: invalid USER mode")
}
cgroupnsMode := container.CgroupnsMode(copts.cgroupnsMode)
if !cgroupnsMode.Valid() {
return nil, errors.New("--cgroupns: invalid CGROUP mode")
}
restartPolicy, err := opts.ParseRestartPolicy(copts.restartPolicy)
if err != nil {
return nil, err
}
loggingOpts, err := parseLoggingOpts(copts.loggingDriver, copts.loggingOpts.GetSlice())View on GitHub (pinned to 4f41128141)
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
Example fix
# before: leftover container blocks create $ docker ps -a --filter name=act-job # after $ docker rm -f act-job $ act -j job
Defensive patterns
Strategy: try-catch
Validate before calling
// Before running act: ensure no name conflicts // docker ps -a --filter name=act- ; remove leftovers
Try / catch
if err := containerRun(ctx); err != nil {
if strings.Contains(err.Error(), "failed to create container") {
// daemon message is wrapped after the colon; surface it and clean up
_ = cli.ContainerRemove(ctx, name, client.ContainerRemoveOptions{Force: true})
}
return err
} Prevention
- 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
When it happens
Trigger: 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.
Common situations: 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.
Related errors
- --userns: invalid USER mode
- --health-interval cannot be negative
- --health-timeout cannot be negative
- conflicting options: cannot specify both --ip6 and per-netwo
- --pid: invalid PID mode
AI-assisted analysis of nektos/act@4f41128141 (2026-08-15).
Data as JSON: /api/errors/0f70b2f33ee83809.
Report an issue: GitHub.