{"record":{"id":"f8fdac4dadb4b5bf","repo":"hashicorp/nomad","slug":"invalid-delay-function-q-must-be-one-of-q","errorCode":null,"errorMessage":"Invalid delay function %q, must be one of %q","messagePattern":"Invalid delay function %q, must be one of %q","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"nomad/structs/structs.go","lineNumber":6673,"sourceCode":"\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\n\t\t}\n\n\t}\n\n\t// Validate Interval and other delay parameters if attempts are limited\n\tif !r.Unlimited {","sourceCodeStart":6655,"sourceCodeEnd":6691,"githubUrl":"https://github.com/hashicorp/nomad/blob/482b49bf1aec006f089bcfc7e632d8f6ac303e5e/nomad/structs/structs.go#L6655-L6691","documentation":"ReschedulePolicy.Validate() checks delay_function against the allowed set (RescheduleDelayFunctions: \"constant\", \"exponential\", \"fibonacci\", \"linear\"). An unknown function name cannot be evaluated, so the policy is rejected.","triggerScenarios":"A reschedule block with delay_function set to any string outside {constant, linear, exponential, fibonacci}, e.g. \"fixed\", \"backoff\", or a capitalized/mistyped value.","commonSituations":"Guessing the function name from other tools' backoff vocabularies, typos like \"exponetial\", or older Nomad versions where some functions did not yet exist being upgraded.","solutions":["Set delay_function to one of: \"constant\", \"linear\", \"exponential\", \"fibonacci\".","Check spelling and lowercase form.","Consult `nomad job validate` output, which lists the accepted values."],"exampleFix":"// before\nreschedule {\n  delay_function = \"backoff\"\n}\n// after\nreschedule {\n  delay_function = \"exponential\"\n}","handlingStrategy":"validation","validationCode":"valid := map[string]bool{\"constant\": true, \"linear\": true, \"exponential\": true, \"fibonacci\": true}\nif rsl != nil && !valid[rsl.DelayFunction] {\n    return fmt.Errorf(\"delay_function %q invalid; use constant|linear|exponential|fibonacci\", rsl.DelayFunction)\n}","typeGuard":"func isValidDelayFunctionName(f string) bool {\n    switch f {\n    case \"constant\", \"linear\", \"exponential\", \"fibonacci\":\n        return true\n    }\n    return false\n}","tryCatchPattern":null,"preventionTips":["Only use the four documented delay function names, lowercase.","Validate job files with `nomad job validate` in CI.","Check the Nomad version's supported functions before upgrading configs."],"tags":["nomad","validation","enum","reschedule-policy"],"backgroundTag":"invalid-enum-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"}