go-task/task · error

task: Invalid Arch value provided (%s)

Error message

task: Invalid Arch value provided (%s)

What it means

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).

Source

Thrown at taskfile/ast/platforms.go:100

	if goext.IsKnownArch(osOrArch) {
		p.Arch = osOrArch
		return nil
	}
	return fmt.Errorf("task: Invalid OS/Arch value provided (%s)", osOrArch)
}

func (p *Platform) parseArch(arch string) error {
	if arch == "" {
		return fmt.Errorf("task: Blank Arch value provided")
	}
	if p.Arch != "" {
		return fmt.Errorf("task: Multiple Arch values provided")
	}
	if goext.IsKnownArch(arch) {
		p.Arch = arch
		return nil
	}
	return fmt.Errorf("task: Invalid Arch value provided (%s)", arch)
}

View on GitHub (pinned to 385e5ad92a)

Solutions

  1. Replace the arch with its Go GOARCH equivalent: amd64, arm64, 386, arm, etc.
  2. Run `go tool dist list` to see the full set of valid GOARCH values
  3. Fix typos in the arch component of the platforms entry
  4. If unsure, omit the arch and filter by OS only

Example fix

# before
platforms:
  - darwin/x64
# after
platforms:
  - darwin/arm64
Defensive patterns

Strategy: validation

Validate before calling

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}
for _, p := range platforms {
    if parts := strings.Split(p, "/"); len(parts) == 2 && !knownArch[parts[1]] {
        return fmt.Errorf("unknown arch %q in %q", parts[1], p)
    }
}

Type guard

func isKnownGOARCH(arch string) bool {
    switch arch {
    case "386", "amd64", "arm", "arm64", "loong64", "mips", "mipsle",
        "mips64", "mips64le", "ppc64", "ppc64le", "riscv64", "s390x", "wasm":
        return true
    }
    return false
}

Try / catch

if err := parsePlatform(...); err != nil {
    if strings.Contains(err.Error(), "Invalid Arch value provided") {
        // log invalid arch and skip entry or correct to GOARCH name
    }
    return err
}

Prevention

When it happens

Trigger: parseArch receives a non-empty, single arch string that is not a known GOARCH (e.g. `x86`, `x64`, `macintosh`).

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

Related errors


AI-assisted analysis of go-task/task@385e5ad92a (2026-09-05). Data as JSON: /api/errors/80dccfd2d610a560. Report an issue: GitHub.