{"record":{"id":"1935a998084d33a0","repo":"hashicorp/nomad","slug":"minimum-memorymb-value-is-d-got-d","errorCode":null,"errorMessage":"minimum MemoryMB value is %d; got %d","messagePattern":"minimum MemoryMB value is (.+?); got (.+?)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"nomad/structs/structs.go","lineNumber":2605,"sourceCode":"\tfor _, n := range r.Networks {\n\t\tn.Canonicalize()\n\t}\n\n\tr.NUMA.Canonicalize()\n}\n\n// MeetsMinResources returns an error if the resources specified are less than\n// the minimum allowed.\n// This is based on the minimums defined in the Resources type\n// COMPAT(0.10): Remove in 0.10\nfunc (r *Resources) MeetsMinResources() error {\n\tvar mErr multierror.Error\n\tminResources := MinResources()\n\tif r.CPU < minResources.CPU && r.Cores == 0 {\n\t\tmErr.Errors = append(mErr.Errors, fmt.Errorf(\"minimum CPU value is %d; got %d\", minResources.CPU, r.CPU))\n\t}\n\tif r.MemoryMB < minResources.MemoryMB {\n\t\tmErr.Errors = append(mErr.Errors, fmt.Errorf(\"minimum MemoryMB value is %d; got %d\", minResources.MemoryMB, r.MemoryMB))\n\t}\n\treturn mErr.ErrorOrNil()\n}\n\n// Copy returns a deep copy of the resources\nfunc (r *Resources) Copy() *Resources {\n\tif r == nil {\n\t\treturn nil\n\t}\n\treturn &Resources{\n\t\tCPU:         r.CPU,\n\t\tCores:       r.Cores,\n\t\tMemoryMB:    r.MemoryMB,\n\t\tMemoryMaxMB: r.MemoryMaxMB,\n\t\tDiskMB:      r.DiskMB,\n\t\tIOPS:        r.IOPS,\n\t\tNetworks:    r.Networks.Copy(),\n\t\tDevices:     r.Devices.Copy(),","sourceCodeStart":2587,"sourceCodeEnd":2623,"githubUrl":"https://github.com/hashicorp/nomad/blob/482b49bf1aec006f089bcfc7e632d8f6ac303e5e/nomad/structs/structs.go#L2587-L2623","documentation":"Resources.MeetsMinResources() verifies MemoryMB meets the floor from MinResources(). Task memory below the documented minimum is rejected at job validation time because drivers and the scheduler assume a viable baseline footprint.","triggerScenarios":"Submitting a job whose task Resources.MemoryMB is less than MinResources().MemoryMB, e.g. memory = 10 with minimum 128.","commonSituations":"Specifying unrealistically tiny memory to overpack nodes; legacy specs from older Nomad versions with smaller minimums; typos (memory = 12 instead of 128).","solutions":["Raise MemoryMB (memory) to at least the minimum shown in the error message","Update saved job templates to the current minimum value","Check nomad job validate output for the exact required minimum in your version"],"exampleFix":"// before\nresources {\n  memory = 10\n}\n// after\nresources {\n  memory = 128\n}","handlingStrategy":"validation","validationCode":"min := structs.MinResources()\nif r.MemoryMB < min.MemoryMB {\n    return fmt.Errorf(\"memory must be >= %d\", min.MemoryMB)\n}","typeGuard":"func meetsMinMemory(r *structs.Resources) bool { return r.MemoryMB >= structs.MinResources().MemoryMB }","tryCatchPattern":null,"preventionTips":["Set memory to realistic minimums (>= 128MB) in templates","Run nomad job validate in CI","Avoid hand-tuning memory below documented minimums"],"tags":["nomad","resources","validation","memory"],"backgroundTag":"resource-spec-validation","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"}