{"record":{"id":"80dccfd2d610a560","repo":"go-task/task","slug":"task-invalid-arch-value-provided-s","errorCode":null,"errorMessage":"task: Invalid Arch value provided (%s)","messagePattern":"task: Invalid Arch value provided \\((.+?)\\)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"taskfile/ast/platforms.go","lineNumber":100,"sourceCode":"\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":82,"sourceCodeEnd":102,"githubUrl":"https://github.com/go-task/task/blob/385e5ad92af02877b6d7cf9dcc963b5ed916e70a/taskfile/ast/platforms.go#L82-L102","documentation":"Parsing error from Taskfile platform declaration processing. When a 'platforms:' entry contains an architecture component (e.g. 'windows/amd64' after OS parsing, or a bare arch), parseArch rejects blank, duplicated, or unrecognized arch strings; this specific error is the generic guard for the unrecognized case — the arch string given in the Taskfile is not in goext.IsKnownArch's list of valid GOARCH values. Fix the platforms entry to use a supported GOARCH (e.g. amd64, arm64, 386).","triggerScenarios":"parseArch receives a non-empty, single arch string that is not a known GOARCH (e.g. `x86`, `x64`, `macintosh`).","commonSituations":"Using colloquial arch names instead of Go GOARCH names (`x64` instead of `amd64`, `arm32` instead of `arm`); typos like `adm64`; entries copied from non-Go tooling conventions.","solutions":["Replace the arch with its Go GOARCH equivalent: amd64, arm64, 386, arm, etc.","Run `go tool dist list` to see the full set of valid GOARCH values","Fix typos in the arch component of the platforms entry","If unsure, omit the arch and filter by OS only"],"exampleFix":"# before\nplatforms:\n  - darwin/x64\n# after\nplatforms:\n  - darwin/arm64","handlingStrategy":"validation","validationCode":"var knownArch = map[string]bool{\"386\":true,\"amd64\":true,\"arm\":true,\"arm64\":true,\"loong64\":true,\"mips\":true,\"mipsle\":true,\"mips64\":true,\"mips64le\":true,\"ppc64\":true,\"ppc64le\":true,\"riscv64\":true,\"s390x\":true,\"wasm\":true}\nfor _, p := range platforms {\n    if parts := strings.Split(p, \"/\"); len(parts) == 2 && !knownArch[parts[1]] {\n        return fmt.Errorf(\"unknown arch %q in %q\", parts[1], p)\n    }\n}","typeGuard":"func isKnownGOARCH(arch string) bool {\n    switch arch {\n    case \"386\", \"amd64\", \"arm\", \"arm64\", \"loong64\", \"mips\", \"mipsle\",\n        \"mips64\", \"mips64le\", \"ppc64\", \"ppc64le\", \"riscv64\", \"s390x\", \"wasm\":\n        return true\n    }\n    return false\n}","tryCatchPattern":"if err := parsePlatform(...); err != nil {\n    if strings.Contains(err.Error(), \"Invalid Arch value provided\") {\n        // log invalid arch and skip entry or correct to GOARCH name\n    }\n    return err\n}","preventionTips":["Use Go GOARCH names (amd64, arm64, 386), not x64/x86/arm32","Check `go tool dist list` when unsure of a valid arch","Lint Taskfiles in CI for platform entry validity","Prefer OS-only filters when arch doesn't matter"],"tags":["taskfile","platforms","validation","goarch"],"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"}