hashicorp/nomad · error

invalid configuration: %q scheduler not enabled

Error message

invalid configuration: %q scheduler not enabled

What it means

Nomad requires the internal 'core' scheduler (job type 'core', used for garbage collection, evals of system internals, etc.) to always be enabled. If the computed enabled_schedulers set omits it — either directly via config or because scheduling for it was disabled — worker setup fails validation.

Source

Thrown at nomad/server.go:1966

	if len(poolArgs.EnabledSchedulers) == 0 || poolArgs.NumSchedulers == 0 {
		s.logger.Warn("no enabled schedulers")
		return nil
	}

	// Check if the core scheduler is not enabled
	foundCore := false
	for _, sched := range poolArgs.EnabledSchedulers {
		if sched == structs.JobTypeCore {
			foundCore = true
			continue
		}

		if _, ok := scheduler.BuiltinSchedulers[sched]; !ok {
			return fmt.Errorf("invalid configuration: unknown scheduler %q in enabled schedulers", sched)
		}
	}
	if !foundCore {
		return fmt.Errorf("invalid configuration: %q scheduler not enabled", structs.JobTypeCore)
	}

	s.logger.Info("starting scheduling worker(s)", "num_workers", poolArgs.NumSchedulers, "schedulers", poolArgs.EnabledSchedulers)
	// Start the workers

	for i := 0; i < s.config.NumSchedulers; i++ {
		if w, err := NewWorker(ctx, s, poolArgs); err != nil {
			return err
		} else {
			s.logger.Debug("started scheduling worker", "id", w.ID(), "index", i+1, "of", s.config.NumSchedulers)
			s.workerShutdownGroup.AddCh(w.ShutdownCh())
			s.workers = append(s.workers, w)
		}
	}
	s.logger.Info("started scheduling worker(s)", "num_workers", s.config.NumSchedulers, "schedulers", s.config.EnabledSchedulers)
	return nil
}

View on GitHub (pinned to 482b49bf1a)

Solutions

  1. Add "core" to enabled_schedulers in the server config and restart
  2. Remove the enabled_schedulers line to accept the default set (which includes core)
  3. Validate config with nomad agent -config-check before deploying
  4. If automation builds the scheduler list, special-case JobTypeCore to always include it

Example fix

// before
enabled_schedulers = ["service", "batch", "system"]
// after
enabled_schedulers = ["service", "batch", "system", "core"]
Defensive patterns

Strategy: validation

Validate before calling

// Ensure 'core' is always present in enabled schedulers
let enabled = ['service', 'batch', 'system']; // from config
if (!enabled.includes('core')) enabled = ['core', ...enabled];

Try / catch

try {
  startNomadServer();
} catch (e) {
  if (String(e).includes('scheduler not enabled')) {
    addCoreSchedulerToConfig();
    startNomadServer();
  } else throw e;
}

Prevention

When it happens

Trigger: server.stanza enabled_schedulers lists schedulers but omits "core", so foundCore stays false after the validation loop.

Common situations: Operator set enabled_schedulers = ["service", "batch"] forgetting the core scheduler; config automation filtering 'core' out as an internal name; copy-pasted config where core was stripped.

Related errors


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