{"record":{"id":"219d2ef7658f7011","repo":"hashicorp/nomad","slug":"timeout-v-is-lower-than-required-minimum-timeou","errorCode":null,"errorMessage":"timeout (%v) is lower than required minimum timeout %v","messagePattern":"timeout \\((.+?)\\) is lower than required minimum timeout (.+?)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"nomad/structs/services.go","lineNumber":295,"sourceCode":"\t\t}\n\tcase ServiceCheckScript:\n\t\tif sc.Command == \"\" {\n\t\t\treturn fmt.Errorf(\"script type must have a valid script path\")\n\t\t}\n\t}\n\n\t// validate interval\n\tif sc.Interval == 0 {\n\t\treturn fmt.Errorf(\"missing required value interval. Interval cannot be less than %v\", minCheckInterval)\n\t} else if sc.Interval < minCheckInterval {\n\t\treturn fmt.Errorf(\"interval (%v) cannot be lower than %v\", sc.Interval, minCheckInterval)\n\t}\n\n\t// validate timeout\n\tif sc.Timeout == 0 {\n\t\treturn fmt.Errorf(\"missing required value timeout. Timeout cannot be less than %v\", minCheckInterval)\n\t} else if sc.Timeout < minCheckTimeout {\n\t\treturn fmt.Errorf(\"timeout (%v) is lower than required minimum timeout %v\", sc.Timeout, minCheckInterval)\n\t}\n\n\t// validate the initial status\n\tswitch sc.InitialStatus {\n\tcase \"\":\n\tcase api.HealthPassing:\n\tcase api.HealthWarning:\n\tcase api.HealthCritical:\n\tdefault:\n\t\treturn fmt.Errorf(`invalid initial check state (%s), must be one of %q, %q, %q or empty`, sc.InitialStatus, api.HealthPassing, api.HealthWarning, api.HealthCritical)\n\t}\n\n\t// validate address_mode\n\tswitch sc.AddressMode {\n\tcase \"\", AddressModeHost, AddressModeDriver, AddressModeAlloc, AddressModeAllocIPv6:\n\t\t// Ok\n\tcase AddressModeAuto:\n\t\treturn fmt.Errorf(\"invalid address_mode %q - %s only valid for services\", sc.AddressMode, AddressModeAuto)","sourceCodeStart":277,"sourceCodeEnd":313,"githubUrl":"https://github.com/hashicorp/nomad/blob/482b49bf1aec006f089bcfc7e632d8f6ac303e5e/nomad/structs/services.go#L277-L313","documentation":"This error is raised by ServiceCheck.validateCommon in Nomad's structs package when a service check's Timeout is non-zero but smaller than minCheckTimeout. Nomad enforces a floor on check timeouts (reported against minCheckInterval) to prevent checks whose timeout is too short to ever pass. Job submission fails validation before the job is registered.","triggerScenarios":"Submitting a job whose service block defines a check with an explicit timeout lower than minCheckTimeout, e.g. check { type = \"http\" path = \"/health\" interval = \"10s\" timeout = \"1s\" } passed to jobs.register or nomad job run.","commonSituations":"Copying check configs tuned for very fast local probes from Consul/other tools into Nomad; typos like timeout = \"1s\" intended as \"10s\"; assuming Nomad allows sub-second or very tight timeouts like Consul does.","solutions":["Increase the check's timeout in the job spec to at least minCheckTimeout (use 2s or more, keeping timeout <= interval)","Check for unit typos (1s vs 10s) in the HCL/JSON job file","If you need faster failure detection, lower the interval as well, but keep timeout >= minCheckTimeout","Run nomad job validate <file> locally before submitting to catch this before the API call"],"exampleFix":"// before\ncheck {\n  type     = \"http\"\n  path     = \"/health\"\n  interval = \"10s\"\n  timeout  = \"1s\"\n}\n// after\ncheck {\n  type     = \"http\"\n  path     = \"/health\"\n  interval = \"10s\"\n  timeout  = \"2s\"\n}","handlingStrategy":"validation","validationCode":"// Go: validate check timeout before submitting the job\nfunc validTimeout(d time.Duration) bool {\n\tconst minCheckTimeout = 1 * time.Second // Nomad's minimum\n\treturn d >= minCheckTimeout\n}\nif !validTimeout(check.Timeout) {\n\treturn fmt.Errorf(\"check timeout %v must be >= 1s\", check.Timeout)\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Always set timeout >= 1s and timeout <= interval in every check block","Run `nomad job validate` in CI before job submission","Keep shared check-configuration templates with sane defaults","Watch for unit typos when converting milliseconds to duration strings"],"tags":["nomad","service-check","config-validation","timeout"],"backgroundTag":"check-timeout-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"}