{"record":{"id":"ec50dbf11ae7d6ce","repo":"hashicorp/nomad","slug":"failed-to-get-job-q-v","errorCode":null,"errorMessage":"failed to get job %q: %v","messagePattern":"failed to get job %q: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"scheduler/generic_sched.go","lineNumber":210,"sourceCode":"\tif planFailure {\n\t\ts.blocked.TriggeredBy = structs.EvalTriggerMaxPlans\n\t\ts.blocked.StatusDescription = sstructs.DescBlockedEvalMaxPlan\n\t} else {\n\t\ts.blocked.StatusDescription = sstructs.DescBlockedEvalFailedPlacements\n\t}\n\n\treturn s.planner.CreateEval(s.blocked)\n}\n\n// process is wrapped in retryMax to iteratively run the handler until we have no\n// further work or we've made the maximum number of attempts.\nfunc (s *GenericScheduler) process() (bool, error) {\n\t// Lookup the Job by ID\n\tvar err error\n\tws := memdb.NewWatchSet()\n\ts.job, err = s.state.JobByID(ws, s.eval.Namespace, s.eval.JobID)\n\tif err != nil {\n\t\treturn false, fmt.Errorf(\"failed to get job %q: %v\", s.eval.JobID, err)\n\t}\n\n\tnumTaskGroups := 0\n\tstopped := s.job.Stopped()\n\tif !stopped {\n\t\tnumTaskGroups = len(s.job.TaskGroups)\n\t}\n\ts.queuedAllocs = make(map[string]int, numTaskGroups)\n\ts.followUpEvals = nil\n\n\t// Create a plan\n\ts.plan = s.eval.MakePlan(s.job)\n\n\tif !s.batch {\n\t\t// Get any existing deployment\n\t\ts.deployment, err = s.state.LatestDeploymentByJobID(ws, s.eval.Namespace, s.eval.JobID)\n\t\tif err != nil {\n\t\t\treturn false, fmt.Errorf(\"failed to get job deployment %q: %v\", s.eval.JobID, err)","sourceCodeStart":192,"sourceCodeEnd":228,"githubUrl":"https://github.com/hashicorp/nomad/blob/482b49bf1aec006f089bcfc7e632d8f6ac303e5e/scheduler/generic_sched.go#L192-L228","documentation":"GenericScheduler.process looks up the evaluation's job with StateStore.JobByID. If the state store lookup returns an error (not merely a missing job), processing aborts with this wrapped error. This is a state-store failure, distinct from the job simply not existing.","triggerScenarios":"StateStore.JobByID(ws, eval.Namespace, eval.JobID) returns an error during process() — state store/memdb failure, closed or aborted snapshot, internal index error.","commonSituations":"Nomad server state store instability, raft contention, resource exhaustion, or version-specific state store bugs during eval handling.","solutions":["Inspect the wrapped underlying error for the root cause","Retry — Nomad reschedules eval processing; transient failures usually self-heal","Check server health (memory/disk/raft) and restore from snapshot if corruption is suspected","Verify the eval's namespace/JobID are sane; garbage eval payloads can point to deeper bugs"],"exampleFix":null,"handlingStrategy":"retry","validationCode":"nomad job status <job-id> // confirm the job is queryable and the cluster is healthy","typeGuard":null,"tryCatchPattern":"// Look up the wrapped error in server logs and verify cluster health\nnomad eval list | grep -i failed\nnomad operator raft list-peers","preventionTips":["Monitor raft and state store health","Keep servers under resource capacity","Patch Nomad regularly","Maintain up-to-date raft snapshots"],"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"}