hashicorp/nomad · error
missing volume ID to delete
Error message
missing volume ID to delete
What it means
HostVolume.Delete requires args.VolumeID to identify which host volume to remove. If the delete request carries an empty VolumeID (after ACL and namespace checks), the server rejects it with this plain input-validation error instead of attempting a state lookup.
Source
Thrown at nomad/host_volume_endpoint.go:683
) {
return fmt.Errorf(
"all servers should be running version %v or later to use dynamic host volumes",
minVersionDynamicHostVolumes,
)
}
// Note that all deleted volumes need to be in the same namespace
allowVolume := acl.NamespaceValidator(acl.NamespaceCapabilityHostVolumeDelete)
aclObj, err := v.srv.ResolveACL(args)
if err != nil {
return err
}
if !allowVolume(aclObj, args.RequestNamespace()) {
return structs.ErrPermissionDenied
}
if args.VolumeID == "" {
return fmt.Errorf("missing volume ID to delete")
}
snap, err := v.srv.State().Snapshot()
if err != nil {
return err
}
ns := args.RequestNamespace()
id := args.VolumeID
vol, err := snap.HostVolumeByID(nil, ns, id, true)
if err != nil {
return fmt.Errorf("could not query host volume: %w", err)
}
if vol == nil {
return fmt.Errorf("no such volume: %s", id)
}
if len(vol.Allocations) > 0 {View on GitHub (pinned to 482b49bf1a)
Solutions
- Supply the volume ID: `nomad host volume delete <volume-id>`.
- Fix the script/templating so the ID variable is populated before the call.
- Verify with `nomad host volume status <name>` which ID corresponds to the volume.
Example fix
// before nomad host volume delete "$VOL_ID" # VOL_ID unset // after VOL_ID=$(nomad host volume status -json my-vol | jq -r '.ID') nomad host volume delete "$VOL_ID"
Defensive patterns
Strategy: validation
Validate before calling
if volID == "" {
return fmt.Errorf("volume ID required; got empty value from $VOL_ID")
}
// CLI: [ -n "$VOL_ID" ] && nomad host volume delete "$VOL_ID" Prevention
- Use `set -u` in shell scripts to catch unset variables.
- Resolve IDs via `nomad host volume status` before delete calls.
- Fail fast in CI when an ID-producing step outputs nothing.
When it happens
Trigger: Sending a HostVolumeDeleteRequest with VolumeID left unset — e.g. CLI/SDK call where the ID variable was empty, templating failed to interpolate the volume name, or a script passed an unset shell variable.
Common situations: Shell scripts with `nomad host volume delete "$VOL_ID"` where VOL_ID is empty; CI pipelines where a previous step failed to export the ID; copy-pasted API calls missing the id field in JSON.
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
- ErrPluginNotExists
- Error listing host volumes
- task driver %q for %q does not support host volumes
- Node ID must contain at least two characters.
- invalid host_volumes limit: %v
AI-assisted analysis of hashicorp/nomad@482b49bf1a (2026-09-04).
Data as JSON: /api/errors/d6d3b55898fbe776.
Report an issue: GitHub.