hashicorp/nomad · error

failed to get plugin info for plugin: %v

Error message

failed to get plugin info for plugin: %v

What it means

During plugin dispense, the loader calls PluginInfo() on the loaded base plugin to retrieve its metadata (name, API versions, etc.). If the plugin process itself returns an error from that RPC, the loader wraps it as 'failed to get plugin info for plugin: <err>'. This means the plugin was launched/reattached but could not report its own info.

Source

Thrown at helper/pluginutils/loader/loader.go:268

		return nil, err
	}

	instance := &externalPluginInstance{
		client:   client,
		instance: raw,
	}

	if apiVersion != "" {
		instance.apiVersion = apiVersion
	} else {
		// We do not know the API version since we are reattaching, so discover
		// it
		bplugin := raw.(base.BasePlugin)

		// Retrieve base plugin information
		i, err := bplugin.PluginInfo()
		if err != nil {
			return nil, fmt.Errorf("failed to get plugin info for plugin: %v", err)
		}

		apiVersion, err := l.selectApiVersion(i)
		if err != nil {
			return nil, fmt.Errorf("failed to validate API versions %v for plugin %s: %v", i.PluginApiVersions, i.Name, err)
		}
		if apiVersion == "" {
			return nil, fmt.Errorf("failed to reattach to plugin because supported API versions for the plugin and Nomad do not overlap")
		}

		instance.apiVersion = apiVersion
	}

	return instance, nil
}

// getPluginMap returns a plugin map based on the type of plugin being launched.
func getPluginMap(pluginType string, logger log.Logger) map[string]plugin.Plugin {

View on GitHub (pinned to 482b49bf1a)

Solutions

  1. Check the wrapped error to see why the plugin failed PluginInfo()
  2. Reinstall/upgrade the plugin binary to a version compatible with this Nomad build
  3. Run the plugin binary manually to verify it starts and responds
  4. Check the plugin's own logs for a panic or fatal error during startup

Example fix

// before: plugin binary built against mismatched SDK
// after: rebuild plugin with matching go-plugin/proto
// e.g. upgrade plugin repo's nomad-sdk dependency then redeploy the binary into the plugin_dir
Defensive patterns

Strategy: try-catch

Validate before calling

// precheck: ensure plugin binary exists and is executable before Dispense
info, err := os.Stat(filepath.Join(pluginDir, name))
if err != nil || info.IsDir() { return fmt.Errorf("plugin binary missing") }
if info.Mode()&0o111 == 0 { return fmt.Errorf("plugin binary not executable") }

Try / catch

inst, err := loader.Dispense(name, ptype, cfg, logger)
if err != nil {
    if strings.Contains(err.Error(), "failed to get plugin info") {
        logger.Error("plugin failed its PluginInfo RPC; reinstall/upgrade plugin", "err", err)
        // do not hot-loop; backoff and surface to operator
    }
    return err
}

Prevention

When it happens

Trigger: Calling loader.Dispense or loader.Reattach where the plugin's PluginInfo() method returns an error, e.g. the plugin binary crashed mid-handshake or its info endpoint failed.

Common situations: Broken or incompatible plugin binaries, plugins that panic during init, corrupted plugin installs, or a plugin exiting right after launch so the PluginInfo RPC fails.

Related errors


AI-assisted analysis of hashicorp/nomad@482b49bf1a (2026-09-04). Data as JSON: /api/errors/12e9ef0c53a1dc20. Report an issue: GitHub.