{"record":{"id":"07bb75d17f8bd98d","repo":"nektos/act","slug":"bad-format-for-path-s","errorCode":null,"errorMessage":"bad format for path: %s","messagePattern":"bad format for path: (.+?)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/container/docker_cli.go","lineNumber":1105,"sourceCode":"\t\t// Windows does validation entirely server-side\n\t\treturn val, nil\n\t}\n\treturn \"\", fmt.Errorf(\"unknown server OS: %s\", serverOS)\n}\n\n// validateLinuxPath is the implementation of validateDevice knowing that the\n// target server operating system is a Linux daemon.\n// It will make sure 'val' is in the form:\n//\n//\t[host-dir:]container-path[:mode]\n//\n// It also validates the device mode.\nfunc validateLinuxPath(val string, validator func(string) bool) (string, error) {\n\tvar containerPath string\n\tvar mode string\n\n\tif strings.Count(val, \":\") > 2 {\n\t\treturn val, fmt.Errorf(\"bad format for path: %s\", val)\n\t}\n\n\tsplit := strings.SplitN(val, \":\", 3)\n\tif split[0] == \"\" {\n\t\treturn val, fmt.Errorf(\"bad format for path: %s\", val)\n\t}\n\tswitch len(split) {\n\tcase 1:\n\t\tcontainerPath = split[0]\n\t\tval = path.Clean(containerPath)\n\tcase 2:\n\t\tif isValid := validator(split[1]); isValid {\n\t\t\tcontainerPath = split[0]\n\t\t\tmode = split[1]\n\t\t\tval = fmt.Sprintf(\"%s:%s\", path.Clean(containerPath), mode)\n\t\t} else {\n\t\t\tcontainerPath = split[1]\n\t\t\tval = fmt.Sprintf(\"%s:%s\", split[0], path.Clean(containerPath))","sourceCodeStart":1087,"sourceCodeEnd":1123,"githubUrl":"https://github.com/nektos/act/blob/4f411281417e88660bea1c1a1749aa71ae0bd60f/pkg/container/docker_cli.go#L1087-L1123","documentation":"validateLinuxPath enforces the [host-dir:]container-path[:mode] form for device paths on Linux daemons. The first check rejects any value containing more than two colons, since at most three colon-separated segments are meaningful.","triggerScenarios":"Passing a --device value with three or more colons, e.g. /dev/a:/dev/b:rwm:extra, or embedding a colon-bearing Windows path on a Linux daemon.","commonSituations":"Extra colons from typos, pasted Windows drive letters (C:\\...), or gluing mode and another field together.","solutions":["Reduce the value to at most host:container:mode (two colons)","Use POSIX device paths on Linux daemons","Pass repeated --device flags for multiple devices"],"exampleFix":"# before\n--device /dev/x:/dev/x:rwm:\n\n# after\n--device /dev/x:/dev/x:rwm","handlingStrategy":"validation","validationCode":"// Go\nif strings.Count(deviceVal, \":\") > 2 { return fmt.Errorf(\"too many colons in %q\", deviceVal) }","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Two colons maximum in any device path spec","Lint workflow files for --device values with regex '^[^:]+(?::[^:]+){0,2}$'"],"tags":["docker","device-mapping","path-validation"],"backgroundTag":null,"analyzedSha":"4f411281417e88660bea1c1a1749aa71ae0bd60f","analyzedAt":"2026-08-15T09:19:46.307Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}