{"record":{"id":"28206b164f5207df","repo":"hashicorp/nomad","slug":"failed-to-get-allocs-for-job-s-v","errorCode":null,"errorMessage":"failed to get allocs for job '%s': %v","messagePattern":"failed to get allocs for job '(.+?)': (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"scheduler/generic_sched.go","lineNumber":334,"sourceCode":"\t// a partial commit.\n\tfullCommit, expected, actual := result.FullCommit(s.plan)\n\tif !fullCommit {\n\t\ts.logger.Debug(\"plan didn't fully commit\", \"attempted\", expected, \"placed\", actual)\n\t\treturn false, fmt.Errorf(\"missing state refresh after partial commit\")\n\t}\n\n\t// Success!\n\treturn true, nil\n}\n\n// computeJobAllocs is used to reconcile differences between the job,\n// existing allocations and node status to update the allocations.\nfunc (s *GenericScheduler) computeJobAllocs() error {\n\t// Lookup the allocations by JobID\n\tws := memdb.NewWatchSet()\n\tallocs, err := s.state.AllocsByJob(ws, s.eval.Namespace, s.eval.JobID, true)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"failed to get allocs for job '%s': %v\",\n\t\t\ts.eval.JobID, err)\n\t}\n\n\t// Determine the tainted nodes containing job allocs\n\ttainted, err := taintedNodes(s.state, allocs)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"failed to get tainted nodes for job '%s': %v\",\n\t\t\ts.eval.JobID, err)\n\t}\n\n\t// Update the allocations which are in pending/running state on tainted\n\t// nodes to lost, but only if the scheduler has already marked them\n\tupdateNonTerminalAllocsToLost(s.plan, tainted, allocs)\n\n\tr := reconciler.NewAllocReconciler(s.logger,\n\t\tgenericAllocUpdateFn(s.ctx, s.stack, s.eval.ID),\n\t\treconciler.ReconcilerState{\n\t\t\tJob:               s.job,","sourceCodeStart":316,"sourceCodeEnd":352,"githubUrl":"https://github.com/hashicorp/nomad/blob/482b49bf1aec006f089bcfc7e632d8f6ac303e5e/scheduler/generic_sched.go#L316-L352","documentation":"computeJobAllocs fetches all allocations for the eval's job via StateStore.AllocsByJob to reconcile them. A state store error aborts processing with this wrapped error. This is about the lookup failing, not about allocs being absent.","triggerScenarios":"StateStore.AllocsByJob(ws, eval.Namespace, eval.JobID, true) returns an error during computeJobAllocs — memdb failure, closed snapshot, index iteration error.","commonSituations":"Nomad server state store instability, resource exhaustion, raft restore, or version-specific state store bugs.","solutions":["Read the wrapped underlying error to identify the root cause","Retry — failed evals are reprocessed by Nomad","Check server/raft health; restore from snapshot if corruption is suspected","Reduce server load or upgrade Nomad if the issue recurs"],"exampleFix":null,"handlingStrategy":"retry","validationCode":"nomad job status <job-id> // confirms job allocs are retrievable and cluster is healthy","typeGuard":null,"tryCatchPattern":"// Inspect the wrapped error in server logs; rely on eval retry\nnomad eval list | grep -i failed","preventionTips":["Monitor server memory/disk headroom","Patch Nomad for state store fixes","Keep raft snapshots for recovery","Alert on eval failure rates"],"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"}