hashicorp/packer · error
no release version found for constraints: %q
Error message
no release version found for constraints: %q
What it means
InstallLatest iterated all available releases (remote listing plus local fallback) and found no version satisfying the requirement's VersionConstraints. Thrown when the `versions` slice is empty and no other error was recorded; the constraint string is quoted in the message.
Source
Thrown at packer/plugin-getter/plugins.go:952
log.Printf("[WARNING] %v, ignoring", err)
os.Remove(outputFileName)
continue
}
// Success !!
return &Installation{
BinaryPath: strings.ReplaceAll(outputFileName, "\\", "/"),
Version: "v" + version.String(),
}, nil
}
}
}
}
if len(versions) == 0 {
if errs.Len() == 0 {
err := fmt.Errorf("no release version found for constraints: %q", pr.VersionConstraints.String())
errs = multierror.Append(errs, err)
}
return nil, errs
}
if errs.ErrorOrNil() == nil {
err := fmt.Errorf("could not find a local nor a remote checksum for plugin %q %q", pr.Identifier, pr.VersionConstraints)
errs = multierror.Append(errs, err)
}
errs = multierror.Append(errs, fmt.Errorf("could not install any compatible version of plugin %q", pr.Identifier))
return nil, errs
}
func GetPluginDescription(pluginPath string) (pluginsdk.SetDescription, error) {
out, err := exec.Command(pluginPath, "describe").Output()
if err != nil {
return pluginsdk.SetDescription{}, err
}View on GitHub (pinned to eb36e3c3e4)
Solutions
- Loosen the required_plugins version constraint in the .pkr.hcl (e.g. `version >= "1.0.0"`)
- Run `packer plugins installed` / check GitHub releases for the plugin to see which versions actually exist
- Check for pre-release-only matches and pin an explicit released version
- Verify the plugin source identifier (hostname/namespace/name) is correct
- Fix network/proxy access to github.com if release listing failed
Example fix
// before
packer {
required_plugins {
amazon = { version = "= 9.9.9", source = "github.com/hashicorp/amazon" }
}
}
// after
packer {
required_plugins {
amazon = { version = ">= 1.2.0", source = "github.com/hashicorp/amazon" }
}
} Defensive patterns
Strategy: validation
Validate before calling
// check the constraint resolves against real releases before init
// e.g. curl https://api.github.com/repos/hashicorp/packer-plugin-amazon/tags
// and confirm the required version exists and is not pre-release-only
required := `version >= "1.2.0"`
if !anyReleaseSatisfies("github.com/hashicorp/amazon", required) {
return fmt.Errorf("constraint %q has no matching release", required)
} Prevention
- Verify plugin identifiers and versions against the plugin's GitHub releases page
- Use range constraints (>= x.y) rather than exact pins of unreleased versions
- Remember pre-release tags are skipped by the getter
- Pin constraints after checking `packer plugins installed` output
When it happens
Trigger: required_plugins constraint in the HCL template (e.g. `version >= "1.2.0"`) matches none of the plugin's published GitHub releases, or the plugin identifier has no releases at all.
Common situations: Typos or overly tight version constraints; requesting a version that only exists as a pre-release which the getter skips; plugin renamed/moved on GitHub so the release listing is empty; offline or proxied environment where release listing fails silently and local copies don't match the constraint.
Related errors
- could not install any compatible version of plugin %q
- unsupported dependency type %q; locals can only depend on lo
- unhandled buildvar type: %T
- could not write final plugin binary file: %w
- failed to checksum binary file: %s
AI-assisted analysis of hashicorp/packer@eb36e3c3e4 (2026-09-05).
Data as JSON: /api/errors/6e1748938d6dd24d.
Report an issue: GitHub.