{"record":{"id":"c73b2dd8b4a59430","repo":"nektos/act","slug":"s-is-not-a-valid-mac-address","errorCode":null,"errorMessage":"%s is not a valid mac address","messagePattern":"(.+?) is not a valid mac address","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/container/docker_cli.go","lineNumber":359,"sourceCode":"\tNetworkingConfig *network.NetworkingConfig\n}\n\n// parse parses the args for the specified command and generates a Config,\n// a HostConfig and returns them with the specified command.\n// If the specified args are not valid, it will return an error.\n//\n//nolint:gocyclo\nfunc parse(flags *pflag.FlagSet, copts *containerOptions, serverOS string) (*containerConfig, error) {\n\tvar (\n\t\tattachStdin  = copts.attach.Get(\"stdin\")\n\t\tattachStdout = copts.attach.Get(\"stdout\")\n\t\tattachStderr = copts.attach.Get(\"stderr\")\n\t)\n\n\t// Validate the input mac address\n\tif copts.macAddress != \"\" {\n\t\tif _, err := net.ParseMAC(strings.TrimSpace(copts.macAddress)); err != nil {\n\t\t\treturn nil, fmt.Errorf(\"%s is not a valid mac address\", copts.macAddress)\n\t\t}\n\t}\n\tif copts.stdin {\n\t\tattachStdin = true\n\t}\n\t// If -a is not set, attach to stdout and stderr\n\tif copts.attach.Len() == 0 {\n\t\tattachStdout = true\n\t\tattachStderr = true\n\t}\n\n\tvar err error\n\n\tswappiness := copts.swappiness\n\tif swappiness != -1 && (swappiness < 0 || swappiness > 100) {\n\t\treturn nil, fmt.Errorf(\"invalid value: %d. Valid memory swappiness range is 0-100\", swappiness)\n\t}\n","sourceCodeStart":341,"sourceCodeEnd":377,"githubUrl":"https://github.com/nektos/act/blob/4f411281417e88660bea1c1a1749aa71ae0bd60f/pkg/container/docker_cli.go#L341-L377","documentation":"During parsing of container run options (docker CLI-compatible flag surface vendored into act's pkg/container), the --mac-address value is validated with net.ParseMAC. If it does not match any MAC notation (aa:bb:cc:dd:ee:ff, aa-bb-cc-dd-ee-ff, or dotted forms), this error returns and container creation aborts before reaching the Docker daemon.","triggerScenarios":"Passing --container-mac-address / mac_address in job or container options (e.g. options: --mac-address 00:11:22:33:44) with a wrong separator, too few octets, hex typos, or non-hex characters. TrimSpace is applied, but surrounding format errors still fail.","commonSituations":"Copy-pasted MACs with a missing octet; using '-' separators with wrong grouping like '00-11-22-33-44'; DHCP-mac-pinning workflows run under act; typos in workflow YAML options strings.","solutions":["Correct the value to full 48-bit form, e.g. --mac-address 02:42:ac:11:ff:ee","Remove --mac-address if it is not actually required for the test","Validate with a quick echo check or an online MAC regex before committing the workflow"],"exampleFix":"# before\noptions: --mac-address 00:11:22:33:44\n\n# after\noptions: --mac-address 00:11:22:33:44:55","handlingStrategy":"validation","validationCode":"// pre-validate any MAC used in options\nif macAddr != \"\" {\n    if _, err := net.ParseMAC(strings.TrimSpace(macAddr)); err != nil {\n        return fmt.Errorf(\"option mac-address %q invalid\", macAddr)\n    }\n}","typeGuard":"func isValidMAC(s string) bool {\n    _, err := net.ParseMAC(strings.TrimSpace(s))\n    return err == nil\n}","tryCatchPattern":null,"preventionTips":["Generate test MACs programmatically (net.HardwareAddr.String())","Use six-octet colon-separated form consistently","Lint workflow options strings in CI"],"tags":["docker","mac-address","validation","container-options","act"],"backgroundTag":null,"analyzedSha":"4f411281417e88660bea1c1a1749aa71ae0bd60f","analyzedAt":"2026-08-15T09:19:46.307Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}