{"record":{"id":"7b963634609480d4","repo":"hashicorp/packer","slug":"invalid-self-reported-version-q-s","errorCode":null,"errorMessage":"invalid self-reported version %q: %s","messagePattern":"invalid self-reported version %q: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"packer/plugin-getter/plugins.go","lineNumber":989,"sourceCode":"\n\tdesc := pluginsdk.SetDescription{}\n\terr = json.Unmarshal(out, &desc)\n\n\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.","sourceCodeStart":971,"sourceCodeEnd":1007,"githubUrl":"https://github.com/hashicorp/packer/blob/eb36e3c3e48a036f3e8cc94087636ee72e1303c9/packer/plugin-getter/plugins.go#L971-L1007","documentation":"checkVersion parsed the version string reported by the plugin's `describe` output and it isn't valid semver. Returned as a ContinuableInstallError so InstallLatest skips to the next candidate version. The plugin binary is present but reports a malformed version.","triggerScenarios":"goversion.NewSemver(desc.Version) fails — the plugin's SetDescription/Version field contains a non-semver string (e.g. \"v1beta\", \"dev\", empty, or free-form text) instead of a valid semver like 1.2.3.","commonSituations":"Custom/in-house plugins built without setting a proper sdk version; plugins built from a git checkout without version ldflags; third-party plugins not following the plugin SDK versioning conventions.","solutions":["Rebuild the plugin setting a valid semver in its version (check how the release pipeline injects it)","Use an official release of the plugin instead of a locally built/dev binary","Skip the local copy: remove it from the plugins dir and let packer download a released version","If it's your plugin, set pluginsdk.SetDescription Version to a valid semver string (e.g. \"1.0.0\")"],"exampleFix":"// before (plugin main.go built without version)\nVersion: os.Getenv(\"VERSION\"), // empty at runtime\n// after\ngo build -ldflags \"-X main.version=1.2.3\" .","handlingStrategy":"validation","validationCode":"// validate the version string before feeding it to semver parsing\nimport \"regexp\"\nvar semverRe = regexp.MustCompile(`^v?\\d+\\.\\d+\\.\\d+(-[0-9A-Za-z.-]+)?$`)\nif !semverRe.MatchString(desc.Version) {\n    return fmt.Errorf(\"plugin reports non-semver version %q\", desc.Version)\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Build plugins with an explicit semver ldflags version; never ship \"dev\" builds as releases","Use official plugin releases rather than local checkouts","For custom plugins, set SetDescription.Version to a valid semver string","Treat ContinuableInstallError as a signal to try the next release, not a hard failure"],"tags":["plugin-install","semver","versioning","packer"],"backgroundTag":"invalid-semver","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"}