hashicorp/nomad · error

nil plugin info given

Error message

nil plugin info given

What it means

PluginLoader.selectApiVersion guard: the passed *base.PluginInfoResponse is nil, meaning a plugin (internal or fingerprinted) returned no info object; the loader treats it as a malformed plugin response.

Source

Thrown at helper/pluginutils/loader/init.go:175

		info.configSchema = schema

		// Store the fingerprinted config
		fingerprinted[k] = info
	}

	if err := mErr.ErrorOrNil(); err != nil {
		return nil, err
	}

	return fingerprinted, nil
}

// selectApiVersion takes in PluginInfo and returns the highest compatable
// version or an error if the plugins response is malformed. If there is no
// overlap, an empty string is returned.
func (l *PluginLoader) selectApiVersion(i *base.PluginInfoResponse) (string, error) {
	if i == nil {
		return "", fmt.Errorf("nil plugin info given")
	}
	if len(i.PluginApiVersions) == 0 {
		return "", fmt.Errorf("plugin provided no compatible API versions")
	}

	pluginVersions, err := convertVersions(i.PluginApiVersions)
	if err != nil {
		return "", fmt.Errorf("plugin provided invalid versions: %v", err)
	}

	// Lookup the supported versions. These will be sorted highest to lowest
	supportedVersions, ok := l.supportedVersions[i.Type]
	if !ok {
		return "", fmt.Errorf("unsupported plugin type %q", i.Type)
	}

	for _, sv := range supportedVersions {
		for _, pv := range pluginVersions {

View on GitHub (pinned to 482b49bf1a)

Solutions

  1. Fix the plugin's PluginInfo() to never return a nil response with a nil error; return a populated PluginInfoResponse
  2. Add a nil check at the call site before invoking selectApiVersion
  3. Re-fingerprint the plugin after fixing so a valid PluginInfoResponse is cached

Example fix

// before
info, err := p.PluginInfo() // returns nil, nil
// after
if info == nil { return nil, errors.New("plugin returned nil info") }
Defensive patterns

Strategy: type-guard

Type guard

func hasPluginInfo(p base.BasePlugin) bool {
    if p == nil { return false }
    i, err := p.PluginInfo()
    return err == nil && i != nil
}

Try / catch

if info == nil {
    return nil, fmt.Errorf("nil plugin info") // mirror the loader's guard before calling selectApiVersion
}

Prevention

When it happens

Trigger: A caller of selectApiVersion (initInternal, fingerprintPlugin, dispensePlugin) passes the result of a PluginInfo() call that was nil or was passed through without a nil check, e.g. ignoring the nil-return path of a base plugin implementation.

Common situations: A base plugin implementation returns (nil, nil) from PluginInfo, or an earlier fingerprint step stored a nil PluginInfoResponse and dispense later negotiates with it.

Related errors


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