hashicorp/packer · error
ListInstallations: failed to list installed plugins: %s
Error message
ListInstallations: failed to list installed plugins: %s
What it means
Requirement.ListInstallations() wraps any failure from getPluginBinaries() (which globs the plugin directories for installed binaries) with this prefixed message. The underlying error is a filesystem/glob problem, not a plugin problem — Packer could not enumerate what is installed.
Source
Thrown at packer/plugin-getter/plugins.go:228
return retMatches, err
}
// ListInstallations lists unique installed versions of plugin Requirement pr
// with opts as a filter.
//
// Installations are sorted by version and one binary per version is returned.
// Last binary detected takes precedence: in the order 'FromFolders' option.
//
// At least one opts.Checksumers must be given for a binary to be even
// considered.
func (pr Requirement) ListInstallations(opts ListInstallationsOptions) (InstallList, error) {
res := InstallList{}
log.Printf("[TRACE] listing potential installations for %q that match %q. %#v", pr.Identifier, pr.VersionConstraints, opts)
matches, err := pr.getPluginBinaries(opts)
if err != nil {
return nil, fmt.Errorf("ListInstallations: failed to list installed plugins: %s", err)
}
for _, path := range matches {
fname := filepath.Base(path)
if fname == "." {
continue
}
checksumOk := false
for _, checksummer := range opts.Checksummers {
cs, err := checksummer.GetCacheChecksumOfFile(path)
if err != nil {
log.Printf("[TRACE] GetChecksumOfFile(%q) failed: %v", path, err)
continue
}
if err := checksummer.ChecksumFile(cs, path); err != nil {View on GitHub (pinned to eb36e3c3e4)
Solutions
- Inspect the wrapped inner error (%s) to identify the failing path, then verify that directory exists and is readable (ls the PACKER_PLUGIN_PATH / ~/.packer.d/plugins tree).
- Fix the environment: set PACKER_PLUGIN_PATH or HOME/XDG_CONFIG_HOME to a valid, accessible directory.
- Recreate the plugin directory with correct permissions, then retry the packer command.
Defensive patterns
Strategy: try-catch
Validate before calling
for _, dir := range opts.FromFolders {
if fi, err := os.Stat(dir); err != nil || !fi.IsDir() {
return fmt.Errorf("plugin dir %q missing or not a directory", dir)
}
} Try / catch
installs, err := req.ListInstallations(opts)
if err != nil {
return fmt.Errorf("%v: check PACKER_PLUGIN_PATH and %s are readable", err, defaultPluginDir)
} Prevention
- Verify PACKER_PLUGIN_PATH/HOME point to accessible directories before running packer
- Ensure plugin directories exist with correct permissions in CI images
- Log the resolved plugin directory at debug level during setup
When it happens
Trigger: Calling ListInstallations when pr.getPluginBinaries(opts) fails: the plugin directory path is unreadable, a glob pattern is invalid, or an I/O error occurs while walking ~/.packer.d/plugins/... (often because opts.FromFolders or env-configured paths point somewhere inaccessible).
Common situations: PACKER_PLUGIN_PATH points to a nonexistent or permission-restricted directory; home directory redirection (HOME/XDG) wrong in CI containers; a path that is a file rather than a directory.
Related errors
- Checksum: failed to open file for checksum: %s
- malformed filename expected %s{version}_x{protocol-version}_
- wrong version: %s does not match expected %s
- wrong system, expected %s_%s
- Invalid remote protocol: %q, expected something like '%s.%s'
AI-assisted analysis of hashicorp/packer@eb36e3c3e4 (2026-09-05).
Data as JSON: /api/errors/5b56abb9848110fd.
Report an issue: GitHub.