{"record":{"id":"7dc322f09a4a0a99","repo":"nektos/act","slug":"cannot-merge-container-config-options-s-w","errorCode":null,"errorMessage":"Cannot merge container.Config options: '%s': '%w'","messagePattern":"Cannot merge container\\.Config options: '(.+?)': '%w'","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/container/docker_run.go","lineNumber":391,"sourceCode":"\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 {\n\t\treturn nil, nil, fmt.Errorf(\"Cannot merge container.HostConfig options: '%s': '%w'\", input.Options, err)\n\t}\n\thostConfig.Binds = binds\n\thostConfig.Mounts = mounts\n\tlogger.Debugf(\"Merged container.HostConfig ==> %+v\", hostConfig)\n\n\treturn config, hostConfig, nil","sourceCodeStart":373,"sourceCodeEnd":409,"githubUrl":"https://github.com/nektos/act/blob/4f411281417e88660bea1c1a1749aa71ae0bd60f/pkg/container/docker_run.go#L373-L409","documentation":"mergeContainerConfigs merges the user's parsed container.Config over act's defaults with mergo (WithOverride). If mergo reports an error, the merge is aborted and 'Cannot merge container.Config options' is returned with the raw options string. mergo only errors on unsupported target kinds, so in practice this indicates struct wiring problems rather than user input.","triggerScenarios":"mergo.Merge failing on the config struct — realistically triggered by version mismatches between act and its vendored mergo/moby types (changed field kinds), not by any specific user option value.","commonSituations":"Seen after upgrading act or its dependencies where container.Config types shifted; essentially an internal invariant failure surfaced through the options pipeline.","solutions":["Update act to the latest release — dependency/type mismatches are fixed there","If it persists, report upstream with the exact options string and versions (act --version, docker info)","Retry with empty container.options to confirm the options pipeline vs. a deeper regression"],"exampleFix":null,"handlingStrategy":"fallback","validationCode":"# shell: bisect the cause — empty options should never trigger this\nact -P ubuntu-latest=-self-hosted --container-options '' 2>&1 | grep -i merge || echo \"merge path OK\"","typeGuard":null,"tryCatchPattern":"// Go: internal merge failure — fall back to defaults, surface details\nif err := runnerExec(ctx); err != nil && strings.Contains(err.Error(), \"Cannot merge container.Config\") {\n    log.Error(\"act/container merge regression — retry with empty container.options and report upstream\")\n}","preventionTips":["Keep act updated; merge/type regressions are fixed in releases","Pin act versions in CI and test upgrades before rolling out","Report reproduce steps (options string + versions) upstream when hit"],"tags":["docker","container-options","merge","internal-error","dependencies"],"backgroundTag":null,"analyzedSha":"4f411281417e88660bea1c1a1749aa71ae0bd60f","analyzedAt":"2026-08-15T09:19:46.307Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}