{"record":{"id":"8bf080a048844048","repo":"hashicorp/packer","slug":"binary-reported-version-q-is-different-from-the","errorCode":null,"errorMessage":"binary reported version (%q) is different from the expected %q, skipping","messagePattern":"binary reported version \\(%q\\) is different from the expected %q, skipping","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"packer/plugin-getter/plugins.go","lineNumber":993,"sourceCode":"\treturn desc, err\n}\n\n// checkVersion checks the described version of a plugin binary against the requested version constriant.\n// A ContinuableInstallError is returned upon a version mismatch to indicate that the caller should try the next\n// available version. A PrereleaseInstallError is returned to indicate an unsupported version install.\nfunc checkVersion(binPath string, identifier string, version *goversion.Version) error {\n\tdesc, err := GetPluginDescription(binPath)\n\tif err != nil {\n\t\terr := fmt.Errorf(\"failed to describe plugin binary %q: %s\", binPath, err)\n\t\treturn &ContinuableInstallError{Err: err}\n\t}\n\tdescVersion, err := goversion.NewSemver(desc.Version)\n\tif err != nil {\n\t\terr := fmt.Errorf(\"invalid self-reported version %q: %s\", desc.Version, err)\n\t\treturn &ContinuableInstallError{Err: err}\n\t}\n\tif descVersion.Core().Compare(version.Core()) != 0 {\n\t\terr := fmt.Errorf(\"binary reported version (%q) is different from the expected %q, skipping\", desc.Version, version.String())\n\t\treturn &ContinuableInstallError{Err: err}\n\t}\n\tif version.Prerelease() != \"\" {\n\t\treturn &PrereleaseInstallError{\n\t\t\tPluginSrc: identifier,\n\t\t\tErr:       errors.New(\"binary reported a pre-release version of \" + version.String()),\n\t\t}\n\t}\n\t// Since only final releases can be installed remotely, a non-empty prerelease version\n\t// means something's not right on the release, as it should report a final version.\n\t//\n\t// Therefore to avoid surprises (and avoid being able to install a version that\n\t// cannot be loaded), we error here, and advise users to manually install the plugin if they\n\t// need it.\n\tif descVersion.Prerelease() != \"\" {\n\t\treturn &PrereleaseInstallError{\n\t\t\tPluginSrc: identifier,\n\t\t\tErr:       errors.New(\"binary reported a pre-release version of \" + descVersion.String()),","sourceCodeStart":975,"sourceCodeEnd":1011,"githubUrl":"https://github.com/hashicorp/packer/blob/eb36e3c3e48a036f3e8cc94087636ee72e1303c9/packer/plugin-getter/plugins.go#L975-L1011","documentation":"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.","triggerScenarios":"descVersion.Core().Compare(version.Core()) != 0 during InstallLatest — the downloaded release asset's self-reported version differs from the GitHub tag version being installed.","commonSituations":"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.","solutions":["Delete the mismatching binary from ~/.packer.d/plugins and re-run `packer init` for a fresh download","Check the plugin repo's release assets — the maintainer may have published a stale build; report/upgrade when fixed","Pin the required_plugins constraint to a version whose asset matches its tag","If using a mirror, verify it serves the original release assets"],"exampleFix":"// before\nrm ~/.packer.d/plugins/github.com/acme/acme-plugin*  # stale/mismatched binary\n// after\npacker init .  # re-downloads matching release","handlingStrategy":"validation","validationCode":"// before install, compare expected tag vs binary's self-reported version\nout, _ := exec.Command(binPath, \"describe\").Output()\nvar desc SetDescription\njson.Unmarshal(out, &desc)\nif semver(desc.Version).Core() != semver(expectedVersion).Core() {\n    return fmt.Errorf(\"stale asset: binary says %s, release is %s\", desc.Version, expectedVersion)\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Never hand-place plugin binaries in the plugins directory; let packer manage them","Report plugin releases whose assets don't match their tags to the maintainer","Re-download (delete + packer init) after upstream re-publishes fixed assets","Pin constraints to releases verified to ship correct binaries"],"tags":["plugin-install","version-mismatch","checksum","packer"],"backgroundTag":"version-mismatch","analyzedSha":"eb36e3c3e48a036f3e8cc94087636ee72e1303c9","analyzedAt":"2026-09-05T13:20:43.127Z","contentChangedAt":"2026-09-05T13:20:43.127Z","schemaVersion":2},"datasetVersion":"2026-09-12T17:17:11.597Z"}