{"record":{"id":"b894ac9abc58b162","repo":"hashicorp/packer","slug":"failed-to-get-plugin-description-from-executable","errorCode":null,"errorMessage":"failed to get plugin description from executable %q: %s","messagePattern":"failed to get plugin description from executable %q: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"packer/plugin.go","lineNumber":138,"sourceCode":"\n\treturn nil\n}\n\nconst ForceGobEnvvar = \"PACKER_FORCE_GOB\"\n\nvar PackerUseProto = true\n\n// DiscoverMultiPlugin takes the description from a multi-component plugin\n// binary and makes the plugins available to use in Packer. Each plugin found in the\n// binary will be addressable using `${pluginName}-${builderName}` for example.\n// pluginName could be manually set. It usually is a cloud name like amazon.\n// pluginName can be extrapolated from the filename of the binary; so\n// if the \"packer-plugin-amazon\" binary had an \"ebs\" builder one could use\n// the \"amazon-ebs\" builder.\nfunc (c *PluginConfig) DiscoverMultiPlugin(pluginName, pluginPath string) error {\n\tdesc, err := plugingetter.GetPluginDescription(pluginPath)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"failed to get plugin description from executable %q: %s\", pluginPath, err)\n\t}\n\n\tcanProto := desc.ProtocolVersion == \"v2\"\n\tif os.Getenv(ForceGobEnvvar) != \"\" && os.Getenv(ForceGobEnvvar) != \"0\" {\n\t\tcanProto = false\n\t}\n\n\t// Keeps track of whether or not the plugin had components registered\n\t//\n\t// If no components are registered, we don't need to clamp usage of\n\t// protobuf regardless if the plugin supports it or not, as we won't\n\t// use it at all.\n\tregistered := false\n\n\tpluginPrefix := pluginName + \"-\"\n\tpluginDetails := PluginDetails{\n\t\tName:        pluginName,\n\t\tDescription: desc,","sourceCodeStart":120,"sourceCodeEnd":156,"githubUrl":"https://github.com/hashicorp/packer/blob/eb36e3c3e48a036f3e8cc94087636ee72e1303c9/packer/plugin.go#L120-L156","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","solutions":["Verify the file at the reported path exists and is executable (chmod +x / re-download the plugin).","Download the correct build of the plugin for your OS/architecture (e.g. via `packer plugins install`).","Run the plugin binary directly with the `packer-plugin` description arg to see the underlying crash output.","Remove stale or unrelated executables from the plugin discovery directory."],"exampleFix":"// before: wrong arch binary copied manually, fails discovery\n$ cp packer-plugin-amazon_darwin_amd64 ~/.packer.d/plugins/github.com/hashicorp/amazon\n// error: failed to get plugin description from executable ...: exec format error\n// after: let Packer install the matching build\n$ packer plugins install github.com/hashicorp/amazon","handlingStrategy":"validation","validationCode":"func canRun(path string) error {\n  fi, err := os.Stat(path)\n  if err != nil { return err }\n  if fi.IsDir() { return fmt.Errorf(\"%s is a directory\", path) }\n  if fi.Mode()&0o111 == 0 { return fmt.Errorf(\"%s is not executable\", path) }\n  return nil\n}","typeGuard":null,"tryCatchPattern":"if err := cfg.DiscoverMultiPlugin(name, path); err != nil {\n  var execErr *exec.Error\n  if errors.As(err, &execErr) { /* re-download correct build */ }\n  log.Printf(\"plugin %s unusable: %v\", path, err)\n}","preventionTips":["Install plugins with `packer plugins install` instead of manual downloads.","Verify the binary matches your OS/arch before placing it in the plugin dir.","Keep the plugin directory clean of unrelated executables.","Run the plugin binary manually to confirm it emits a description."],"tags":["plugin-discovery","exec","plugin-binary"],"backgroundTag":"plugin-execution-failed","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"}