{"record":{"id":"768a56f41ca3e735","repo":"hashicorp/nomad","slug":"failed-to-get-job-node-pool-q-v-768a56","errorCode":null,"errorMessage":"failed to get job node pool %q: %v","messagePattern":"failed to get job node pool %q: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"scheduler/scheduler_sysbatch.go","lineNumber":197,"sourceCode":"\t// Try again if the plan was not fully committed, potential conflict\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, nil\n\t}\n\n\t// Success!\n\treturn true, nil\n}\n\n// setJob updates the stack with the given job and job's node pool scheduler\n// configuration.\nfunc (s *SysBatchScheduler) setJob(job *structs.Job) error {\n\t// Fetch node pool and global scheduler configuration to determine how to\n\t// configure the scheduler.\n\tpool, err := s.state.NodePoolByName(nil, job.NodePool)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"failed to get job node pool %q: %v\", job.NodePool, err)\n\t}\n\n\t_, schedConfig, err := s.state.SchedulerConfig()\n\tif err != nil {\n\t\treturn fmt.Errorf(\"failed to get scheduler configuration: %v\", err)\n\t}\n\n\ts.stack.SetJob(job)\n\ts.stack.SetSchedulerConfiguration(schedConfig.WithNodePool(pool))\n\treturn 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 *SysBatchScheduler) 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)","sourceCodeStart":179,"sourceCodeEnd":215,"githubUrl":"https://github.com/hashicorp/nomad/blob/482b49bf1aec006f089bcfc7e632d8f6ac303e5e/scheduler/scheduler_sysbatch.go#L179-L215","documentation":"SysBatchScheduler.setJob fetches the job's node pool via state.NodePoolByName before configuring the scheduler stack; this error wraps a failure of that lookup. Note that a nonexistent pool returns nil,nil here — this error indicates an actual state-store read failure, and the wrapped %v carries the cause.","triggerScenarios":"process() calls setJob(job); s.state.NodePoolByName(nil, job.NodePool) returns err != nil due to a state-store backend failure while reading the node pool table.","commonSituations":"Nomad server state-store errors; jobs referencing node pools during a degraded/restore state; raft I/O failures on the leader.","solutions":["Check the wrapped cause and server logs for the underlying state-store failure.","Verify the node pool referenced by the job exists (nomad node pool list; create it with nomad node pool apply if missing).","Ensure the Nomad server state store/raft is healthy; restart or restore the server if needed.","Re-run the evaluation after the state store recovers."],"exampleFix":"// before\njob.NodePool = \"gpu-pool\" // pool never created\n// after\n// create the pool first: nomad node pool apply gpu-pool.hcl\njob.NodePool = \"gpu-pool\" // ensure pool exists before submitting job","handlingStrategy":"validation","validationCode":"if _, err := state.NodePoolByName(nil, job.NodePool); err != nil {\n    return fmt.Errorf(\"node pool %q unreadable: %w\", job.NodePool, err)\n}","typeGuard":"func nodePoolExists(s structs.State, name string) bool {\n    p, err := s.NodePoolByName(nil, name)\n    return err == nil && p != nil\n}","tryCatchPattern":"if err := sched.Process(eval); err != nil {\n    if strings.Contains(err.Error(), \"failed to get job node pool\") {\n        return fmt.Errorf(\"create/verify node pool before submitting job: %w\", err)\n    }\n    return err\n}","preventionTips":["Create node pools (nomad node pool apply) before submitting jobs that reference them.","Validate job.NodePool in CI against the cluster's pool list.","Avoid renaming/deleting pools while jobs reference them.","Monitor state-store health for read failures."],"tags":["nomad","scheduler","sysbatch","node-pool","state-store"],"backgroundTag":"node-pool-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"}