nektos/act · error

unknown server OS: %s

Error message

unknown server OS: %s

What it means

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.

Source

Thrown at pkg/container/docker_cli.go:1010

		k, v, ok := strings.Cut(option, "=")
		if !ok {
			return nil, errors.New("invalid storage option")
		}
		m[k] = v
	}
	return m, nil
}

// parseDevice parses a device mapping string to a container.DeviceMapping struct
func parseDevice(device, serverOS string) (container.DeviceMapping, error) {
	switch serverOS {
	case "linux":
		return parseLinuxDevice(device)
	case "windows":
		// Windows doesn't support mapping, so passing the given value as-is.
		return container.DeviceMapping{PathOnHost: device}, nil
	default:
		return container.DeviceMapping{}, fmt.Errorf("unknown server OS: %s", serverOS)
	}
}

// parseLinuxDevice parses a device mapping string to a container.DeviceMapping struct
// knowing that the target is a Linux daemon
func parseLinuxDevice(device string) (container.DeviceMapping, error) {
	var src, dst string
	permissions := "rwm"
	// We expect 3 parts at maximum; limit to 4 parts to detect invalid options.
	arr := strings.SplitN(device, ":", 4)
	switch len(arr) {
	case 3:
		permissions = arr[2]
		fallthrough
	case 2:
		if validDeviceMode(arr[1]) {
			permissions = arr[1]
		} else {

View on GitHub (pinned to 4f41128141)

Solutions

  1. Verify what the daemon reports: docker info --format '{{.OperatingSystem}}' / check OSType
  2. Connect to a Docker daemon that reports linux (or windows) — act only supports those for device mapping
  3. If invoking the API from code, pass the OS from host info's OSType field verbatim
  4. Update act to a newer version in case support for your daemon was added
Defensive patterns

Strategy: validation

Validate before calling

// Go: check daemon OS before touching device APIs
info, err := container.GetHostInfo(ctx)
if err != nil { return err }
if info.OSType != "linux" && info.OSType != "windows" {
    return fmt.Errorf("unsupported daemon OS %q for device mapping", info.OSType)
}

Type guard

func isSupportedServerOS(os string) bool { return os == "linux" || os == "windows" }

Prevention

When it happens

Trigger: 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.

Common situations: 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.

Related errors


AI-assisted analysis of nektos/act@4f41128141 (2026-08-15). Data as JSON: /api/errors/161b16009ab7d419. Report an issue: GitHub.