{"record":{"id":"d62391eee6e32119","repo":"nektos/act","slug":"conflicting-options-cannot-specify-both-restart","errorCode":null,"errorMessage":"conflicting options: cannot specify both --restart and --rm","messagePattern":"conflicting options: cannot specify both --restart and --rm","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/container/docker_cli.go","lineNumber":723,"sourceCode":"\t\tSecurityOpt:    securityOpts,\n\t\tStorageOpt:     storageOpts,\n\t\tReadonlyRootfs: copts.readonlyRootfs,\n\t\tLogConfig:      container.LogConfig{Type: copts.loggingDriver, Config: loggingOpts},\n\t\tVolumeDriver:   copts.volumeDriver,\n\t\tIsolation:      container.Isolation(copts.isolation),\n\t\tShmSize:        copts.shmSize.Value(),\n\t\tResources:      resources,\n\t\tTmpfs:          tmpfs,\n\t\tSysctls:        copts.sysctls.GetAll(),\n\t\tRuntime:        copts.runtime,\n\t\tMounts:         copts.mounts.Value(),\n\t\tMaskedPaths:    maskedPaths,\n\t\tReadonlyPaths:  readonlyPaths,\n\t\tAnnotations:    copts.annotations.GetAll(),\n\t}\n\n\tif copts.autoRemove && !hostConfig.RestartPolicy.IsNone() {\n\t\treturn nil, errors.New(\"conflicting options: cannot specify both --restart and --rm\")\n\t}\n\n\t// only set this value if the user provided the flag, else it should default to nil\n\tif flags.Changed(\"init\") {\n\t\thostConfig.Init = &copts.init\n\t}\n\n\t// When allocating stdin in attached mode, close stdin at client disconnect\n\tif config.OpenStdin && config.AttachStdin {\n\t\tconfig.StdinOnce = true\n\t}\n\n\tepCfg, err := parseNetworkOpts(copts)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn &containerConfig{","sourceCodeStart":705,"sourceCodeEnd":741,"githubUrl":"https://github.com/nektos/act/blob/4f411281417e88660bea1c1a1749aa71ae0bd60f/pkg/container/docker_cli.go#L705-L741","documentation":"Error [91]: The main CopyToContainer of the tar stream to destPath failed in copyTarStream. This is the actual content upload (after the mkdir step succeeded). Wrapped daemon errors include ENOSPC, permission denied on the destination path, container exiting mid-copy, or stream interruption.","triggerScenarios":"cr.cli.CopyToContainer(DestinationPath: destPath, tarStream) failing: disk full in the container layer, destPath owned by another UID and exec user lacks write permission, container stops during upload, or connection reset.","commonSituations":"Copying the workspace into containers running as non-root (UID mismatch vs. the chown step that runs after and silently ignores errors); large workspaces timing out; container disk quotas on CI runners; destination inside a read-only volume.","solutions":["Check the wrapped message: 'no space left' -> prune images/volumes, 'permission denied' -> align UIDs","Run docker exec -it <c> id to see the copy user vs. destPath ownership","Prune docker: docker system prune, then retry large copies","If destPath is on a mounted volume, fix the volume's permissions/mount options"],"exampleFix":"# before: dest owned by root, container user 1000\n$ docker exec c ls -ld /home/user\n# after\n$ docker exec -u 0 c chown -R 1000:1000 /home/user","handlingStrategy":"try-catch","validationCode":"// Check space + dest permissions inside container pre-copy\n_, _ = cli.ContainerExecCreate(ctx, id, client.ExecCreateOptions{Cmd: []string{\"sh\", \"-c\", \"test -w \" + dest + \" && df -k .\"}})","typeGuard":null,"tryCatchPattern":"if err != nil && strings.Contains(err.Error(), \"failed to copy content to container\") {\n\tif strings.Contains(err.Error(), \"no space left\") { /* prune */ } else if strings.Contains(err.Error(), \"permission denied\") { /* chown dest */ }\n}","preventionTips":["Align container UID/GID with destination ownership","Prune images/volumes before artifact-heavy jobs","Avoid copying into read-only mounted volumes"],"tags":["docker","copy","permissions","disk"],"backgroundTag":null,"analyzedSha":"4f411281417e88660bea1c1a1749aa71ae0bd60f","analyzedAt":"2026-08-15T09:19:46.307Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}