{"record":{"id":"37b4dd09e215aeff","repo":"apache/druid","slug":"property-s-not-specified","errorCode":null,"errorMessage":"Property[%s] not specified.","messagePattern":"Property\\[(.+?)\\] not specified\\.","errorType":"exception","errorClass":"IllegalStateException","httpStatus":null,"severity":"error","filePath":"processing/src/main/java/org/apache/druid/common/utils/PropUtils.java","lineNumber":35,"sourceCode":" * under the License.\n */\n\npackage org.apache.druid.common.utils;\n\nimport org.apache.druid.java.util.common.ISE;\n\nimport java.util.Properties;\n\n/**\n */\npublic class PropUtils\n{\n  public static String getProperty(Properties props, String property)\n  {\n    String retVal = props.getProperty(property);\n\n    if (retVal == null) {\n      throw new ISE(\"Property[%s] not specified.\", property);\n    }\n\n    return retVal;\n  }\n\n  public static int getPropertyAsInt(Properties props, String property)\n  {\n    return getPropertyAsInt(props, property, null);\n  }\n\n  public static int getPropertyAsInt(Properties props, String property, Integer defaultValue)\n  {\n    String retVal = props.getProperty(property);\n\n    if (retVal == null) {\n      if (defaultValue == null) {\n        throw new ISE(\"Property[%s] not specified.\", property);\n      } else {","sourceCodeStart":17,"sourceCodeEnd":53,"githubUrl":"https://github.com/apache/druid/blob/9b90983fd291f26935af934383ce360473179e4d/processing/src/main/java/org/apache/druid/common/utils/PropUtils.java#L17-L53","documentation":"PropUtils.getProperty fetches a property from a Properties object and treats absence as a fatal condition: if props.getProperty returns null (or the value is the empty string mapped as null), it throws IllegalStateException naming the missing key. It expresses 'this property is required'.","triggerScenarios":"Calling getProperty(props, key) where the key was never set in the Properties object — missing runtime.properties entry, config not passed to an embedded node, or a typo'd property name.","commonSituations":"Deployments missing required druid.* config properties; renaming a property across Druid versions so old config files lack the new key; programmatic Properties built in tests missing keys; extensions reading properties not documented as required.","solutions":["Add the missing property to runtime.properties / the Properties object with a valid value","Verify the exact property name (typos and case) and that the config file is actually on the classpath/being loaded","Use props.getProperty(key, defaultValue) if the property is genuinely optional","Check version upgrade notes: the property may have been renamed or removed"],"exampleFix":"// before\nString mode = PropUtils.getProperty(props, \"druid.zk.service.compress.list\"); // ISE if unset\n// after\nString mode = props.getProperty(\"druid.zk.service.compress.list\", \"list\"); // or set the property in runtime.properties","handlingStrategy":"validation","validationCode":"String v = props.getProperty(key);\nif (v == null) { throw new IllegalStateException(\"set required property \" + key + \" in runtime.properties\"); }","typeGuard":null,"tryCatchPattern":"try { String v = PropUtils.getProperty(props, key); } catch (IllegalStateException e) { /* supply default or fail fast with actionable message */ }","preventionTips":["List required properties at startup and fail early with a clear message","Use getProperty(key, default) for optional settings","Validate config keys after upgrades (renames/removals)"],"tags":["java","configuration","missing-property"],"backgroundTag":"missing-required-config-field","analyzedSha":"9b90983fd291f26935af934383ce360473179e4d","analyzedAt":"2026-09-07T13:32:30.957Z","contentChangedAt":"2026-09-07T13:32:30.957Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}