{"record":{"id":"f3d99506b34ac09d","repo":"hashicorp/nomad","slug":"failed-to-get-deployment-for-job-q-w","errorCode":null,"errorMessage":"failed to get deployment for job %q: %w","messagePattern":"failed to get deployment for job %q: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"scheduler/scheduler_system.go","lineNumber":142,"sourceCode":"\n\tnumTaskGroups := 0\n\tif !s.job.Stopped() {\n\t\tnumTaskGroups = len(s.job.TaskGroups)\n\t}\n\ts.queuedAllocs = make(map[string]int, numTaskGroups)\n\n\t// Get the ready nodes in the required datacenters\n\tif !s.job.Stopped() {\n\t\ts.nodes, s.notReadyNodes, s.nodesByDC, err = readyNodesInDCsAndPool(\n\t\t\ts.state, s.job.Datacenters, s.job.NodePool)\n\t\tif err != nil {\n\t\t\treturn false, fmt.Errorf(\"failed to get ready nodes: %v\", err)\n\t\t}\n\t}\n\n\ts.deployment, err = s.state.LatestDeploymentByJobID(ws, s.eval.Namespace, s.eval.JobID)\n\tif err != nil {\n\t\treturn false, fmt.Errorf(\"failed to get deployment for job %q: %w\", s.eval.JobID, err)\n\t}\n\t// system deployments may be mutated in the reconciler because the node\n\t// count can change between evaluations\n\ts.deployment = s.deployment.Copy()\n\n\t// Create a plan\n\ts.plan = s.eval.MakePlan(s.job)\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.NewSystemStack(false, s.ctx)\n\tif !s.job.Stopped() {\n\t\ts.setJob(s.job)","sourceCodeStart":124,"sourceCodeEnd":160,"githubUrl":"https://github.com/hashicorp/nomad/blob/482b49bf1aec006f089bcfc7e632d8f6ac303e5e/scheduler/scheduler_system.go#L124-L160","documentation":"SystemScheduler.process failed reading the latest deployment for the job from the state store. A transient/persistence error wrapped with %w so the underlying cause is preserved for operators.","triggerScenarios":"Thrown at scheduler/scheduler_system.go:142 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Check server logs for state store failures","Allow the scheduler to retry the evaluation after the transient fault"],"exampleFix":null,"handlingStrategy":"retry","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"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"}