{"record":{"id":"a10b743b2078073f","repo":"nektos/act","slug":"conflicting-options-cannot-specify-both-link-an","errorCode":null,"errorMessage":"conflicting options: cannot specify both --link and per-network links","messagePattern":"conflicting options: cannot specify both --link and per-network links","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/container/docker_cli.go","lineNumber":823,"sourceCode":"\t\t\tif ep == nil || reflect.ValueOf(*ep).IsZero() {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t}\n\t\tendpoints[n.Target] = ep\n\t}\n\tif hasUserDefined && hasNonUserDefined {\n\t\treturn nil, errors.New(\"conflicting options: cannot attach both user-defined and non-user-defined network-modes\")\n\t}\n\treturn endpoints, nil\n}\n\nfunc applyContainerOptions(n *opts.NetworkAttachmentOpts, copts *containerOptions) error { //nolint:gocyclo\n\t// TODO should we error if _any_ advanced option is used? (i.e. forbid to combine advanced notation with the \"old\" flags (`--network-alias`, `--link`, `--ip`, `--ip6`)?\n\tif len(n.Aliases) > 0 && copts.aliases.Len() > 0 {\n\t\treturn errors.New(\"conflicting options: cannot specify both --network-alias and per-network alias\")\n\t}\n\tif len(n.Links) > 0 && copts.links.Len() > 0 {\n\t\treturn errors.New(\"conflicting options: cannot specify both --link and per-network links\")\n\t}\n\tif n.IPv4Address.IsValid() && copts.ipv4Address != nil {\n\t\treturn errors.New(\"conflicting options: cannot specify both --ip and per-network IPv4 address\")\n\t}\n\tif n.IPv6Address.IsValid() && copts.ipv6Address != nil {\n\t\treturn errors.New(\"conflicting options: cannot specify both --ip6 and per-network IPv6 address\")\n\t}\n\tif n.MacAddress != \"\" && copts.macAddress != \"\" {\n\t\treturn errors.New(\"conflicting options: cannot specify both --mac-address and per-network MAC address\")\n\t}\n\tif len(n.LinkLocalIPs) > 0 && copts.linkLocalIPs.Len() > 0 {\n\t\treturn errors.New(\"conflicting options: cannot specify both --link-local-ip and per-network link-local IP addresses\")\n\t}\n\tif copts.aliases.Len() > 0 {\n\t\tn.Aliases = make([]string, copts.aliases.Len())\n\t\tcopy(n.Aliases, copts.aliases.GetSlice())\n\t}\n\t// For a user-defined network, \"--link\" is an endpoint option, it creates an alias. But,","sourceCodeStart":805,"sourceCodeEnd":841,"githubUrl":"https://github.com/nektos/act/blob/4f411281417e88660bea1c1a1749aa71ae0bd60f/pkg/container/docker_cli.go#L805-L841","documentation":"Error [94]: copyContent builds an in-memory tar of small FileEntry payloads (e.g. action configs like action.yml metadata written into the container) and CopyToContainer to dstPath failed. Same daemon-level causes as other copy failures but payload is tiny, so failures usually mean the container/daemon state is broken rather than payload size.","triggerScenarios":"cr.cli.CopyToContainer of the small buffer failing: container not running anymore, dstPath invalid (e.g. contains '..'), readonly layer, or daemon connection lost.","commonSituations":"Happens alongside earlier failures: job container crashed at startup so every subsequent copy/exec fails; interrupted previous run left containers in Dead state; mismatched container id after daemon restart.","solutions":["Look upward in the log — an earlier error (container start/crash) is the real cause; fix that first","docker ps -a --filter name=act; remove dead containers and re-run","docker logs <container> to see why it exited if it died early","Restart dockerd if 'docker info' itself misbehaves"],"exampleFix":"# before: run again on top of broken state\n$ act -j job\n# after: clean slate\n$ docker rm -f $(docker ps -aq --filter name=act-); act -j job","handlingStrategy":"try-catch","validationCode":"// Ensure container alive before small copies\nif c, _ := cli.ContainerInspect(ctx, id); !c.State.Running { return errors.New(\"container not running\") }","typeGuard":null,"tryCatchPattern":"if err != nil && strings.Contains(err.Error(), \"failed to copy content to container\") {\n\t// small payload => almost always dead container/daemon: check docker ps -a and earlier errors first\n}","preventionTips":["Treat this error as a symptom: scan upward in logs for the container's original crash","Clean dead act containers between runs","Restart dockerd when 'docker info' is flaky"],"tags":["docker","copy","tar","container-lifecycle"],"backgroundTag":null,"analyzedSha":"4f411281417e88660bea1c1a1749aa71ae0bd60f","analyzedAt":"2026-08-15T09:19:46.307Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}