{"record":{"id":"6753ce0363a7017b","repo":"hashicorp/nomad","slug":"no-node-s-with-prefix-or-id-q-found","errorCode":null,"errorMessage":"No node(s) with prefix or id %q found","messagePattern":"No node\\(s\\) with prefix or id %q found","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"command/node.go","lineNumber":90,"sourceCode":"\n\treturn formatKV(rows)\n}\n\n// lookupNodeID looks up a nodeID prefix and returns the full ID or an error.\n// The error will always be suitable for displaying to users.\nfunc lookupNodeID(client *api.Nodes, nodeID string) (string, error) {\n\tif len(nodeID) == 1 {\n\t\treturn \"\", fmt.Errorf(\"Node ID must contain at least two characters.\")\n\t}\n\n\tnodeID = sanitizeUUIDPrefix(nodeID)\n\tnodes, _, err := client.PrefixList(nodeID)\n\tif err != nil {\n\t\treturn \"\", fmt.Errorf(\"Error querying node: %w\", err)\n\t}\n\n\tif len(nodes) == 0 {\n\t\treturn \"\", fmt.Errorf(\"No node(s) with prefix or id %q found\", nodeID)\n\t}\n\n\tif len(nodes) > 1 {\n\t\treturn \"\", fmt.Errorf(\"Prefix matched multiple nodes\\n\\n%s\",\n\t\t\tformatNodeStubList(nodes, true))\n\t}\n\n\treturn nodes[0].ID, nil\n}\n","sourceCodeStart":72,"sourceCodeEnd":100,"githubUrl":"https://github.com/hashicorp/nomad/blob/482b49bf1aec006f089bcfc7e632d8f6ac303e5e/command/node.go#L72-L100","documentation":"After a successful PrefixList, lookupNodeID checks whether any nodes matched. If the result set is empty, it throws \"No node(s) with prefix or id %q found\" — the query worked, but no node in the cluster has an ID matching the given prefix.","triggerScenarios":"Calling `nomad node status <prefix>` where PrefixList succeeds but returns zero nodes for the sanitized prefix.","commonSituations":"Node was drained/removed from the cluster; typo or prefix from a different cluster/environment; referencing a client node that never joined; stale node ID from old scripts or docs.","solutions":["Run `nomad node status` (no args) to list current node IDs.","Verify you are querying the right cluster/region.","Use `nomad server members` to check whether the client is registered.","Correct the prefix or re-register the node."],"exampleFix":"// before (shell)\nnomad node status deadbeef   // node no longer exists\n// after\nnomad node status            # list live nodes\nnomad node status <current-id>","handlingStrategy":"validation","validationCode":"// shell: confirm node exists before deep status\nnomad node status -json | jq -e --arg p \"$ID\" '.[] | select(.ID | startswith($p)) | .ID' >/dev/null \\\n  || { echo \"no node matches $ID\"; exit 1; }","typeGuard":null,"tryCatchPattern":"// bash: branch on message\nif ! out=$(nomad node status \"$ID\" 2>&1); then\n  case \"$out\" in *\"found\"*) nomad node status ;; esac\nfi","preventionTips":["List nodes (`nomad node status`) before referencing IDs in scripts.","Track node lifecycle (deregistered/drained) in automation before issuing commands.","Keep environment-specific ID caches fresh; don't reuse IDs across clusters."],"tags":["cli","nomad","node","not-found"],"backgroundTag":"resource-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"}