hashicorp/packer · error

could not install any compatible version of plugin %q

Error message

could not install any compatible version of plugin %q

What it means

Final aggregate error of InstallLatest: after trying all candidate versions, no compatible version of the plugin could be installed. It is appended to any more-specific errors (checksum missing, no matching release) and returned as a multierror, so the full message usually contains the root cause above it.

Source

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

				}

			}
		}
	}

	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
	}

	desc := pluginsdk.SetDescription{}
	err = json.Unmarshal(out, &desc)

	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.

View on GitHub (pinned to eb36e3c3e4)

Solutions

  1. Read the full multierror output — the first error above this line names the real cause
  2. Run `packer init` with PACKER_LOG=1 for verbose download/logging detail
  3. Manually verify plugin availability: curl the release URL, or install locally with `packer plugins install <path>`
  4. Relax required_plugins constraints if the constraint excluded every release
  5. Fix the underlying issue (network, disk, permissions) identified in the sibling errors

Example fix

// before
$ packer init .
Error: could not install any compatible version of plugin "github.com/hashicorp/amazon"
// after (diagnose root cause first)
$ PACKER_LOG=1 packer init . 2>&1 | grep -i checksum
Defensive patterns

Strategy: try-catch

Try / catch

// parse the multierror: this line is a summary; act on the first cause
if err := run("packer", "init", "."); err != nil {
    if strings.Contains(err.Error(), "could not install any compatible version") {
        // log full error; root cause is in the earlier multierror lines
        log.Printf("plugin install failed, full error:\n%s", err)
        // fallback: install manually
        run("packer", "plugins", "install", "github.com/hashicorp/amazon")
    }
}

Prevention

When it happens

Trigger: Any failure path in InstallLatest that leaves the plugin uninstalled: all versions failed checksum, were skipped by checkVersion, or failed download/write — this line is the terminal summary appended before returning.

Common situations: Corporate proxies blocking github.com; constrained version strings matching nothing; every candidate binary failing the self-reported version check; disk/permission errors during file write.

Related errors


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