hashicorp/nomad · error
failed to parse plugin %q (%v) version %q: %v
Error message
failed to parse plugin %q (%v) version %q: %v
What it means
After PluginInfo() succeeds, fingerprintPlugin() parses i.PluginVersion with hashicorp/go-version's version.NewVersion. This error is returned when the version string reported by the plugin is not a valid semver-compatible version. The plugin is skipped and cannot be registered because its version cannot be compared against constraints.
Source
Thrown at helper/pluginutils/loader/init.go:382
raw, err := rpcClient.Dispense(base.PluginTypeBase)
if err != nil {
return nil, err
}
// Cast the plugin to the base type
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 %q: %v", info.exePath, err)
}
info.baseInfo = i
// Parse and set the plugin version
v, err := version.NewVersion(i.PluginVersion)
if err != nil {
return nil, fmt.Errorf("failed to parse plugin %q (%v) version %q: %v",
i.Name, info.exePath, i.PluginVersion, err)
}
info.version = v
// Detect the plugin API version to use
av, err := l.selectApiVersion(i)
if err != nil {
return nil, fmt.Errorf("failed to validate API versions %v for plugin %s (%v): %v", i.PluginApiVersions, i.Name, info.exePath, err)
}
if av == "" {
l.logger.Warn("skipping plugin because supported API versions for plugin and Nomad do not overlap", "plugin", i.Name, "path", info.exePath)
return nil, nil
}
info.apiVersion = av
// Retrieve the schema
schema, err := bplugin.ConfigSchema()
if err != nil {View on GitHub (pinned to 482b49bf1a)
Solutions
- Make the plugin return a valid semver string in PluginInfoResponse.PluginVersion (e.g. "0.1.0").
- Remove leading issues: 'v' prefix is allowed, but no extra dots/dashes; validate with a semver checker.
- Rebuild and redeploy the plugin with the corrected version string.
- If you cannot patch the plugin, remove it from plugin_dir to stop the error.
- Confirm with the plugin vendor that the released binary reports a semver PluginVersion.
Example fix
// before
return &base.PluginInfoResponse{..., PluginVersion: "dev"}, nil
// after
return &base.PluginInfoResponse{..., PluginVersion: "0.1.0"}, nil Defensive patterns
Strategy: validation
Validate before calling
// validate the plugin's reported version is semver before deploying
import "github.com/hashicorp/go-version"
_, err := version.NewVersion(pluginInfo.PluginVersion)
if err != nil {
log.Fatalf("plugin version %q is not semver: %v", pluginInfo.PluginVersion, err)
} Try / catch
// Go: detect and isolate the bad plugin
if _, err := loader.Load(); err != nil {
if strings.Contains(err.Error(), "failed to parse plugin") {
log.Printf("skipping plugin with invalid version string: %v", err)
}
} Prevention
- Always set PluginVersion to a valid semver string (e.g. "1.2.0"); never "dev" or empty.
- Add a CI check that asserts the plugin's PluginInfoResponse version parses via go-version.
- Use a shared version constant in the plugin source to avoid typos.
- Pin hashicorp/go-version in the plugin to a version consistent with Nomad's.
When it happens
Trigger: version.NewVersion(i.PluginVersion) fails because the plugin's PluginInfoResponse.PluginVersion is empty, or contains a non-semantic string like "dev", "v1", "1.0.0-beta+" (malformed), or free-form text.
Common situations: Hand-written plugins that set PluginVersion to something like "latest" or leave it empty; plugins using non-semver internal versioning schemes; typos such as "0.1.0.1" (four segments).
Understand the failure class
- Parsing and encoding errors: unexpected token, malformed input — why parsers reject input and how to find the real culprit.
Related errors
- PluginInfo info failed for internal plugin %s: %v
- failed to get plugin info for plugin %q: %v
- missing accessor ID
- operation on unknown device(s) "%s/%s/%s" (%v): %v
- error interpreting desired Envoy version from Consul: %w
AI-assisted analysis of hashicorp/nomad@482b49bf1a (2026-09-04).
Data as JSON: /api/errors/e1e112f9724604fe.
Report an issue: GitHub.