{"record":{"id":"0b50da7dbcf74fab","repo":"hashicorp/nomad","slug":"failed-to-get-job-deployment-q-v","errorCode":null,"errorMessage":"failed to get job deployment %q: %v","messagePattern":"failed to get job deployment %q: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"scheduler/generic_sched.go","lineNumber":228,"sourceCode":"\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)\n\t\t}\n\t\ts.deployment = s.deployment.Copy() // may mutate in reconciler\n\t}\n\n\t// Reset the failed allocations\n\ts.failedTGAllocs = nil\n\n\t// Create an evaluation context\n\ts.ctx = feasible.NewEvalContext(s.eventsCh, s.state, s.plan, s.logger)\n\n\t// Construct the placement stack\n\ts.stack = feasible.NewGenericStack(s.batch, s.ctx)\n\tif !s.job.Stopped() {\n\t\ts.setJob(s.job)\n\t}\n\n\t// Compute the target job allocations\n\tif err := s.computeJobAllocs(); err != nil {","sourceCodeStart":210,"sourceCodeEnd":246,"githubUrl":"https://github.com/hashicorp/nomad/blob/482b49bf1aec006f089bcfc7e632d8f6ac303e5e/scheduler/generic_sched.go#L210-L246","documentation":"For non-batch (service/system) jobs, process() fetches the job's latest deployment via StateStore.LatestDeploymentByJobID to feed the deployment reconciler. A state store error (not absence of deployments) aborts processing with this wrapped error.","triggerScenarios":"StateStore.LatestDeploymentByJobID errors during process() for a service job eval — state store failure, snapshot invalidation, internal memdb error.","commonSituations":"Server state store instability during deployments, raft restore in progress, resource pressure on the Nomad server.","solutions":["Check the wrapped underlying error in logs for the root cause","Retry the eval; Nomad will reprocess failed evaluations","Verify state store / raft health and restore from snapshot if needed","Temporarily pause deployments until server stability is restored"],"exampleFix":null,"handlingStrategy":"retry","validationCode":"nomad deployment list // verify deployments are queryable and the server responds","typeGuard":null,"tryCatchPattern":"// Server-internal error: inspect wrapped cause in logs, retry via eval reprocessing\nnomad deployment list\nnomad eval list | grep -i failed","preventionTips":["Avoid restarting servers during active deployments when possible","Monitor state store/raft health","Keep Nomad up to date","Snapshot raft state regularly"],"tags":["nomad","scheduler","deployment","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"}