{"record":{"id":"05de34f0c11f69b8","repo":"apache/druid","slug":"cannot-be-negative","errorCode":null,"errorMessage":" cannot be negative","messagePattern":" cannot be negative","errorType":"validation","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"extensions-contrib/consul-extensions/src/main/java/org/apache/druid/consul/discovery/ConsulDiscoveryConfig.java","lineNumber":794,"sourceCode":"  {\n    Duration result = value;\n    if (result == null) {\n      result = Duration.millis(defaultMs);\n    }\n    if (result.getMillis() <= 0) {\n      throw new IAE(name + \" must be positive\");\n    }\n    return result;\n  }\n\n  private static Duration validateNonNegative(Duration value, long defaultMs, String name)\n  {\n    Duration result = value;\n    if (result == null) {\n      result = Duration.millis(defaultMs);\n    }\n    if (result.getMillis() < 0) {\n      throw new IAE(name + \" cannot be negative\");\n    }\n    return result;\n  }\n}\n","sourceCodeStart":776,"sourceCodeEnd":799,"githubUrl":"https://github.com/apache/druid/blob/9b90983fd291f26935af934383ce360473179e4d/extensions-contrib/consul-extensions/src/main/java/org/apache/druid/consul/discovery/ConsulDiscoveryConfig.java#L776-L799","documentation":"Generic duration validation helper: the named duration property must be non-negative (null falls back to the supplied default); a negative configured value is rejected with the message naming the property.","triggerScenarios":"Thrown at extensions-contrib/consul-extensions/src/main/java/org/apache/druid/consul/discovery/ConsulDiscoveryConfig.java:794 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Correct the named duration property to a zero or positive value.","Remove the property to use its default."],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"9b90983fd291f26935af934383ce360473179e4d","analyzedAt":"2026-09-07T13:32:30.957Z","contentChangedAt":"2026-09-07T13:32:30.957Z","schemaVersion":2},"datasetVersion":"2026-09-17T15:17:12.973Z"}