{"record":{"id":"bfec3169373202c2","repo":"go-task/task","slug":"task-blank-arch-value-provided","errorCode":null,"errorMessage":"task: Blank Arch value provided","messagePattern":"task: Blank Arch value provided","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"taskfile/ast/platforms.go","lineNumber":91,"sourceCode":"// If so, it will store it. If not, an error is returned\nfunc (p *Platform) parseOsOrArch(osOrArch string) error {\n\tif osOrArch == \"\" {\n\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":73,"sourceCodeEnd":102,"githubUrl":"https://github.com/go-task/task/blob/385e5ad92af02877b6d7cf9dcc963b5ed916e70a/taskfile/ast/platforms.go#L73-L102","documentation":"Task's platform filter parser rejects an empty architecture value. When a `platforms:` entry is split into OS and arch parts, the arch part must be a non-empty string; a blank arch means the platform entry was malformed (e.g. a trailing comma). The library throws this to fail fast instead of silently matching nothing.","triggerScenarios":"Calling parseArch (via parsePlatform when evaluating a task's `platforms:` list) with an empty arch string, e.g. a platform entry like `linux,` or `windows-` where the component after the separator is empty.","commonSituations":"Hand-edited Taskfiles with a trailing comma in a platforms entry; templated/generated platform lists where a variable that holds the arch expanded to empty; copy-paste of platform strings with a stray separator.","solutions":["Fix the platforms entry in the Taskfile so it contains a valid arch, e.g. `platforms: [linux]` instead of `platforms: [linux,]`","If the platform is OS-only, list just the OS (e.g. `linux`) — arch is optional but must not be blank","If the arch comes from a template/variable, ensure the variable is set and non-empty before rendering","Run `task --list` after editing to confirm the Taskfile parses cleanly"],"exampleFix":"# before\nplatforms:\n  - linux,\n# after\nplatforms:\n  - linux/amd64","handlingStrategy":"validation","validationCode":"for _, p := range platforms {\n    parts := strings.Split(p, \"/\")\n    if len(parts) > 1 && parts[1] == \"\" {\n        return fmt.Errorf(\"blank arch in platform entry %q\", p)\n    }\n}","typeGuard":"func hasBlankArch(entries []string) bool {\n    for _, e := range entries {\n        if i := strings.Index(e, \"/\"); i >= 0 && i == len(e)-1 {\n            return true\n        }\n    }\n    return false\n}","tryCatchPattern":"if err := parsePlatform(...); err != nil {\n    if strings.Contains(err.Error(), \"Blank Arch value provided\") {\n        // fall back: skip malformed platform entry and log\n    }\n    return err\n}","preventionTips":["Never leave a trailing separator in platform entries","Use Task's official platform syntax examples as a template","Validate the Taskfile with `task --list` after editing platforms","Ensure template variables feeding arch values default to a valid GOARCH"],"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"}