{"record":{"id":"b37cb8671103841e","repo":"nektos/act","slug":"pid-invalid-pid-mode","errorCode":null,"errorMessage":"--pid: invalid PID mode","messagePattern":"--pid: invalid PID mode","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/container/docker_cli.go","lineNumber":527,"sourceCode":"\t\t}\n\t\tdeviceMappings = append(deviceMappings, deviceMapping)\n\t}\n\n\t// collect all the environment variables for the container\n\tenvVariables, err := opts.ReadKVEnvStrings(copts.envFile.GetSlice(), copts.env.GetSlice())\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\t// collect all the labels for the container\n\tlabels, err := opts.ReadKVStrings(copts.labelsFile.GetSlice(), copts.labels.GetSlice())\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tpidMode := container.PidMode(copts.pidMode)\n\tif !pidMode.Valid() {\n\t\treturn nil, errors.New(\"--pid: invalid PID mode\")\n\t}\n\n\tutsMode := container.UTSMode(copts.utsMode)\n\tif !utsMode.Valid() {\n\t\treturn nil, errors.New(\"--uts: invalid UTS mode\")\n\t}\n\n\tusernsMode := container.UsernsMode(copts.usernsMode)\n\tif !usernsMode.Valid() {\n\t\treturn nil, errors.New(\"--userns: invalid USER mode\")\n\t}\n\n\tcgroupnsMode := container.CgroupnsMode(copts.cgroupnsMode)\n\tif !cgroupnsMode.Valid() {\n\t\treturn nil, errors.New(\"--cgroupns: invalid CGROUP mode\")\n\t}\n\n\trestartPolicy, err := opts.ParseRestartPolicy(copts.restartPolicy)","sourceCodeStart":509,"sourceCodeEnd":545,"githubUrl":"https://github.com/nektos/act/blob/4f411281417e88660bea1c1a1749aa71ae0bd60f/pkg/container/docker_cli.go#L509-L545","documentation":"Error [81]: Thrown in containerReference.create when the Docker daemon supports image platform selection and input.Platform is set, but the platform string does not split on '/' into exactly two parts (os/arch). Act builds a specs.Platform{OS, Architecture} from the value; anything without exactly one slash (e.g. 'linux', 'amd64', 'linux/amd64/v2') is rejected.","triggerScenarios":"Calling act with --platform linux (no arch), --platform amd64 (no os), or a three-part platform like linux/amd64/v2; only when the daemon supports container image platform (supportsContainerImagePlatform) so the parse path is active.","commonSituations":"Using --platform values copied from docker pull output or a Dockerfile FROM --platform=linux/amd64/v2 tag; assuming a default arch so passing only 'linux'; older/newer Docker daemons differing in platform support, making the flag silently ignored on one machine and fatal on another.","solutions":["Use the exact os/arch form: --platform linux/amd64 or --platform linux/arm64","For 3-part platforms, drop the variant: linux/amd64/v2 -> linux/amd64","If emulating ARM, also install/qemu binfmt on the host (docker run --privileged --rm tonistiigi/binfmt --install all) so the platform actually pulls","Check spelling: values are case-sensitive lowercase by convention (linux, amd64, arm64, windows)"],"exampleFix":"# before\nact -P amd64\n# after\nact -P linux/amd64","handlingStrategy":"validation","validationCode":"func validPlatform(p string) error {\n\tparts := strings.SplitN(p, \"/\", 2)\n\tif len(parts) != 2 || parts[0] == \"\" || parts[1] == \"\" {\n\t\treturn fmt.Errorf(\"platform must be os/arch, got %q\", p)\n\t}\n\tif strings.Count(p, \"/\") > 2 { // linux/amd64/v2 also rejected\n\t\treturn fmt.Errorf(\"variant not supported, use %s/%s\", parts[0], parts[1])\n\t}\n\treturn nil\n}","typeGuard":"func isOSArchPlatform(p string) bool {\n\ti := strings.IndexByte(p, '/')\n\treturn i > 0 && i < len(p)-1 && strings.Count(p, \"/\") == 1\n}","tryCatchPattern":null,"preventionTips":["Always pass --platform/-P as os/arch (linux/amd64)","Never copy 3-part platforms from FROM --platform tags","Document required platform in the workflow README so runners don't guess"],"tags":["docker","platform","validation","configuration"],"backgroundTag":null,"analyzedSha":"4f411281417e88660bea1c1a1749aa71ae0bd60f","analyzedAt":"2026-08-15T09:19:46.307Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}