{"record":{"id":"681b5779dc30987d","repo":"hashicorp/nomad","slug":"log-storage-d-mb-must-be-less-than-requested-di","errorCode":null,"errorMessage":"log storage (%d MB) must be less than requested disk capacity (%d MB)","messagePattern":"log storage \\((.+?) MB\\) must be less than requested disk capacity \\((.+?) MB\\)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"nomad/structs/structs.go","lineNumber":7904,"sourceCode":"\t}\n}\n\n// Validate returns an error if the log config specified are less than the\n// minimum allowed. Note that because we have a non-zero default MaxFiles and\n// MaxFileSizeMB, we can't validate that they're unset if Disabled=true\nfunc (l *LogConfig) Validate(disk *EphemeralDisk) error {\n\tvar mErr multierror.Error\n\tif l.MaxFiles < 1 {\n\t\tmErr.Errors = append(mErr.Errors, fmt.Errorf(\"minimum number of files is 1; got %d\", l.MaxFiles))\n\t}\n\tif l.MaxFileSizeMB < 1 {\n\t\tmErr.Errors = append(mErr.Errors, fmt.Errorf(\"minimum file size is 1MB; got %d\", l.MaxFileSizeMB))\n\t}\n\tif disk != nil {\n\t\tlogUsage := (l.MaxFiles * l.MaxFileSizeMB)\n\t\tif disk.SizeMB <= logUsage {\n\t\t\tmErr.Errors = append(mErr.Errors,\n\t\t\t\tfmt.Errorf(\"log storage (%d MB) must be less than requested disk capacity (%d MB)\",\n\t\t\t\t\tlogUsage, disk.SizeMB))\n\t\t}\n\t}\n\treturn mErr.ErrorOrNil()\n}\n\n// Task is a single process typically that is executed as part of a task group.\ntype Task struct {\n\t// Name of the task\n\tName string\n\n\t// Driver is used to control which driver is used\n\tDriver string\n\n\t// User is used to determine which user will run the task. It defaults to\n\t// the same user the Nomad client is being run as.\n\tUser string\n","sourceCodeStart":7886,"sourceCodeEnd":7922,"githubUrl":"https://github.com/hashicorp/nomad/blob/482b49bf1aec006f089bcfc7e632d8f6ac303e5e/nomad/structs/structs.go#L7886-L7922","documentation":"Raised by LogConfig.Validate in nomad/structs/structs.go:7904 when the total log storage (MaxFiles * MaxFileSizeMB) is not strictly less than the task group's EphemeralDisk SizeMB. Nomad reserves that logs must leave room for the actual data in the ephemeral disk, so log usage equal to or exceeding disk capacity fails validation.","triggerScenarios":"Job where max_files * max_file_size >= ephemeral_disk.size; e.g. logs { max_files = 10, max_file_size = 50 } with ephemeral_disk { size = 500 } (500 <= 500 fails); calling LogConfig.Validate with a disk whose SizeMB <= logUsage.","commonSituations":"Users increase log sizes for verbose apps without enlarging the ephemeral disk; default 10x10=100MB logs paired with a small 100MB or less disk; jobs migrated from other schedulers with tighter disk settings.","solutions":["Increase ephemeral_disk { size = N } so it is strictly greater than max_files * max_file_size.","Reduce max_files or max_file_size so their product is below the disk size.","Remove a custom small ephemeral_disk to use the default (usually much larger)."],"exampleFix":"// before\nlogs { max_files = 10, max_file_size = 50 }\nephemeral_disk { size = 500 }\n// after\nlogs { max_files = 10, max_file_size = 50 }\nephemeral_disk { size = 1000 }","handlingStrategy":"validation","validationCode":"if t.LogConfig != nil && disk != nil && disk.SizeMB <= t.LogConfig.MaxFiles*t.LogConfig.MaxFileSizeMB {\n  return fmt.Errorf(\"log storage %d MB must be < disk capacity %d MB\",\n    t.LogConfig.MaxFiles*t.LogConfig.MaxFileSizeMB, disk.SizeMB)\n}","typeGuard":"func logFitsDisk(files, sizeMB, diskMB int) bool { return diskMB > files*sizeMB }","tryCatchPattern":null,"preventionTips":["Keep max_files * max_file_size strictly below ephemeral_disk size.","When raising log limits, raise the ephemeral_disk size proportionally.","Compute the product in CI lint checks for job specs."],"tags":["nomad","validation","disk-capacity","logging"],"backgroundTag":"invalid-config-value","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"}