hashicorp/nomad · error
log storage (%d MB) must be less than requested disk capacit
Error message
log storage (%d MB) must be less than requested disk capacity (%d MB)
What it means
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.
Source
Thrown at nomad/structs/structs.go:7904
}
}
// Validate returns an error if the log config specified are less than the
// minimum allowed. Note that because we have a non-zero default MaxFiles and
// MaxFileSizeMB, we can't validate that they're unset if Disabled=true
func (l *LogConfig) Validate(disk *EphemeralDisk) error {
var mErr multierror.Error
if l.MaxFiles < 1 {
mErr.Errors = append(mErr.Errors, fmt.Errorf("minimum number of files is 1; got %d", l.MaxFiles))
}
if l.MaxFileSizeMB < 1 {
mErr.Errors = append(mErr.Errors, fmt.Errorf("minimum file size is 1MB; got %d", l.MaxFileSizeMB))
}
if disk != nil {
logUsage := (l.MaxFiles * l.MaxFileSizeMB)
if disk.SizeMB <= logUsage {
mErr.Errors = append(mErr.Errors,
fmt.Errorf("log storage (%d MB) must be less than requested disk capacity (%d MB)",
logUsage, disk.SizeMB))
}
}
return mErr.ErrorOrNil()
}
// Task is a single process typically that is executed as part of a task group.
type Task struct {
// Name of the task
Name string
// Driver is used to control which driver is used
Driver string
// User is used to determine which user will run the task. It defaults to
// the same user the Nomad client is being run as.
User string
View on GitHub (pinned to 482b49bf1a)
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).
Example fix
// before
logs { max_files = 10, max_file_size = 50 }
ephemeral_disk { size = 500 }
// after
logs { max_files = 10, max_file_size = 50 }
ephemeral_disk { size = 1000 } Defensive patterns
Strategy: validation
Validate before calling
if t.LogConfig != nil && disk != nil && disk.SizeMB <= t.LogConfig.MaxFiles*t.LogConfig.MaxFileSizeMB {
return fmt.Errorf("log storage %d MB must be < disk capacity %d MB",
t.LogConfig.MaxFiles*t.LogConfig.MaxFileSizeMB, disk.SizeMB)
} Type guard
func logFitsDisk(files, sizeMB, diskMB int) bool { return diskMB > files*sizeMB } Prevention
- 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.
When it happens
Trigger: 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.
Common situations: 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.
Understand the failure class
Background: "Invalid value" and "allowed values are" config errors: what your library rejected and how to fix it — this error's family across 41 libraries.
Related errors
- Missing Log Config
- minimum number of files is 1; got %d
- minimum file size is 1MB; got %d
- missing secret ID
- Unknown log level
AI-assisted analysis of hashicorp/nomad@482b49bf1a (2026-09-04).
Data as JSON: /api/errors/681b5779dc30987d.
Report an issue: GitHub.