hashicorp/nomad · error
missing plugin ID
Error message
missing plugin ID
What it means
Nomad's CSIPlugin.Get RPC looks up a single CSI plugin by ID. When the request's ID field is empty, the endpoint rejects the read up front rather than performing a blocking query with an empty key. It is a strict request-validation error from the client sending an unset plugin ID.
Source
Thrown at nomad/csi_endpoint.go:1910
v.srv.MeasureRPCRate("csi_plugin", structs.RateMetricRead, args)
if authErr != nil {
return structs.ErrPermissionDenied
}
defer metrics.MeasureSince([]string{"nomad", "plugin", "get"}, time.Now())
aclObj, err := v.srv.ResolveACL(args)
if err != nil {
return err
}
if !aclObj.AllowPluginRead() {
return structs.ErrPermissionDenied
}
ns := args.RequestNamespace()
withAllocs := aclObj.AllowNsOp(ns, acl.NamespaceCapabilityReadJob)
if args.ID == "" {
return fmt.Errorf("missing plugin ID")
}
opts := blockingOptions{
queryOpts: &args.QueryOptions,
queryMeta: &reply.QueryMeta,
run: func(ws memdb.WatchSet, state *state.StateStore) error {
snap, err := state.Snapshot()
if err != nil {
return err
}
plug, err := snap.CSIPluginByID(ws, args.ID)
if err != nil {
return err
}
if plug == nil {
return nilView on GitHub (pinned to 482b49bf1a)
Solutions
- Pass a non-empty plugin ID: nomad plugin status <plugin-id>
- List available plugins with nomad node status or GET /v1/plugins to find the correct ID
- In scripts, guard the variable: [ -n "$PLUGIN_ID" ] || exit 1 before calling the API
- In API/SDK calls, ensure args.ID is populated before issuing the request
Example fix
// before PLUGIN_ID="" nomad plugin status "$PLUGIN_ID" // missing plugin ID // after PLUGIN_ID="aws-ebs-csi-driver" [ -n "$PLUGIN_ID" ] && nomad plugin status "$PLUGIN_ID"
Defensive patterns
Strategy: validation
Validate before calling
if pluginID == "" {
return fmt.Errorf("plugin ID required; use GET /v1/plugins to list IDs")
} Type guard
func validPluginID(id string) bool { return strings.TrimSpace(id) != "" } Try / catch
plugin, err := client.CSIPlugins().Get(id)
if err != nil {
if strings.Contains(err.Error(), "missing plugin ID") {
return nil, fmt.Errorf("plugin ID was empty; check script variable")
}
return nil, err
} Prevention
- Never interpolate shell variables into plugin commands without a non-empty check
- Fetch IDs from GET /v1/plugins instead of hardcoding
- Use `set -u` in bash scripts to catch unset variables
- Fail fast at script start when an ID variable is blank
When it happens
Trigger: Calling GET /v1/plugin/<id> or nomad plugin status with an empty/omitted plugin ID (e.g. nomad plugin status ""), or a client SDK invocation where the plugin ID parameter was left unset.
Common situations: Scripting `nomad plugin status $PLUGIN_ID` where the variable is empty because a previous command failed; parsing plugin IDs from templates/CI output that produced a blank string; SDK calls with a zero-value struct.
Understand the failure class
Background: "missing required argument" and "the following required arguments were not provided": what required-argument errors mean and how to fix them — this error's family across 20 libraries.
Related errors
- missing plugin ID
- missing secret ID
- CSI.ControllerAttachVolume: VolumeID is required
- CSI.ControllerAttachVolume: ClientCSINodeID is required
- CSI.ControllerDetachVolume: VolumeID is required
AI-assisted analysis of hashicorp/nomad@482b49bf1a (2026-09-04).
Data as JSON: /api/errors/f7a6c6244587cbbf.
Report an issue: GitHub.