hashicorp/nomad · error
VolumeID is required
Error message
VolumeID is required
What it means
err("VolumeID is required") is produced by ClientCSINodeExpandVolumeRequest.Validate when the VolumeID field is empty. Like its sibling checks it is a programmer-error guard; a node expand request must identify the volume being expanded. It is combined with other validation errors via errors.Join.
Source
Thrown at client/structs/csi.go:484
ExternalID string // External ID of the volume to be expanded (required)
// Capacity range (required) to be sent to the node plugin
Capacity *csi.CapacityRange
// Claim currently held for the allocation (required)
// used to determine capabilities and the mount point on the client
Claim *structs.CSIVolumeClaim
}
func (req *ClientCSINodeExpandVolumeRequest) Validate() error {
var err error
// These should not occur during normal operations; they're here
// mainly to catch potential programmer error.
if req.PluginID == "" {
err = errors.Join(err, errors.New("PluginID is required"))
}
if req.VolumeID == "" {
err = errors.Join(err, errors.New("VolumeID is required"))
}
if req.ExternalID == "" {
err = errors.Join(err, errors.New("ExternalID is required"))
}
if req.Claim == nil {
err = errors.Join(err, errors.New("Claim is required"))
} else if req.Claim.AllocationID == "" {
err = errors.Join(err, errors.New("Claim.AllocationID is required"))
}
return err
}
type ClientCSINodeExpandVolumeResponse struct {
CapacityBytes int64
}
View on GitHub (pinned to 482b49bf1a)
Solutions
- Set VolumeID from the CSI volume claim before invoking the expand RPC
- Confirm the volume still exists locally (not GC'd) and its ID resolves
- Add a pre-call check that req.VolumeID != ""
- Inspect the joined Validate error to catch all missing fields at once
Example fix
// before
req := &cstructs.ClientCSINodeExpandVolumeRequest{PluginID: pluginID}
// after
req := &cstructs.ClientCSINodeExpandVolumeRequest{PluginID: pluginID, VolumeID: vol.ID, ExternalID: vol.RemoteID()} Defensive patterns
Strategy: validation
Validate before calling
if err := req.Validate(); err != nil { return err }
if req.VolumeID == "" { return errors.New("VolumeID must be set before node expand") } Try / catch
if err := req.Validate(); err != nil {
if strings.Contains(err.Error(), "VolumeID is required") {
// re-fetch the volume claim; it may have been GC'd
return refetchClaimAndRetry()
}
return err
} Prevention
- Set VolumeID from the local volume claim before the RPC
- Check the volume still exists (not GC'd) before expanding
- Run Validate() before issuing the gRPC call
- Cover request construction with tests asserting non-empty IDs
When it happens
Trigger: Submitting a ClientCSINodeExpandVolumeRequest with VolumeID == "" — the volume claim lookup returned nothing or the caller passed an empty volume ID.
Common situations: Volume state lost on the client, claim lookups returning empty IDs, or request construction bugs after volume GC.
Understand the failure class
Background: Schema validation failed / invalid input schema: payload rejected because its shape doesn't match the expected schema — this error's family across 28 libraries.
Related errors
AI-assisted analysis of hashicorp/nomad@482b49bf1a (2026-09-04).
Data as JSON: /api/errors/f35139875ec21928.
Report an issue: GitHub.