{"record":{"id":"7d2ad47868331974","repo":"hashicorp/nomad","slug":"delay-cannot-be-less-than-v-got-v","errorCode":null,"errorMessage":"Delay cannot be less than %v (got %v)","messagePattern":"Delay cannot be less than (.+?) \\(got (.+?)\\)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"nomad/structs/structs.go","lineNumber":6667,"sourceCode":"\t\treturn nil\n\t}\n\tvar mErr multierror.Error\n\t// Check for ambiguous/confusing settings\n\tif r.Attempts > 0 {\n\t\tif r.Interval <= 0 {\n\t\t\t_ = multierror.Append(&mErr, fmt.Errorf(\"Interval must be a non zero value if Attempts > 0\"))\n\t\t}\n\t\tif r.Unlimited {\n\t\t\t_ = multierror.Append(&mErr, fmt.Errorf(\"Reschedule Policy with Attempts = %v, Interval = %v, \"+\n\t\t\t\t\"and Unlimited = %v is ambiguous\", r.Attempts, r.Interval, r.Unlimited))\n\t\t\t_ = multierror.Append(&mErr, errors.New(\"If Attempts >0, Unlimited cannot also be set to true\"))\n\t\t}\n\t}\n\n\tdelayPreCheck := true\n\t// Delay should be bigger than the default\n\tif r.Delay.Nanoseconds() < ReschedulePolicyMinDelay.Nanoseconds() {\n\t\t_ = multierror.Append(&mErr, fmt.Errorf(\"Delay cannot be less than %v (got %v)\", ReschedulePolicyMinDelay, r.Delay))\n\t\tdelayPreCheck = false\n\t}\n\n\t// Must use a valid delay function\n\tif !isValidDelayFunction(r.DelayFunction) {\n\t\t_ = multierror.Append(&mErr, fmt.Errorf(\"Invalid delay function %q, must be one of %q\", r.DelayFunction, RescheduleDelayFunctions))\n\t\tdelayPreCheck = false\n\t}\n\n\t// Validate MaxDelay if not using linear delay progression\n\tif r.DelayFunction != \"constant\" {\n\t\tif r.MaxDelay.Nanoseconds() < ReschedulePolicyMinDelay.Nanoseconds() {\n\t\t\t_ = multierror.Append(&mErr, fmt.Errorf(\"Max Delay cannot be less than %v (got %v)\", ReschedulePolicyMinDelay, r.Delay))\n\t\t\tdelayPreCheck = false\n\t\t}\n\t\tif r.MaxDelay < r.Delay {\n\t\t\t_ = multierror.Append(&mErr, fmt.Errorf(\"Max Delay cannot be less than Delay %v (got %v)\", r.Delay, r.MaxDelay))\n\t\t\tdelayPreCheck = false","sourceCodeStart":6649,"sourceCodeEnd":6685,"githubUrl":"https://github.com/hashicorp/nomad/blob/482b49bf1aec006f089bcfc7e632d8f6ac303e5e/nomad/structs/structs.go#L6649-L6685","documentation":"ReschedulePolicy.Validate() enforces a minimum delay (ReschedulePolicyMinDelay, 30s by default) between reschedule attempts. A delay below that floor is rejected because Nomad will not reschedule a failed allocation more aggressively than this.","triggerScenarios":"A reschedule block with delay set below the minimum (e.g. delay = \"5s\"), or a delay parsed with the wrong unit (plain integer seconds vs duration string).","commonSituations":"Trying to make failover faster by shrinking delay, copying delay values from restart policy examples (which allow smaller values), or unit mistakes in generated jobs.","solutions":["Raise reschedule.delay to at least 30s (default is 30s).","If faster recovery is the goal, tune delay_function/max_delay instead of lowering the floor.","Validate durations explicitly, e.g. delay = \"30s\"."],"exampleFix":"// before\nreschedule {\n  attempts = 5\n  interval = \"1h\"\n  delay    = \"5s\"\n}\n// after\nreschedule {\n  attempts = 5\n  interval = \"1h\"\n  delay    = \"30s\"\n}","handlingStrategy":"validation","validationCode":"if rsl != nil && rsl.Delay.Nanoseconds() < structs.ReschedulePolicyMinDelay.Nanoseconds() {\n    return fmt.Errorf(\"reschedule delay %v < minimum %v\", rsl.Delay, structs.ReschedulePolicyMinDelay)\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Keep delay at 30s or above.","Write explicit duration units in HCL/JSON.","Do not copy delay values from restart policy examples."],"tags":["nomad","validation","duration","reschedule-policy"],"backgroundTag":"value-below-minimum","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"}