hashicorp/nomad · error
missing %s
Error message
missing %s
What it means
validateHostVolumes checks that every host volume requested by the allocation exists in the client node's configured HostVolumes. When a requested volume source is absent from clientVolumesByName, it appends "missing <source>" to a multierror. This protects against using volumes that vanished after a client restart.
Source
Thrown at client/allocrunner/taskrunner/volume_hook.go:55
func validateHostVolumes(requestedByAlias map[string]*structs.VolumeRequest, clientVolumesByName map[string]*structs.ClientHostVolumeConfig, allocName string) error {
var result error
for _, req := range requestedByAlias {
// This is a defensive check, but this function should only ever receive
// host-type volumes.
if req.Type != structs.VolumeTypeHost {
continue
}
source := req.Source
if req.PerAlloc {
source = source + structs.AllocSuffix(allocName)
}
_, ok := clientVolumesByName[source]
if !ok {
result = multierror.Append(result, fmt.Errorf("missing %s", source))
}
}
return result
}
// hostVolumeMountConfigurations takes the users requested volume mounts,
// volumes, and the client host volume configuration and converts them into a
// format that can be used by drivers.
func (h *volumeHook) hostVolumeMountConfigurations(taskMounts []*structs.VolumeMount, taskVolumesByAlias map[string]*structs.VolumeRequest, clientVolumesByName map[string]*structs.ClientHostVolumeConfig, allocName string) ([]*drivers.MountConfig, error) {
var mounts []*drivers.MountConfig
for _, m := range taskMounts {
req, ok := taskVolumesByAlias[m.Volume]
if !ok {
// This function receives only the task volumes that are of type Host,
// if we can't find a group volume then we assume the mount is for another
// type.
continueView on GitHub (pinned to 482b49bf1a)
Solutions
- Add the missing host_volume stanza to the client's config and restart the nomad agent
- Fix the volume source name in the job's volume_mount to match the client config
- Reschedule the job on a node that has the volume configured (use constraint based on client volume metadata)
- Check `nomad node status <id> -volumes`-style inspection / client config to compare requested vs configured sources
Example fix
// client.hcl: before
# (no host_volume stanza)
// after
host_volume "shared-data" {
path = "/srv/shared"
read_only = false
} Defensive patterns
Strategy: validation
Validate before calling
// validate the job against the node's configured volumes before submit // CLI: nomad job validate job.nomad.hcl (surfaces missing volume sources) // in CI: parse client config and assert every volume_mount source exists in host_volume stanzas
Prevention
- Run `nomad job validate` in CI for every job change
- Keep host_volume stanzas in versioned client config; deploy config and volumes together
- Use node constraints/metadata to target nodes that declare the volumes
- After any client config change, verify volumes with node inspection before draining/rescheduling
When it happens
Trigger: Job requests a volume_mount with a source not present in the Nomad client's host_volume stanza config; validateHostVolumes is called by prepareHostVolumes during Prestart and iterates the task's volume mounts, appending one error per unknown source.
Common situations: Client agent restarted and lost its host_volume stanza (client config file changed); volume name typo in the job; volume only defined on a different node and the job landed here; per-Alloc suffix mismatch when the volume uses per_alloc.
Related errors
- host volume validation error: %v
- no host volume named: %s
- volume mount has an invalid propagation mode
- volume has unrecognized type %s
- plugin not found
AI-assisted analysis of hashicorp/nomad@482b49bf1a (2026-09-04).
Data as JSON: /api/errors/6f6b8ff04461f1b5.
Report an issue: GitHub.