nektos/act · error
Cannot process container options: '%s': '%w'
Error message
Cannot process container options: '%s': '%w'
What it means
After flag parsing, mergeContainerConfigs calls parse(flags, copts, runtime.GOOS) to convert the parsed flags into container.Config/HostConfig (the same conversion docker CLI does). Any option whose value fails that conversion — invalid device spec, bad security-opt, malformed ulimit, bad PID mode, etc. — surfaces as 'Cannot process container options' wrapping the underlying error.
Source
Thrown at pkg/container/docker_run.go:384
optionsArgs, err := shellquote.Split(input.Options)
if err != nil {
return nil, nil, fmt.Errorf("Cannot split container options: '%s': '%w'", input.Options, err)
}
err = flags.Parse(optionsArgs)
if err != nil {
return nil, nil, fmt.Errorf("Cannot parse container options: '%s': '%w'", input.Options, err)
}
if len(copts.netMode.Value()) == 0 {
if err = copts.netMode.Set(cr.input.NetworkMode); err != nil {
return nil, nil, fmt.Errorf("Cannot parse networkmode=%s. This is an internal error and should not happen: '%w'", cr.input.NetworkMode, err)
}
}
containerConfig, err := parse(flags, copts, runtime.GOOS)
if err != nil {
return nil, nil, fmt.Errorf("Cannot process container options: '%s': '%w'", input.Options, err)
}
logger.Debugf("Custom container.Config from options ==> %+v", containerConfig.Config)
err = mergo.Merge(config, containerConfig.Config, mergo.WithOverride)
if err != nil {
return nil, nil, fmt.Errorf("Cannot merge container.Config options: '%s': '%w'", input.Options, err)
}
logger.Debugf("Merged container.Config ==> %+v", config)
logger.Debugf("Custom container.HostConfig from options ==> %+v", containerConfig.HostConfig)
hostConfig.Binds = append(hostConfig.Binds, containerConfig.HostConfig.Binds...)
hostConfig.Mounts = append(hostConfig.Mounts, containerConfig.HostConfig.Mounts...)
binds := hostConfig.Binds
mounts := hostConfig.Mounts
err = mergo.Merge(hostConfig, containerConfig.HostConfig, mergo.WithOverride)
if err != nil {View on GitHub (pinned to 4f41128141)
Solutions
- Read the wrapped error — it names the specific option that failed conversion
- Fix that single option per its own validation rules (device rwm modes, ulimit name=soft:hard, seccomp path with valid JSON)
- Test the option directly: docker run --rm <option> alpine true
- Remove options you do not actually need in CI
Example fix
# before options: --ulimit 65535 # after options: --ulimit nofile=65535:65535
Defensive patterns
Strategy: validation
Validate before calling
# shell: exercise each option exactly as the daemon will see it for opt in $OPTIONS; do :; done docker run --rm $OPTIONS alpine true
Prevention
- Test the full options string with a throwaway docker run first
- Check per-option syntax: ulimit name=soft:hard, device host:ct:rwm, seccomp path with valid JSON
- Add options one at a time when debugging so the wrapped error is unambiguous
When it happens
Trigger: An option that tokenizes and parses as a flag but fails validation during conversion: --device with 4 segments, --security-opt seccomp=bad-json-path, --ulimit with wrong syntax, --pid=nonexistent, invalid shm/mount specs.
Common situations: Options copied from docker run that pass superficial parsing but are rejected by deep validation; platform-specific values (Windows-style paths on Linux) inside otherwise valid flags.
Related errors
- invalid storage option
- valid streams are STDIN, STDOUT and STDERR
- %s is not a valid mac address
- invalid logging opts for driver %s
- --pid: invalid PID mode
AI-assisted analysis of nektos/act@4f41128141 (2026-08-15).
Data as JSON: /api/errors/854a091020bb6ab7.
Report an issue: GitHub.