{"record":{"id":"854a091020bb6ab7","repo":"nektos/act","slug":"cannot-process-container-options-s-w","errorCode":null,"errorMessage":"Cannot process container options: '%s': '%w'","messagePattern":"Cannot process container options: '(.+?)': '%w'","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/container/docker_run.go","lineNumber":384,"sourceCode":"\toptionsArgs, err := shellquote.Split(input.Options)\n\tif err != nil {\n\t\treturn nil, nil, fmt.Errorf(\"Cannot split container options: '%s': '%w'\", input.Options, err)\n\t}\n\n\terr = flags.Parse(optionsArgs)\n\tif err != nil {\n\t\treturn nil, nil, fmt.Errorf(\"Cannot parse container options: '%s': '%w'\", input.Options, err)\n\t}\n\n\tif len(copts.netMode.Value()) == 0 {\n\t\tif err = copts.netMode.Set(cr.input.NetworkMode); err != nil {\n\t\t\treturn nil, nil, fmt.Errorf(\"Cannot parse networkmode=%s. This is an internal error and should not happen: '%w'\", cr.input.NetworkMode, err)\n\t\t}\n\t}\n\n\tcontainerConfig, err := parse(flags, copts, runtime.GOOS)\n\tif err != nil {\n\t\treturn nil, nil, fmt.Errorf(\"Cannot process container options: '%s': '%w'\", input.Options, err)\n\t}\n\n\tlogger.Debugf(\"Custom container.Config from options ==> %+v\", containerConfig.Config)\n\n\terr = mergo.Merge(config, containerConfig.Config, mergo.WithOverride)\n\tif err != nil {\n\t\treturn nil, nil, fmt.Errorf(\"Cannot merge container.Config options: '%s': '%w'\", input.Options, err)\n\t}\n\tlogger.Debugf(\"Merged container.Config ==> %+v\", config)\n\n\tlogger.Debugf(\"Custom container.HostConfig from options ==> %+v\", containerConfig.HostConfig)\n\n\thostConfig.Binds = append(hostConfig.Binds, containerConfig.HostConfig.Binds...)\n\thostConfig.Mounts = append(hostConfig.Mounts, containerConfig.HostConfig.Mounts...)\n\tbinds := hostConfig.Binds\n\tmounts := hostConfig.Mounts\n\terr = mergo.Merge(hostConfig, containerConfig.HostConfig, mergo.WithOverride)\n\tif err != nil {","sourceCodeStart":366,"sourceCodeEnd":402,"githubUrl":"https://github.com/nektos/act/blob/4f411281417e88660bea1c1a1749aa71ae0bd60f/pkg/container/docker_run.go#L366-L402","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","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"],"exampleFix":"# before\noptions: --ulimit 65535\n\n# after\noptions: --ulimit nofile=65535:65535","handlingStrategy":"validation","validationCode":"# shell: exercise each option exactly as the daemon will see it\nfor opt in $OPTIONS; do :; done\ndocker run --rm $OPTIONS alpine true","typeGuard":null,"tryCatchPattern":null,"preventionTips":["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"],"tags":["docker","container-options","validation","flag-conversion"],"backgroundTag":null,"analyzedSha":"4f411281417e88660bea1c1a1749aa71ae0bd60f","analyzedAt":"2026-08-15T09:19:46.307Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}