{"record":{"id":"161b16009ab7d419","repo":"nektos/act","slug":"unknown-server-os-s","errorCode":null,"errorMessage":"unknown server OS: %s","messagePattern":"unknown server OS: (.+?)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/container/docker_cli.go","lineNumber":1010,"sourceCode":"\t\tk, v, ok := strings.Cut(option, \"=\")\n\t\tif !ok {\n\t\t\treturn nil, errors.New(\"invalid storage option\")\n\t\t}\n\t\tm[k] = v\n\t}\n\treturn m, nil\n}\n\n// parseDevice parses a device mapping string to a container.DeviceMapping struct\nfunc parseDevice(device, serverOS string) (container.DeviceMapping, error) {\n\tswitch serverOS {\n\tcase \"linux\":\n\t\treturn parseLinuxDevice(device)\n\tcase \"windows\":\n\t\t// Windows doesn't support mapping, so passing the given value as-is.\n\t\treturn container.DeviceMapping{PathOnHost: device}, nil\n\tdefault:\n\t\treturn container.DeviceMapping{}, fmt.Errorf(\"unknown server OS: %s\", serverOS)\n\t}\n}\n\n// parseLinuxDevice parses a device mapping string to a container.DeviceMapping struct\n// knowing that the target is a Linux daemon\nfunc parseLinuxDevice(device string) (container.DeviceMapping, error) {\n\tvar src, dst string\n\tpermissions := \"rwm\"\n\t// We expect 3 parts at maximum; limit to 4 parts to detect invalid options.\n\tarr := strings.SplitN(device, \":\", 4)\n\tswitch len(arr) {\n\tcase 3:\n\t\tpermissions = arr[2]\n\t\tfallthrough\n\tcase 2:\n\t\tif validDeviceMode(arr[1]) {\n\t\t\tpermissions = arr[1]\n\t\t} else {","sourceCodeStart":992,"sourceCodeEnd":1028,"githubUrl":"https://github.com/nektos/act/blob/4f411281417e88660bea1c1a1749aa71ae0bd60f/pkg/container/docker_cli.go#L992-L1028","documentation":"parseDevice maps a --device flag string into a container.DeviceMapping and dispatches on the Docker server OS reported by the daemon. Only 'linux' and 'windows' are recognized; any other server OS string produces this error. The OS value comes from the daemon's system info, so it reflects what the connected Docker daemon reports.","triggerScenarios":"Calling the device parsing path when the connected Docker daemon reports an operating system other than linux or windows (for example a future or unusual daemon), or when the serverOS argument was passed an empty/garbage string by a caller.","commonSituations":"Running act against an exotic or misconfigured Docker endpoint, a daemon whose .ServerInfo returns an unexpected OSType, or a custom build of the container package invoked with an unchecked OS string.","solutions":["Verify what the daemon reports: docker info --format '{{.OperatingSystem}}' / check OSType","Connect to a Docker daemon that reports linux (or windows) — act only supports those for device mapping","If invoking the API from code, pass the OS from host info's OSType field verbatim","Update act to a newer version in case support for your daemon was added"],"exampleFix":null,"handlingStrategy":"validation","validationCode":"// Go: check daemon OS before touching device APIs\ninfo, err := container.GetHostInfo(ctx)\nif err != nil { return err }\nif info.OSType != \"linux\" && info.OSType != \"windows\" {\n    return fmt.Errorf(\"unsupported daemon OS %q for device mapping\", info.OSType)\n}","typeGuard":"func isSupportedServerOS(os string) bool { return os == \"linux\" || os == \"windows\" }","tryCatchPattern":null,"preventionTips":["Always source the OS from daemon info (OSType), never local runtime.GOOS","Skip --device flags when the daemon reports an unexpected OS"],"tags":["docker","device-mapping","server-os","validation"],"backgroundTag":null,"analyzedSha":"4f411281417e88660bea1c1a1749aa71ae0bd60f","analyzedAt":"2026-08-15T09:19:46.307Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}