hashicorp/nomad · error

no such node %s

Error message

no such node %s

What it means

placeHostVolume resolves an explicitly requested NodeID via the state store snapshot; if no node with that ID exists the volume cannot be placed, so Create fails with 'no such node'. This mirrors the generic 'node does not exist' check but occurs during host volume placement.

Source

Thrown at nomad/host_volume_endpoint.go:554

	ctx := &placementContext{
		regexpCache:  make(map[string]*regexp.Regexp),
		versionCache: make(map[string]feasible.VerConstraints),
		semverCache:  make(map[string]feasible.VerConstraints),
	}
	constraints := []*structs.Constraint{{
		LTarget: fmt.Sprintf("${attr.plugins.host_volume.%s.version}", vol.PluginID),
		Operand: "is_set",
	}}
	constraints = append(constraints, vol.Constraints...)
	checker := feasible.NewConstraintChecker(ctx, constraints)

	if vol.NodeID != "" {
		node, err := snap.NodeByID(nil, vol.NodeID)
		if err != nil {
			return nil, err
		}
		if node == nil {
			return nil, fmt.Errorf("no such node %s", vol.NodeID)
		}
		if ok := checker.Feasible(node); !ok {
			return nil, fmt.Errorf("node %s is not feasible for volume", vol.NodeID)
		}

		vol.NodePool = node.NodePool
		return node, nil
	}

	poolFilterFn, err := v.enterpriseNodePoolFilter(snap, vol)
	if err != nil {
		return nil, err
	}

	var iter memdb.ResultIterator
	if vol.NodePool != "" {
		if !poolFilterFn(vol.NodePool) {
			return nil, fmt.Errorf("namespace %q does not allow volumes to use node pool %q",

View on GitHub (pinned to 482b49bf1a)

Solutions

  1. List current nodes (`nomad node status`) and use a valid, running node's ID.
  2. Omit NodeID to let Nomad place the volume automatically using constraints/node pool.
  3. Check you are targeting the correct region/cluster where the node is registered.

Example fix

// before
hv := &api.HostVolume{ NodeID: "1a2b3c4d-stale" }
// after
hv := &api.HostVolume{ Constraints: []*api.Constraint{{LTarget: "${node.unique.id}", RTarget: liveNodeId, Operand: "="}} } // or omit NodeID
Defensive patterns

Strategy: validation

Validate before calling

nodes, _, err := client.Nodes().List(nil)
if err != nil { return err }
found := false
for _, n := range nodes {
    if n.ID == vol.NodeID && n.Status == "ready" { found = true; break }
}
if !found { return fmt.Errorf("refusing create: node %s not registered/ready", vol.NodeID) }

Try / catch

_, _, err := client.HostVolumes().Create(vol, nil)
if err != nil && strings.Contains(err.Error(), "no such node") {
    // fall back to automatic placement
    vol.NodeID = ""
    _, _, err = client.HostVolumes().Create(vol, nil)
}

Prevention

When it happens

Trigger: Creating/registering a dynamic host volume whose NodeID does not match any registered client node (typo'd UUID, node deregistered/garbage-collected, or ID from another cluster/region).

Common situations: Referring to a node that was drained and GC'd; hardcoding a node ID from a dev cluster into a prod manifest; region misconfiguration so the lookup runs in a region the node never joined.

Related errors


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