hashicorp/nomad · error

failed to get job node pool %q: %v

Error message

failed to get job node pool %q: %v

What it means

setJob fetches the job's node pool via StateStore.NodePoolByName to configure the scheduler (e.g. whether the pool has disconnected-client handling). If the lookup errors, it returns this wrapped error and job setup aborts.

Source

Thrown at scheduler/generic_sched.go:799

			return
		}
	}
	for i, alloc := range plan.NodeAllocation[original.NodeID] {
		if alloc.ID == original.ID {
			plan.NodeAllocation[original.NodeID][i] = updated
			return
		}
	}
}

// setJob updates the stack with the given job and job's node pool scheduler
// configuration.
func (s *GenericScheduler) setJob(job *structs.Job) error {
	// Fetch node pool and global scheduler configuration to determine how to
	// configure the scheduler.
	pool, err := s.state.NodePoolByName(nil, job.NodePool)
	if err != nil {
		return fmt.Errorf("failed to get job node pool %q: %v", job.NodePool, err)
	}

	_, schedConfig, err := s.state.SchedulerConfig()
	if err != nil {
		return fmt.Errorf("failed to get scheduler configuration: %v", err)
	}

	s.stack.SetJob(job)
	s.stack.SetSchedulerConfiguration(schedConfig.WithNodePool(pool))
	return nil
}

// setnodes updates the stack with the nodes that are ready for placement for
// the given job.
func (s *GenericScheduler) setNodes(job *structs.Job) ([]*structs.Node, map[string]int, error) {
	nodes, _, byDC, err := readyNodesInDCsAndPool(s.state, job.Datacenters, job.NodePool)
	if err != nil {
		return nil, nil, err

View on GitHub (pinned to 482b49bf1a)

Solutions

  1. Inspect the wrapped underlying error for the root cause
  2. Verify the job's node_pool exists with 'nomad node pool status <pool>' (a missing pool normally won't error, but confirms configuration)
  3. Retry — Nomad reprocesses failed evals
  4. Check server/raft health and restore from snapshot if corruption is suspected
Defensive patterns

Strategy: validation

Validate before calling

nomad node pool status <pool> // ensure the job's node_pool exists before submitting
nomad job validate job.nomad.hcl

Try / catch

// Inspect the wrapped error in server logs to distinguish a state
// store failure from a config issue; retry via eval reprocessing
nomad eval list | grep -i failed

Prevention

When it happens

Trigger: StateStore.NodePoolByName(nil, job.NodePool) returns an error during setJob (called from process and computePlacements) — state store/memdb failure while resolving the job's node pool.

Common situations: State store instability on servers managing many node pools, raft restore, resource exhaustion, or jobs referencing node pools during a state restore window.

Related errors


AI-assisted analysis of hashicorp/nomad@482b49bf1a (2026-09-04). Data as JSON: /api/errors/0ed863132ee794ff. Report an issue: GitHub.