hashicorp/packer · error

failed to get plugin description from executable %q: %s

Error message

failed to get plugin description from executable %q: %s

What it means

DiscoverMultiPlugin wraps any failure to read a plugin binary's self-described metadata (name, version, protocol) via plugingetter.GetPluginDescription. Packer discovers multi-component plugins by exec'ing the binary and parsing its description output; if the binary cannot be executed, does not print the expected description, or crashes, discovery of that plugin fails with this wrapped message.

Source

Thrown at packer/plugin.go:138

	return nil
}

const ForceGobEnvvar = "PACKER_FORCE_GOB"

var PackerUseProto = true

// DiscoverMultiPlugin takes the description from a multi-component plugin
// binary and makes the plugins available to use in Packer. Each plugin found in the
// binary will be addressable using `${pluginName}-${builderName}` for example.
// pluginName could be manually set. It usually is a cloud name like amazon.
// pluginName can be extrapolated from the filename of the binary; so
// if the "packer-plugin-amazon" binary had an "ebs" builder one could use
// the "amazon-ebs" builder.
func (c *PluginConfig) DiscoverMultiPlugin(pluginName, pluginPath string) error {
	desc, err := plugingetter.GetPluginDescription(pluginPath)
	if err != nil {
		return fmt.Errorf("failed to get plugin description from executable %q: %s", pluginPath, err)
	}

	canProto := desc.ProtocolVersion == "v2"
	if os.Getenv(ForceGobEnvvar) != "" && os.Getenv(ForceGobEnvvar) != "0" {
		canProto = false
	}

	// Keeps track of whether or not the plugin had components registered
	//
	// If no components are registered, we don't need to clamp usage of
	// protobuf regardless if the plugin supports it or not, as we won't
	// use it at all.
	registered := false

	pluginPrefix := pluginName + "-"
	pluginDetails := PluginDetails{
		Name:        pluginName,
		Description: desc,

View on GitHub (pinned to eb36e3c3e4)

Solutions

  1. Verify the file at the reported path exists and is executable (chmod +x / re-download the plugin).
  2. Download the correct build of the plugin for your OS/architecture (e.g. via `packer plugins install`).
  3. Run the plugin binary directly with the `packer-plugin` description arg to see the underlying crash output.
  4. Remove stale or unrelated executables from the plugin discovery directory.

Example fix

// before: wrong arch binary copied manually, fails discovery
$ cp packer-plugin-amazon_darwin_amd64 ~/.packer.d/plugins/github.com/hashicorp/amazon
// error: failed to get plugin description from executable ...: exec format error
// after: let Packer install the matching build
$ packer plugins install github.com/hashicorp/amazon
Defensive patterns

Strategy: validation

Validate before calling

func canRun(path string) error {
  fi, err := os.Stat(path)
  if err != nil { return err }
  if fi.IsDir() { return fmt.Errorf("%s is a directory", path) }
  if fi.Mode()&0o111 == 0 { return fmt.Errorf("%s is not executable", path) }
  return nil
}

Try / catch

if err := cfg.DiscoverMultiPlugin(name, path); err != nil {
  var execErr *exec.Error
  if errors.As(err, &execErr) { /* re-download correct build */ }
  log.Printf("plugin %s unusable: %v", path, err)
}

Prevention

When it happens

Trigger: Calling PluginConfig.DiscoverMultiPlugin(pluginName, pluginPath) (directly or via Discover) with a pluginPath whose binary: does not exist or is not executable; is not a valid Packer plugin; prints malformed description output; or fails to run on the current OS/arch.

Common situations: A stale or corrupted binary in the plugin directory; downloading the wrong platform build of a plugin (e.g. linux/amd64 binary on macOS); a plugin built against an incompatible SDK that panics on startup; file permissions preventing execution; a non-plugin executable placed in the PACKER_PLUGIN_PATH or .packer.d/plugins directory.

Related errors


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