SonarSource/sonarqube · error · MessageException

Unsupported value for property

Error message

Unsupported value for property %s: %s

What it means

The modern (LogbackHelper) createRollingPolicy builds an appender RollingPolicy from the `sonar.log.rollingPolicy` property, accepting `time:<pattern>`, `size:<size>`, or `none`. Any other value throws a MessageException, failing process configuration. It is the logback-based successor of the same check in Log4JPropertiesBuilder.

Solutions

  1. Correct sonar.log.rollingPolicy to `time:<pattern>`, `size:<size>`, or `none`.
  2. Remove the property to use the default policy.
  3. Verify the value has the exact prefix including the colon, e.g. `size:50MB`.
  4. Cross-check `sonar.log.maxFiles` is a valid integer when a rolling policy is set.

Example fix

// before (sonar.properties)
sonar.log.rollingPolicy=rotate
// after
sonar.log.rollingPolicy=size:50MB
Defensive patterns

Strategy: validation

Validate before calling

String p = config.get("sonar.log.rollingPolicy");
boolean ok = p == null || "none".equals(p) || p.startsWith("time:") || p.startsWith("size:");
if (!ok) throw new IllegalArgumentException("Invalid sonar.log.rollingPolicy: " + p);

Prevention

When it happens

Trigger: sonar.log.rollingPolicy set to an unrecognized value (missing `time:`/`size:` prefix, misspelled `non`, empty string) while starting a SonarQube compute engine / web process with logback logging.

Common situations: Migration from old properties files with legacy policy names; typos when editing sonar.log.rollingPolicy; tools templating the property with wrong values.

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 SonarSource/sonarqube@184c821202 (2026-09-09). Data as JSON: /api/errors/e1a135505a6fe67d. Report an issue: GitHub.

Appendix: source

Thrown at server/sonar-process/src/main/java/org/sonar/process/logging/LogbackHelper.java:276

    return encoder;
  }

  public RollingPolicy createRollingPolicy(Context ctx, Props props, String filenamePrefix) {
    String rollingPolicy = props.value(LOG_ROLLING_POLICY.getKey(), "time:yyyy-MM-dd");
    int maxFiles = props.valueAsInt(LOG_MAX_FILES.getKey(), 7);
    File logsDir = props.nonNullValueAsFile(PATH_LOGS.getKey());

    if (rollingPolicy.startsWith("time:")) {
      return new TimeRollingPolicy(ctx, filenamePrefix, logsDir, maxFiles, StringUtils.substringAfter(rollingPolicy, "time:"));

    } else if (rollingPolicy.startsWith("size:")) {
      return new SizeRollingPolicy(ctx, filenamePrefix, logsDir, maxFiles, StringUtils.substringAfter(rollingPolicy, "size:"));

    } else if ("none".equals(rollingPolicy)) {
      return new NoRollingPolicy(ctx, filenamePrefix, logsDir, maxFiles);

    } else {
      throw new MessageException(format("Unsupported value for property %s: %s", LOG_ROLLING_POLICY.getKey(), rollingPolicy));
    }
  }

  public abstract static class RollingPolicy {
    protected final Context context;
    final String filenamePrefix;
    final File logsDir;
    final int maxFiles;

    RollingPolicy(Context context, String filenamePrefix, File logsDir, int maxFiles) {
      this.context = context;
      this.filenamePrefix = filenamePrefix;
      this.logsDir = logsDir;
      this.maxFiles = maxFiles;
    }

    public abstract FileAppender<ILoggingEvent> createAppender(String appenderName);
  }

View on GitHub (pinned to 184c821202)