hashicorp/packer · error

binary reported version (%q) is different from the expected

Error message

binary reported version (%q) is different from the expected %q, skipping

What it means

checkVersion compares the core (major.minor.patch) version the binary reports via `describe` against the version being installed; on mismatch it returns this ContinuableInstallError and InstallLatest skips to the next version. This guards against binaries that don't match the release they were downloaded from.

Source

Thrown at packer/plugin-getter/plugins.go:993

	return desc, err
}

// checkVersion checks the described version of a plugin binary against the requested version constriant.
// A ContinuableInstallError is returned upon a version mismatch to indicate that the caller should try the next
// available version. A PrereleaseInstallError is returned to indicate an unsupported version install.
func checkVersion(binPath string, identifier string, version *goversion.Version) error {
	desc, err := GetPluginDescription(binPath)
	if err != nil {
		err := fmt.Errorf("failed to describe plugin binary %q: %s", binPath, err)
		return &ContinuableInstallError{Err: err}
	}
	descVersion, err := goversion.NewSemver(desc.Version)
	if err != nil {
		err := fmt.Errorf("invalid self-reported version %q: %s", desc.Version, err)
		return &ContinuableInstallError{Err: err}
	}
	if descVersion.Core().Compare(version.Core()) != 0 {
		err := fmt.Errorf("binary reported version (%q) is different from the expected %q, skipping", desc.Version, version.String())
		return &ContinuableInstallError{Err: err}
	}
	if version.Prerelease() != "" {
		return &PrereleaseInstallError{
			PluginSrc: identifier,
			Err:       errors.New("binary reported a pre-release version of " + version.String()),
		}
	}
	// Since only final releases can be installed remotely, a non-empty prerelease version
	// means something's not right on the release, as it should report a final version.
	//
	// Therefore to avoid surprises (and avoid being able to install a version that
	// cannot be loaded), we error here, and advise users to manually install the plugin if they
	// need it.
	if descVersion.Prerelease() != "" {
		return &PrereleaseInstallError{
			PluginSrc: identifier,
			Err:       errors.New("binary reported a pre-release version of " + descVersion.String()),

View on GitHub (pinned to eb36e3c3e4)

Solutions

  1. Delete the mismatching binary from ~/.packer.d/plugins and re-run `packer init` for a fresh download
  2. Check the plugin repo's release assets — the maintainer may have published a stale build; report/upgrade when fixed
  3. Pin the required_plugins constraint to a version whose asset matches its tag
  4. If using a mirror, verify it serves the original release assets

Example fix

// before
rm ~/.packer.d/plugins/github.com/acme/acme-plugin*  # stale/mismatched binary
// after
packer init .  # re-downloads matching release
Defensive patterns

Strategy: validation

Validate before calling

// before install, compare expected tag vs binary's self-reported version
out, _ := exec.Command(binPath, "describe").Output()
var desc SetDescription
json.Unmarshal(out, &desc)
if semver(desc.Version).Core() != semver(expectedVersion).Core() {
    return fmt.Errorf("stale asset: binary says %s, release is %s", desc.Version, expectedVersion)
}

Prevention

When it happens

Trigger: descVersion.Core().Compare(version.Core()) != 0 during InstallLatest — the downloaded release asset's self-reported version differs from the GitHub tag version being installed.

Common situations: Plugin maintainer tagged a release but built/published an asset from a different commit (stale CI artifact); manually placed binaries in the plugin dir shadowing expectations; mirrored/proxied releases serving wrong assets.

Related errors


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