{"record":{"id":"62669bd628c0fb9c","repo":"hashicorp/nomad","slug":"wait-min-s-is-greater-than-max-s","errorCode":null,"errorMessage":"wait min %s is greater than max %s","messagePattern":"wait min (.+?) is greater than max (.+?)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"nomad/structs/structs.go","lineNumber":9152,"sourceCode":"\tcase !pointer.Eq(wc.Max, o.Max):\n\t\treturn false\n\t}\n\treturn true\n}\n\n// Validate that the min is not greater than the max\nfunc (wc *WaitConfig) Validate() error {\n\tif wc == nil {\n\t\treturn nil\n\t}\n\n\t// If either one is nil, they aren't comparable, so they can't be invalid.\n\tif wc.Min == nil || wc.Max == nil {\n\t\treturn nil\n\t}\n\n\tif *wc.Min > *wc.Max {\n\t\treturn fmt.Errorf(\"wait min %s is greater than max %s\", wc.Min, wc.Max)\n\t}\n\n\treturn nil\n}\n\n// Set of possible states for a task.\nconst (\n\tTaskStatePending = \"pending\" // The task is waiting to be run.\n\tTaskStateRunning = \"running\" // The task is currently running.\n\tTaskStateDead    = \"dead\"    // Terminal state of task.\n)\n\n// TaskState tracks the current state of a task and events that caused state\n// transitions.\ntype TaskState struct {\n\t// The current state of the task.\n\tState string\n","sourceCodeStart":9134,"sourceCodeEnd":9170,"githubUrl":"https://github.com/hashicorp/nomad/blob/482b49bf1aec006f089bcfc7e632d8f6ac303e5e/nomad/structs/structs.go#L9134-L9170","documentation":"WaitConfig.Validate: the min wait exceeds the max wait in a template's wait stanza. Consul Template uses min/max to batch template renders, and min > max makes the interval unusable.","triggerScenarios":"Thrown at nomad/structs/structs.go:9152 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Set wait min less than or equal to wait max, e.g. min = \"5s\", max = \"10s\"","Omit min or max so only one bound applies (they are not comparable when one is nil)"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"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"}