{"record":{"id":"5cd3a9ed03e25213","repo":"hashicorp/nomad","slug":"memory-oversubscription-is-not-enabled-task-v","errorCode":null,"errorMessage":"Memory oversubscription is not enabled; Task \"%v.%v\" memory_max value will be ignored. Update the Scheduler Configuration to allow oversubscription.","messagePattern":"Memory oversubscription is not enabled; Task \"(.+?)\\.(.+?)\" memory_max value will be ignored\\. Update the Scheduler Configuration to allow oversubscription\\.","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"nomad/job_endpoint_hooks.go","lineNumber":643,"sourceCode":"func (v *memoryOversubscriptionValidate) Validate(job *structs.Job) (warnings []error, err error) {\n\t_, c, err := v.srv.State().SchedulerConfig()\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tpool, err := v.srv.State().NodePoolByName(nil, job.NodePool)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tif pool.MemoryOversubscriptionEnabled(c) {\n\t\treturn nil, nil\n\t}\n\n\tfor _, tg := range job.TaskGroups {\n\t\tfor _, t := range tg.Tasks {\n\t\t\tif t.Resources != nil && t.Resources.MemoryMaxMB != 0 {\n\t\t\t\twarnings = append(warnings, fmt.Errorf(\"Memory oversubscription is not enabled; Task \\\"%v.%v\\\" memory_max value will be ignored. Update the Scheduler Configuration to allow oversubscription.\", tg.Name, t.Name))\n\t\t\t}\n\t\t}\n\t}\n\n\treturn warnings, err\n}\n\n// submissionController is used to protect against job source sizes that exceed\n// the maximum as set in server config as job_max_source_size\n//\n// Such jobs will have their source discarded and emit a warning, but the job\n// itself will still continue with being registered.\nfunc (j *Job) submissionController(args *structs.JobRegisterRequest) error {\n\tif args.Submission == nil {\n\t\treturn nil\n\t}\n\tmaxSize := j.srv.GetConfig().JobMaxSourceSize\n\tsubmission := args.Submission","sourceCodeStart":625,"sourceCodeEnd":661,"githubUrl":"https://github.com/hashicorp/nomad/blob/482b49bf1aec006f089bcfc7e632d8f6ac303e5e/nomad/job_endpoint_hooks.go#L625-L661","documentation":"memory_max enables memory oversubscription, a feature gated by scheduler configuration. When oversubscription is disabled, any task with a non-zero MemoryMaxMB is invalid-only-as-warning: Nomad warns that memory_max will be ignored and the task will be limited to its hard memory value. It is a warning, not a rejection — the job registers but the oversubscription setting has no effect.","triggerScenarios":"Registering a job where any task has Resources.MemoryMaxMB != 0 while the server's SchedulerConfiguration does not enable memory oversubscription. Raised in Validate when enumerating all task groups and tasks.","commonSituations":"Copying job specs from a cluster with oversubscription enabled to one without; enabling memory_max in jobs after upgrading Nomad but before enabling the feature via the scheduler config API; scripts that always set memory_max.","solutions":["Enable oversubscription: PUT the scheduler configuration with MemoryOversubscription=true (nomad operator scheduler set-config -memory-oversubscription)","Remove the memory_max field from tasks if oversubscription is intentionally off","Acknowledge and ignore the warning if memory_max being ignored is acceptable"],"exampleFix":"// before\ntask \"app\" { resources { memory = 256 memory_max = 512 } } // oversubscription off\n// after\nnomad operator scheduler set-config -memory-oversubscription\n// then memory_max = 512 is honored","handlingStrategy":"validation","validationCode":"// before submit\noversub, _ := schedulerConfigHasOversubscription() // GET /v1/scheduler/configuration\nfor _, t := range allTasks(job) {\n  if t.Resources != nil && t.Resources.MemoryMaxMB != 0 && !oversub {\n    fmt.Printf(\"warning: %s memory_max will be ignored\\n\", t.Name)\n  }\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Enable MemoryOversubscription in scheduler config before shipping memory_max values","Parse registration warnings, don't ignore them — treat this one as a config drift signal","Keep job templates aware of per-cluster feature flags"],"tags":["nomad","resources","memory","oversubscription","scheduler-config"],"backgroundTag":"feature-disabled-by-config","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"}