{"record":{"id":"def95d671af49d8d","repo":"go-task/task","slug":"task-multiple-arch-values-provided","errorCode":null,"errorMessage":"task: Multiple Arch values provided","messagePattern":"task: Multiple Arch values provided","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"taskfile/ast/platforms.go","lineNumber":94,"sourceCode":"\t\treturn fmt.Errorf(\"task: Blank OS/Arch value provided\")\n\t}\n\tif goext.IsKnownOS(osOrArch) {\n\t\tp.OS = osOrArch\n\t\treturn nil\n\t}\n\tif goext.IsKnownArch(osOrArch) {\n\t\tp.Arch = osOrArch\n\t\treturn nil\n\t}\n\treturn fmt.Errorf(\"task: Invalid OS/Arch value provided (%s)\", osOrArch)\n}\n\nfunc (p *Platform) parseArch(arch string) error {\n\tif arch == \"\" {\n\t\treturn fmt.Errorf(\"task: Blank Arch value provided\")\n\t}\n\tif p.Arch != \"\" {\n\t\treturn fmt.Errorf(\"task: Multiple Arch values provided\")\n\t}\n\tif goext.IsKnownArch(arch) {\n\t\tp.Arch = arch\n\t\treturn nil\n\t}\n\treturn fmt.Errorf(\"task: Invalid Arch value provided (%s)\", arch)\n}\n","sourceCodeStart":76,"sourceCodeEnd":102,"githubUrl":"https://github.com/go-task/task/blob/385e5ad92af02877b6d7cf9dcc963b5ed916e70a/taskfile/ast/platforms.go#L76-L102","documentation":"A task's platform filter can only declare one architecture. parseArch sets p.Arch once; a second call with another arch value means the same Platform entry received two arch values, which is ambiguous, so it errors.","triggerScenarios":"parsePlatform feeding multiple arch tokens into parseArch for the same Platform struct — e.g. a platforms entry like `linux/amd64/arm64` or calling the parser twice with different arch strings on the same Platform instance.","commonSituations":"Typos in platform entries where a second slash-separated component was meant to be an OS; misunderstanding that each entry is a single os/arch pair (multiple entries, not one combined entry, express multiple platforms).","solutions":["Split combined entries into separate list items: `platforms: [linux/amd64, linux/arm64]`","Remove the duplicate arch from the single entry so each entry has exactly one os/arch pair","Check for accidental repeated separators (e.g. `windows/amd64/amd64`)","Validate with `task --list` after fixing"],"exampleFix":"# before\nplatforms:\n  - linux/amd64/arm64\n# after\nplatforms:\n  - linux/amd64\n  - linux/arm64","handlingStrategy":"validation","validationCode":"for _, p := range platforms {\n    if strings.Count(p, \"/\") > 1 {\n        return fmt.Errorf(\"platform entry %q has more than one arch\", p)\n    }\n}","typeGuard":"func hasMultipleArch(e string) bool {\n    return strings.Count(e, \"/\") > 1\n}","tryCatchPattern":"if err := parsePlatform(...); err != nil {\n    if strings.Contains(err.Error(), \"Multiple Arch values provided\") {\n        // split the entry into multiple platforms before retrying\n    }\n    return err\n}","preventionTips":["One os/arch pair per platforms list entry","Express multiple arches as multiple list items","Avoid joining arch lists into a single string before parsing","Lint platform entries in CI with a simple slash-count check"],"tags":["taskfile","platforms","config","validation"],"backgroundTag":"invalid-platform-value","analyzedSha":"385e5ad92af02877b6d7cf9dcc963b5ed916e70a","analyzedAt":"2026-09-05T09:01:05.226Z","contentChangedAt":"2026-09-05T09:01:05.226Z","schemaVersion":2},"datasetVersion":"2026-09-12T12:17:11.808Z"}