{"record":{"id":"a402260165450182","repo":"apache/druid","slug":"invalid-input","errorCode":"INVALID_INPUT","errorMessage":"'druid.coordinator.kill.%s.durationToRetain'[%s] must be 0 milliseconds or higher","messagePattern":"'druid\\.coordinator\\.kill\\.(.+?)\\.durationToRetain'\\[(.+?)\\] must be 0 milliseconds or higher","errorType":"validation","errorClass":"DruidException","httpStatus":null,"severity":"error","filePath":"server/src/main/java/org/apache/druid/server/coordinator/config/DruidCoordinatorConfig.java","lineNumber":137,"sourceCode":"  {\n    if (!config.isCleanupEnabled()) {\n      // Do not perform validation if cleanup is disabled\n      return;\n    }\n\n    final Duration metadataManagementPeriod = getCoordinatorMetadataStoreManagementPeriod();\n    final Duration period = config.getCleanupPeriod();\n    if (period == null || period.getMillis() < metadataManagementPeriod.getMillis()) {\n      throw newInvalidInputExceptionForOperator(\n          \"'druid.coordinator.kill.%s.period'[%s] must be greater than\"\n          + \" 'druid.coordinator.period.metadataStoreManagementPeriod'[%s]\",\n          propertyPrefix, period, metadataManagementPeriod\n      );\n    }\n\n    final Duration retainDuration = config.getDurationToRetain();\n    if (retainDuration == null || retainDuration.getMillis() < 0) {\n      throw newInvalidInputExceptionForOperator(\n          \"'druid.coordinator.kill.%s.durationToRetain'[%s] must be 0 milliseconds or higher\",\n          propertyPrefix, retainDuration\n      );\n    }\n    if (retainDuration.getMillis() > System.currentTimeMillis()) {\n      throw newInvalidInputExceptionForOperator(\n          \"'druid.coordinator.kill.%s.durationToRetain'[%s] cannot be greater than current time in milliseconds\",\n          propertyPrefix, retainDuration\n      );\n    }\n  }\n\n  private static DruidException newInvalidInputExceptionForOperator(String msgFormat, Object... args)\n  {\n    return DruidException.forPersona(DruidException.Persona.OPERATOR)\n                         .ofCategory(DruidException.Category.INVALID_INPUT)\n                         .build(msgFormat, args);\n  }","sourceCodeStart":119,"sourceCodeEnd":155,"githubUrl":"https://github.com/apache/druid/blob/9b90983fd291f26935af934383ce360473179e4d/server/src/main/java/org/apache/druid/server/coordinator/config/DruidCoordinatorConfig.java#L119-L155","documentation":"validateKillConfig() requires druid.coordinator.kill.<type>.durationToRetain to be non-null and >= 0 milliseconds. This duration controls how long objects (e.g. pending segments) are retained before being killed; a negative value is invalid operator input. Note the subsequent check additionally rejects values exceeding the current epoch time in milliseconds.","triggerScenarios":"Coordinator startup when config.getDurationToRetain() is null or negative for any kill config under druid.coordinator.kill.<type> (e.g. durationToRetain=-PT24H or a negative number).","commonSituations":"Misunderstanding the property as a negative 'grace period'; hand-editing durations to negative values to try to disable retention; missing default in a config template leaving the field null.","solutions":["Set druid.coordinator.kill.<type>.durationToRetain to a non-negative duration (e.g. PT24H, or 0 to retain nothing)","Remove the property to use its default instead of supplying null explicitly","Restart the Coordinator after correction"],"exampleFix":"// before\ndruid.coordinator.kill.pendingSegments.durationToRetain=PT-24H\n// after\ndruid.coordinator.kill.pendingSegments.durationToRetain=PT24H","handlingStrategy":"validation","validationCode":"String raw = props.getProperty(\"druid.coordinator.kill.pendingSegments.durationToRetain\");\nif (raw != null) {\n  long ms = Period.parse(raw).toStandardDuration().getMillis();\n  if (ms < 0) throw new IllegalArgumentException(\"durationToRetain must be 0 or higher\");\n}","typeGuard":null,"tryCatchPattern":"try {\n  coordinator.start();\n} catch (Exception e) {\n  if (String.valueOf(e.getMessage()).contains(\"durationToRetain\")) {\n    // set a non-negative duration (e.g. PT24H) and restart\n  }\n}","preventionTips":["Never express retention as a negative duration; 0 means retain nothing","Use ISO-8601 durations (PT24H, P7D) rather than raw signed numbers","Omit the property to accept defaults instead of passing explicit nulls","Review kill.* diffs in config PRs before merge"],"tags":["coordinator","configuration","validation","duration"],"backgroundTag":"invalid-config-value","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"}