apache/druid · error · IllegalStateException

Property[ ] is expected to be an int, it is not[ ].

Error message

Property[%s] is expected to be an int, it is not[%s].

What it means

PropUtils.getPropertyAsInt parses the property string with Integer.parseInt. When the value exists but is not a valid 32-bit integer, Druid wraps the NumberFormatException in an IllegalStateException identifying the property and offending value. It signals an invalid config value rather than a missing one.

Solutions

  1. Correct the property value to a plain integer (no quotes, whitespace, or units) in jvm.config or the properties source.
  2. Print the value first (System.getProperty("druid.port")) to see exactly what the JVM received.
  3. Check startup scripts for unexpanded shell variables or concatenated characters in the -D argument.
  4. Use Integer.MAX_VALUE-bounded values; use a long-typed property API if the value exceeds int range.

Example fix

// before (jvm.config)
-Ddruid.port=${DRUID_PORT
// after (jvm.config)
-Ddruid.port=8082
Defensive patterns

Strategy: validation

Validate before calling

String raw = System.getProperty("druid.port");
if (raw == null || !raw.matches("\\d+")) {
  throw new IllegalStateException("druid.port must be an integer, got: " + raw);
}

Try / catch

try {
  int v = PropUtils.getPropertyAsInt(props, key, null);
} catch (ISE e) {
  log.error("Bad integer property [%s], falling back", key, e);
  v = DEFAULT;
}

Prevention

When it happens

Trigger: Calling PropUtils.getPropertyAsInt(props, "druid.port", null) where the property value is a non-numeric string such as "abc", "8080x", "", or a number exceeding Integer range (e.g. "99999999999").

Common situations: Typos or stray whitespace/quotes in -D flags in jvm.config; environment-variable substitution in startup scripts leaving a literal like "${PORT}" or empty string; copying a port or count value that overflows int.

Understand the failure class

Background: "Invalid value" and "allowed values are" config errors: what your library rejected and how to fix it — this error's family across 41 libraries.

Related errors


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

Appendix: source

Thrown at processing/src/main/java/org/apache/druid/common/utils/PropUtils.java:62

  }

  public static int getPropertyAsInt(Properties props, String property, Integer defaultValue)
  {
    String retVal = props.getProperty(property);

    if (retVal == null) {
      if (defaultValue == null) {
        throw new ISE("Property[%s] not specified.", property);
      } else {
        return defaultValue;
      }
    }

    try {
      return Integer.parseInt(retVal);
    }
    catch (NumberFormatException e) {
      throw new ISE(e, "Property[%s] is expected to be an int, it is not[%s].", property, retVal);
    }
  }
}

View on GitHub (pinned to 9b90983fd2)