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.
			continue

View on GitHub (pinned to 482b49bf1a)

Solutions

  1. Add the missing host_volume stanza to the client's config and restart the nomad agent
  2. Fix the volume source name in the job's volume_mount to match the client config
  3. Reschedule the job on a node that has the volume configured (use constraint based on client volume metadata)
  4. 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

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


AI-assisted analysis of hashicorp/nomad@482b49bf1a (2026-09-04). Data as JSON: /api/errors/6f6b8ff04461f1b5. Report an issue: GitHub.