hashicorp/nomad · error
missing volume ID
Error message
missing volume ID
What it means
Guard in the CSIVolume.Get RPC: the request's volume ID is an empty string, so there is nothing to look up; the caller must supply the ID of the volume to fetch.
Source
Thrown at nomad/csi_endpoint.go:189
}
allowCSIAccess := acl.NamespaceValidator(acl.NamespaceCapabilityCSIReadVolume,
acl.NamespaceCapabilityCSIMountVolume,
acl.NamespaceCapabilityReadJob)
aclObj, err := v.srv.ResolveACL(args)
if err != nil {
return err
}
ns := args.RequestNamespace()
if !allowCSIAccess(aclObj, ns) {
return structs.ErrPermissionDenied
}
defer metrics.MeasureSince([]string{"nomad", "volume", "get"}, time.Now())
if args.ID == "" {
return fmt.Errorf("missing volume 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
}
vol, err := snap.CSIVolumeByID(ws, ns, args.ID)
if err != nil {
return err
}
if vol != nil {
vol, err = snap.CSIVolumeDenormalize(ws, vol)
}View on GitHub (pinned to 482b49bf1a)
Solutions
- Pass the volume ID in the request (args.ID)
- List volumes first with nomad volume status to find the correct ID
- Add client-side validation for the ID before calling the API
Example fix
// before
args := structs.CSIVolumeGetRequest{}
// after
args := structs.CSIVolumeGetRequest{ID: "my-volume"} Defensive patterns
Strategy: validation
Validate before calling
if args.ID == "" {
return errors.New("volume ID is required")
} Try / catch
err := client volume get; if err != nil && strings.Contains(err.Error(), "missing volume ID") { fix request and retry } Prevention
- Always fetch the volume ID from nomad volume status before querying
- Check shell variables are non-empty before API calls
- Validate request structs client-side before RPC
When it happens
Trigger: Calling CSIVolumeGet (or the nomad volume status CLI/API) with args.ID set to "".
Common situations: Scripting the HTTP API with a missing/unexpanded variable for the volume ID; CLI parsing bugs; copying an example command without filling the ID.
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
AI-assisted analysis of hashicorp/nomad@482b49bf1a (2026-09-04).
Data as JSON: /api/errors/f91cc951acef4fbd.
Report an issue: GitHub.