{"record":{"id":"0a77ef8c931e9afe","repo":"hashicorp/nomad","slug":"invalid-configuration-unknown-scheduler-q-in-ena","errorCode":null,"errorMessage":"invalid configuration: unknown scheduler %q in enabled schedulers","messagePattern":"invalid configuration: unknown scheduler %q in enabled schedulers","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"nomad/server.go","lineNumber":1962,"sourceCode":"// setupWorkersLocked directly manipulates the server.config, so it is not safe to\n// call concurrently. Use setupWorkers() or call this with server.workerLock set.\nfunc (s *Server) setupWorkersLocked(ctx context.Context, poolArgs SchedulerWorkerPoolArgs) error {\n\t// Check if all the schedulers are disabled\n\tif len(poolArgs.EnabledSchedulers) == 0 || poolArgs.NumSchedulers == 0 {\n\t\ts.logger.Warn(\"no enabled schedulers\")\n\t\treturn nil\n\t}\n\n\t// Check if the core scheduler is not enabled\n\tfoundCore := false\n\tfor _, sched := range poolArgs.EnabledSchedulers {\n\t\tif sched == structs.JobTypeCore {\n\t\t\tfoundCore = true\n\t\t\tcontinue\n\t\t}\n\n\t\tif _, ok := scheduler.BuiltinSchedulers[sched]; !ok {\n\t\t\treturn fmt.Errorf(\"invalid configuration: unknown scheduler %q in enabled schedulers\", sched)\n\t\t}\n\t}\n\tif !foundCore {\n\t\treturn fmt.Errorf(\"invalid configuration: %q scheduler not enabled\", structs.JobTypeCore)\n\t}\n\n\ts.logger.Info(\"starting scheduling worker(s)\", \"num_workers\", poolArgs.NumSchedulers, \"schedulers\", poolArgs.EnabledSchedulers)\n\t// Start the workers\n\n\tfor i := 0; i < s.config.NumSchedulers; i++ {\n\t\tif w, err := NewWorker(ctx, s, poolArgs); err != nil {\n\t\t\treturn err\n\t\t} else {\n\t\t\ts.logger.Debug(\"started scheduling worker\", \"id\", w.ID(), \"index\", i+1, \"of\", s.config.NumSchedulers)\n\t\t\ts.workerShutdownGroup.AddCh(w.ShutdownCh())\n\t\t\ts.workers = append(s.workers, w)\n\t\t}\n\t}","sourceCodeStart":1944,"sourceCodeEnd":1980,"githubUrl":"https://github.com/hashicorp/nomad/blob/482b49bf1aec006f089bcfc7e632d8f6ac303e5e/nomad/server.go#L1944-L1980","documentation":"When setting up scheduling workers, Nomad validates that every entry in enabled_schedulers is a known built-in scheduler type (after skipping the internal 'core' type). An unrecognized string means the config names a scheduler that doesn't exist in this Nomad version or contains a typo, and the server refuses to start scheduling workers.","triggerScenarios":"server.stanza enabled_schedulers contains a value not in scheduler.BuiltinSchedulers — typo (e.g. \"sytem\"), scheduler removed in a newer Nomad, or a custom/enterprise scheduler name used in OSS Nomad.","commonSituations":"Hand-edited or generated config with misspelled scheduler names (service, batch, system, sysbatch are valid); copying config from docs of a different Nomad version; enabling enterprise-only schedulers on OSS.","solutions":["Fix the typo or remove the unknown entry from enabled_schedulers (valid OSS values: service, batch, system, sysbatch)","Run nomad agent -config-check / nomad config validate to catch this before restart","Check nomad version and its supported scheduler types; remove enterprise-only names from an OSS deployment","If you intended all schedulers, remove enabled_schedulers entirely to use the default set"],"exampleFix":"// before\nenabled_schedulers = [\"service\", \"batch\", \"sytem\"]\n// after\nenabled_schedulers = [\"service\", \"batch\", \"system\"]","handlingStrategy":"validation","validationCode":"// Validate scheduler names against the built-in set before writing config\nconst builtin = new Set(['service', 'batch', 'system', 'sysbatch']);\nconst enabled = ['service', 'batch', 'system']; // from your config template\nconst unknown = enabled.filter(s => !builtin.has(s));\nif (unknown.length) throw new Error('unknown schedulers: ' + unknown.join(', '));","typeGuard":null,"tryCatchPattern":"try {\n  startNomadServer();\n} catch (e) {\n  if (String(e).includes('unknown scheduler')) {\n    const bad = /unknown scheduler \"([^\"]+)\"/.exec(String(e))?.[1];\n    rewriteConfigRemovingScheduler(bad);\n    startNomadServer();\n  } else throw e;\n}","preventionTips":["Run nomad agent -config-check in CI before deploying server configs","Only use documented scheduler names for your exact Nomad version","Generate enabled_schedulers from a versioned allowlist, not free-form input"],"tags":["configuration","scheduler","startup"],"backgroundTag":"invalid-scheduler-configuration","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"}