hashicorp/nomad · error

failed to get scheduler configuration: %v

Error message

failed to get scheduler configuration: %v

What it means

SysBatchScheduler.setJob calls state.SchedulerConfig() to fetch the global scheduler configuration used to configure the scheduling stack (via schedConfig.WithNodePool); this error wraps a failure of that state-store read. It mirrors the generic scheduler's identical error (scheduler/generic_sched.go:804).

Source

Thrown at scheduler/scheduler_sysbatch.go:202

	}

	// Success!
	return true, nil
}

// setJob updates the stack with the given job and job's node pool scheduler
// configuration.
func (s *SysBatchScheduler) 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
}

// computeJobAllocs is used to reconcile differences between the job,
// existing allocations and node status to update the allocations.
func (s *SysBatchScheduler) computeJobAllocs() error {
	// Lookup the allocations by JobID
	ws := memdb.NewWatchSet()
	allocs, err := s.state.AllocsByJob(ws, s.eval.Namespace, s.eval.JobID, true)
	if err != nil {
		return fmt.Errorf("failed to get allocs for job '%s': %v", s.eval.JobID, err)
	}

	// Determine the tainted nodes containing job allocs

View on GitHub (pinned to 482b49bf1a)

Solutions

  1. Inspect the wrapped cause in server logs to identify the state-store failure.
  2. Check leader health and raft status (nomad server members, nomad operator raft list-peers).
  3. Restore or repair the server state store; restart the affected agent.
  4. Trigger a new evaluation (nomad job eval) once healthy.
  5. Upgrade Nomad if the config-read bug persists on current patches.
Defensive patterns

Strategy: retry

Validate before calling

if _, _, err := state.SchedulerConfig(); err != nil {
    return fmt.Errorf("scheduler config not readable: %w", err)
}

Type guard

func schedulerConfigReadable(s structs.State) bool {
    _, _, err := s.SchedulerConfig()
    return err == nil
}

Try / catch

if err := sched.Process(eval); err != nil {
    if strings.Contains(err.Error(), "failed to get scheduler configuration") {
        return retryWithBackoff(func() error { return sched.Process(eval) })
    }
    return err
}

Prevention

When it happens

Trigger: process() -> setJob(): NodePoolByName succeeds but s.state.SchedulerConfig() returns err != nil — state-store read failure, missing/corrupt scheduler config entry, or backend I/O error.

Common situations: Corrupt or uninitialized scheduler config after restore; degraded state store/raft on the Nomad leader; disk failures while evaluating a sysbatch job.

Related errors


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