hashicorp/packer · error

wrong system, expected %s_%s

Error message

wrong system, expected %s_%s

What it means

Remote getter error from Validate: the OS/architecture parsed from the checksum entry's filename doesn't match the local system (installOpts.OS/ARCH), so the artifact is for a different platform and is skipped.

Source

Thrown at packer/plugin-getter/remote/getter.go:304

	case len(parts) == 3 && !strings.HasPrefix(parts[0], "v"):
		entry.BinVersion, entry.Os, entry.Arch = "v"+parts[0], parts[1], parts[2]
		entry.ProtVersion = ""
	default:
		return fmt.Errorf(
			"malformed filename %s: expected %s{version}_x{protocol-version}_{os}_{arch} or %s{version}_{os}_{arch}",
			filename, req.FilenamePrefix(), req.FilenamePrefix())
	}

	return nil
}

func (g *Getter) Validate(opt plugingetter.GetOptions, expectedVersion string, installOpts plugingetter.BinaryInstallationOptions, entry *plugingetter.ChecksumFileEntry) error {
	expectedBinVersion := "v" + expectedVersion
	if entry.BinVersion != expectedBinVersion {
		return fmt.Errorf("wrong version: %s does not match expected %s", entry.BinVersion, expectedBinVersion)
	}
	if entry.Os != installOpts.OS || entry.Arch != installOpts.ARCH {
		return fmt.Errorf("wrong system, expected %s_%s", installOpts.OS, installOpts.ARCH)
	}

	if entry.ProtVersion == "" {
		// The protocol version was resolved from the version's manifest.json
		// when its checksum file was fetched.
		pv, ok := g.protVersions[opt.VersionString()]
		if !ok {
			return fmt.Errorf("no protocol version known for version %s", expectedVersion)
		}
		entry.ProtVersion = pv
	}

	return installOpts.CheckProtocolVersion(entry.ProtVersion)
}

func (g *Getter) ExpectedFileName(pr *plugingetter.Requirement, version string, entry *plugingetter.ChecksumFileEntry, _ string) string {
	// The filename is rebuilt from the validated entry fields; the name the
	// remote source reported is never used, so it cannot traverse paths.

View on GitHub (pinned to eb36e3c3e4)

Solutions

  1. Ensure a checksum entry for your platform exists in the release (check GOOS/GOARCH naming)
  2. If running on an unusual platform, check plugin release assets for a matching build
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at packer/plugin-getter/remote/getter.go:304 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of hashicorp/packer@eb36e3c3e4 (2026-09-05). Data as JSON: /api/errors/222ea7dadd1f9752. Report an issue: GitHub.