{"record":{"id":"544752a12c9b46ee","repo":"nektos/act","slug":"conflicting-options-cannot-attach-both-user-defin","errorCode":null,"errorMessage":"conflicting options: cannot attach both user-defined and non-user-defined network-modes","messagePattern":"conflicting options: cannot attach both user-defined and non-user-defined network-modes","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/container/docker_cli.go","lineNumber":812,"sourceCode":"\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tif _, ok := endpoints[n.Target]; ok {\n\t\t\treturn nil, fmt.Errorf(\"network %q is specified multiple times\", n.Target)\n\t\t}\n\n\t\t// For backward compatibility: if no custom options are provided for the network,\n\t\t// and only a single network is specified, omit the endpoint-configuration\n\t\t// on the client (the daemon will still create it when creating the container)\n\t\tif i == 0 && len(copts.netMode.Value()) == 1 {\n\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}","sourceCodeStart":794,"sourceCodeEnd":830,"githubUrl":"https://github.com/nektos/act/blob/4f411281417e88660bea1c1a1749aa71ae0bd60f/pkg/container/docker_cli.go#L794-L830","documentation":"Error [92]: In copyDir, after walking the source directory into a temp tar file, rewinding it with Seek(0, 0) failed. The temp file (os.CreateTemp) handle became invalid — the file was deleted or closed underneath, or an fs error occurred. Very rare; usually indicates filesystem trouble on the host running act.","triggerScenarios":"tarFile.Seek failing: /tmp cleaned by a janitor process mid-run, file handle closed early under load, NFS/tmpfs issues on the host, or fd exhaustion causing EBADF.","commonSituations":"/tmp cleanup (systemd-tmpfiles) racing act's run; CI runners with tiny /tmp; hosts with ulimit -n too low for big workspace walks; /tmp mounted with noexec/weird options.","solutions":["Point TMPDIR to a stable location: TMPDIR=$PWD/.tmp act ...","Raise fd limit: ulimit -n 4096 before running act","Ensure /tmp has space and isn't aggressively cleaned (df -h /tmp)","Exclude huge directories from the workspace (.gitignore is honored by copyDir; ignore build artifacts) to shorten the walk"],"exampleFix":"# before\nact -j build   # /tmp janitor deletes temp tar\n# after\nmkdir -p .tmp && TMPDIR=$PWD/.tmp act -j build","handlingStrategy":"validation","validationCode":"// Ensure TMPDIR stable & writable before running act\nif d := os.Getenv(\"TMPDIR\"); d != \"\" {\n\tif fi, err := os.Stat(d); err != nil || !fi.IsDir() { log.Fatal(\"bad TMPDIR\") }\n}","typeGuard":null,"tryCatchPattern":"if err != nil && strings.Contains(err.Error(), \"failed to seek tar archive\") {\n\t// rerun with TMPDIR set to a stable local dir\n}","preventionTips":["Set TMPDIR to project-local dir on CI runners with tmp janitors","Raise ulimit -n for large workspace walks","Keep /tmp on real disk, sized adequately"],"tags":["filesystem","tar","tmp","seek"],"backgroundTag":null,"analyzedSha":"4f411281417e88660bea1c1a1749aa71ae0bd60f","analyzedAt":"2026-08-15T09:19:46.307Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}