{"record":{"id":"79044b2e1ded06ee","repo":"hashicorp/nomad","slug":"failed-to-lookup-node-id-q-v","errorCode":null,"errorMessage":"failed to lookup node ID %q: %v","messagePattern":"failed to lookup node ID %q: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"scheduler/feasible/propertyset.go","lineNumber":330,"sourceCode":"\t\t}\n\t}\n\treturn allocs[:n]\n}\n\n// buildNodeMap takes a list of allocations and returns a map of the nodes used\n// by those allocations\nfunc (p *propertySet) buildNodeMap(allocs []*structs.Allocation) (map[string]*structs.Node, error) {\n\t// Get all the nodes that have been used by the allocs\n\tnodes := make(map[string]*structs.Node)\n\tws := memdb.NewWatchSet()\n\tfor _, alloc := range allocs {\n\t\tif _, ok := nodes[alloc.NodeID]; ok {\n\t\t\tcontinue\n\t\t}\n\n\t\tnode, err := p.ctx.State().NodeByID(ws, alloc.NodeID)\n\t\tif err != nil {\n\t\t\treturn nil, fmt.Errorf(\"failed to lookup node ID %q: %v\", alloc.NodeID, err)\n\t\t}\n\n\t\tnodes[alloc.NodeID] = node\n\t}\n\n\treturn nodes, nil\n}\n\n// populateProperties goes through all allocations and builds up the used\n// properties from the nodes storing the results in the passed properties map.\nfunc (p *propertySet) populateProperties(allocs []*structs.Allocation, nodes map[string]*structs.Node,\n\tproperties map[string]uint64) {\n\n\tfor _, alloc := range allocs {\n\t\tnProperty, ok := getProperty(nodes[alloc.NodeID], p.targetAttribute)\n\t\tif !ok {\n\t\t\tcontinue\n\t\t}","sourceCodeStart":312,"sourceCodeEnd":348,"githubUrl":"https://github.com/hashicorp/nomad/blob/482b49bf1aec006f089bcfc7e632d8f6ac303e5e/scheduler/feasible/propertyset.go#L312-L348","documentation":"buildNodeMap resolves each candidate allocation's node via StateStore.NodeByID. If the state store lookup itself errors (not merely a missing node), it returns this wrapped error, aborting building the node map used for feasibility checking. A nil node (node absent) is tolerated; only an actual store error triggers this.","triggerScenarios":"StateStore.NodeByID(ws, alloc.NodeID) returns a non-nil error while iterating existing/proposed allocations during populateExisting or PopulateProposed — state store failures, closed snapshot, memdb iteration error.","commonSituations":"Server under heavy load with state store timeouts, snapshot invalidated by a concurrent state refresh, or internal state store errors during eval processing.","solutions":["Read the wrapped underlying error in the message to find the root cause","Retry the evaluation — Nomad re-enqueues failed evals; transient state issues often resolve","Check Nomad server logs and metrics for state store / raft health issues","Upgrade Nomad if on a version with known state store bugs"],"exampleFix":null,"handlingStrategy":"retry","validationCode":"nomad node status // confirm nodes are queryable and the cluster is healthy","typeGuard":null,"tryCatchPattern":"// State store errors are server-internal; users retry via Nomad's eval retry\n// Check wrapped error in logs and cluster health\nnomad eval list | grep -i failed","preventionTips":["Monitor server health and raft stability","Avoid running servers at resource limits","Upgrade Nomad regularly for state store fixes","Keep raft snapshots current"],"tags":["nomad","scheduler","state-store"],"backgroundTag":"state-store-lookup-failed","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"}