apache/druid · error · IllegalArgumentException

cannot be negative

Error message

 cannot be negative

What it means

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.

Solutions

  1. Correct the named duration property to a zero or positive value.
  2. Remove the property to use its default.
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at extensions-contrib/consul-extensions/src/main/java/org/apache/druid/consul/discovery/ConsulDiscoveryConfig.java:794 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of apache/druid@9b90983fd2 (2026-09-07). Data as JSON: /api/errors/05de34f0c11f69b8. Report an issue: GitHub.

Appendix: source

Thrown at extensions-contrib/consul-extensions/src/main/java/org/apache/druid/consul/discovery/ConsulDiscoveryConfig.java:794

  {
    Duration result = value;
    if (result == null) {
      result = Duration.millis(defaultMs);
    }
    if (result.getMillis() <= 0) {
      throw new IAE(name + " must be positive");
    }
    return result;
  }

  private static Duration validateNonNegative(Duration value, long defaultMs, String name)
  {
    Duration result = value;
    if (result == null) {
      result = Duration.millis(defaultMs);
    }
    if (result.getMillis() < 0) {
      throw new IAE(name + " cannot be negative");
    }
    return result;
  }
}

View on GitHub (pinned to 9b90983fd2)