{"record":{"id":"1a6e7e149adf5782","repo":"SonarSource/sonarqube","slug":"missing-property","errorCode":null,"errorMessage":"Missing property: ","messagePattern":"Missing property: ","errorType":"exception","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"server/sonar-process/src/main/java/org/sonar/process/Props.java","lineNumber":58,"sourceCode":"  }\n\n  public boolean contains(String key) {\n    return properties.containsKey(key);\n  }\n\n  @CheckForNull\n  public String value(String key) {\n    String value = properties.getProperty(key);\n    if (value != null && encryption.isEncrypted(value)) {\n      value = encryption.decrypt(value);\n    }\n    return value;\n  }\n\n  public String nonNullValue(String key) {\n    String value = value(key);\n    if (value == null) {\n      throw new IllegalArgumentException(\"Missing property: \" + key);\n    }\n    return value;\n  }\n\n  @CheckForNull\n  public String value(String key, @Nullable String defaultValue) {\n    String s = value(key);\n    return s == null ? defaultValue : s;\n  }\n\n  public boolean valueAsBoolean(String key) {\n    String s = value(key);\n    return s != null && Boolean.parseBoolean(s);\n  }\n\n  public boolean valueAsBoolean(String key, boolean defaultValue) {\n    String s = value(key);\n    return s != null ? Boolean.parseBoolean(s) : defaultValue;","sourceCodeStart":40,"sourceCodeEnd":76,"githubUrl":"https://github.com/SonarSource/sonarqube/blob/184c821202192afc1c599fc912d0889b69fffa53/server/sonar-process/src/main/java/org/sonar/process/Props.java#L40-L76","documentation":"Props.nonNullValue returns the raw string value of a property and throws IllegalArgumentException when the property key is absent (value() returns null). It expresses a hard requirement: this property must be configured for the component to run.","triggerScenarios":"Calling props.nonNullValue(\"some.key\") when \"some.key\" was never set in sonar.properties, environment, or defaults; callers include initialValue, newValue, builder, searchHosts, SearchNodeHealthProvider, and value.","commonSituations":"Incomplete sonar.properties in a fresh install; missing sonar.path.home / sonar.path.data when computing homeDir; cluster nodes missing required search host configuration.","solutions":["Set the missing property in conf/sonar.properties or via environment variable before starting the process.","Check the property key spelling; keys are case-sensitive.","If the property is optional in your deployment, call value(key) or value(key, default) instead of nonNullValue(key)."],"exampleFix":"// before\nString home = props.nonNullValue(\"sonar.path.home\");\n// after\nString home = props.value(\"sonar.path.home\", \"/opt/sonarqube\");","handlingStrategy":"validation","validationCode":"if (props.value(\"sonar.path.home\") == null) {\n  throw new IllegalStateException(\"sonar.path.home must be set in conf/sonar.properties before startup\");\n}","typeGuard":null,"tryCatchPattern":"try {\n  String v = props.nonNullValue(\"sonar.path.home\");\n} catch (IllegalArgumentException e) {\n  logger.error(\"Required property missing: {}\", e.getMessage().replace(\"Missing property: \", \"\"));\n}","preventionTips":["Keep a canonical conf/sonar.properties checklist for your deployment.","Prefer value(key, default) with an explicit default when the property is optional.","Validate the full config with a smoke start in staging after upgrades."],"tags":["missing-property","configuration"],"backgroundTag":"missing-required-config-field","analyzedSha":"184c821202192afc1c599fc912d0889b69fffa53","analyzedAt":"2026-09-09T12:23:51.573Z","contentChangedAt":"2026-09-09T12:23:51.573Z","schemaVersion":2},"datasetVersion":"2026-09-17T15:17:12.973Z"}