{"record":{"id":"d69bcf61ac3e0036","repo":"hashicorp/nomad","slug":"no-such-node-s","errorCode":null,"errorMessage":"no such node %s","messagePattern":"no such node (.+?)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"nomad/host_volume_endpoint.go","lineNumber":554,"sourceCode":"\tctx := &placementContext{\n\t\tregexpCache:  make(map[string]*regexp.Regexp),\n\t\tversionCache: make(map[string]feasible.VerConstraints),\n\t\tsemverCache:  make(map[string]feasible.VerConstraints),\n\t}\n\tconstraints := []*structs.Constraint{{\n\t\tLTarget: fmt.Sprintf(\"${attr.plugins.host_volume.%s.version}\", vol.PluginID),\n\t\tOperand: \"is_set\",\n\t}}\n\tconstraints = append(constraints, vol.Constraints...)\n\tchecker := feasible.NewConstraintChecker(ctx, constraints)\n\n\tif vol.NodeID != \"\" {\n\t\tnode, err := snap.NodeByID(nil, vol.NodeID)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tif node == nil {\n\t\t\treturn nil, fmt.Errorf(\"no such node %s\", vol.NodeID)\n\t\t}\n\t\tif ok := checker.Feasible(node); !ok {\n\t\t\treturn nil, fmt.Errorf(\"node %s is not feasible for volume\", vol.NodeID)\n\t\t}\n\n\t\tvol.NodePool = node.NodePool\n\t\treturn node, nil\n\t}\n\n\tpoolFilterFn, err := v.enterpriseNodePoolFilter(snap, vol)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tvar iter memdb.ResultIterator\n\tif vol.NodePool != \"\" {\n\t\tif !poolFilterFn(vol.NodePool) {\n\t\t\treturn nil, fmt.Errorf(\"namespace %q does not allow volumes to use node pool %q\",","sourceCodeStart":536,"sourceCodeEnd":572,"githubUrl":"https://github.com/hashicorp/nomad/blob/482b49bf1aec006f089bcfc7e632d8f6ac303e5e/nomad/host_volume_endpoint.go#L536-L572","documentation":"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.","triggerScenarios":"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).","commonSituations":"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.","solutions":["List current nodes (`nomad node status`) and use a valid, running node's ID.","Omit NodeID to let Nomad place the volume automatically using constraints/node pool.","Check you are targeting the correct region/cluster where the node is registered."],"exampleFix":"// before\nhv := &api.HostVolume{ NodeID: \"1a2b3c4d-stale\" }\n// after\nhv := &api.HostVolume{ Constraints: []*api.Constraint{{LTarget: \"${node.unique.id}\", RTarget: liveNodeId, Operand: \"=\"}} } // or omit NodeID","handlingStrategy":"validation","validationCode":"nodes, _, err := client.Nodes().List(nil)\nif err != nil { return err }\nfound := false\nfor _, n := range nodes {\n    if n.ID == vol.NodeID && n.Status == \"ready\" { found = true; break }\n}\nif !found { return fmt.Errorf(\"refusing create: node %s not registered/ready\", vol.NodeID) }","typeGuard":null,"tryCatchPattern":"_, _, err := client.HostVolumes().Create(vol, nil)\nif err != nil && strings.Contains(err.Error(), \"no such node\") {\n    // fall back to automatic placement\n    vol.NodeID = \"\"\n    _, _, err = client.HostVolumes().Create(vol, nil)\n}","preventionTips":["Prefer omitting NodeID and using constraints for placement.","Resolve node IDs at runtime via `nomad node status`, never hardcode UUIDs.","Confirm cluster/region before looking up nodes."],"tags":["nomad","host-volumes","node-not-found","placement"],"backgroundTag":"node-not-found","analyzedSha":"482b49bf1aec006f089bcfc7e632d8f6ac303e5e","analyzedAt":"2026-09-04T07:54:14.808Z","contentChangedAt":"2026-09-04T07:54:14.808Z","schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}