SonarSource/sonarqube · error · IllegalArgumentException

Missing property:

Error message

Missing property: 

What it means

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.

Solutions

  1. Set the missing property in conf/sonar.properties or via environment variable before starting the process.
  2. Check the property key spelling; keys are case-sensitive.
  3. If the property is optional in your deployment, call value(key) or value(key, default) instead of nonNullValue(key).

Example fix

// before
String home = props.nonNullValue("sonar.path.home");
// after
String home = props.value("sonar.path.home", "/opt/sonarqube");
Defensive patterns

Strategy: validation

Validate before calling

if (props.value("sonar.path.home") == null) {
  throw new IllegalStateException("sonar.path.home must be set in conf/sonar.properties before startup");
}

Try / catch

try {
  String v = props.nonNullValue("sonar.path.home");
} catch (IllegalArgumentException e) {
  logger.error("Required property missing: {}", e.getMessage().replace("Missing property: ", ""));
}

Prevention

When it happens

Trigger: 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.

Common situations: Incomplete sonar.properties in a fresh install; missing sonar.path.home / sonar.path.data when computing homeDir; cluster nodes missing required search host configuration.

Understand the failure class

Background: "is required", "must be set", "missing required field": configuration validation errors across open-source libraries — this error's family across 36 libraries.

Related errors


AI-assisted analysis of SonarSource/sonarqube@184c821202 (2026-09-09). Data as JSON: /api/errors/1a6e7e149adf5782. Report an issue: GitHub.

Appendix: source

Thrown at server/sonar-process/src/main/java/org/sonar/process/Props.java:58

  }

  public boolean contains(String key) {
    return properties.containsKey(key);
  }

  @CheckForNull
  public String value(String key) {
    String value = properties.getProperty(key);
    if (value != null && encryption.isEncrypted(value)) {
      value = encryption.decrypt(value);
    }
    return value;
  }

  public String nonNullValue(String key) {
    String value = value(key);
    if (value == null) {
      throw new IllegalArgumentException("Missing property: " + key);
    }
    return value;
  }

  @CheckForNull
  public String value(String key, @Nullable String defaultValue) {
    String s = value(key);
    return s == null ? defaultValue : s;
  }

  public boolean valueAsBoolean(String key) {
    String s = value(key);
    return s != null && Boolean.parseBoolean(s);
  }

  public boolean valueAsBoolean(String key, boolean defaultValue) {
    String s = value(key);
    return s != null ? Boolean.parseBoolean(s) : defaultValue;

View on GitHub (pinned to 184c821202)