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
- Correct sonar.log.rollingPolicy to `time:<pattern>`, `size:<size>`, or `none`.
- Remove the property to use the default policy.
- Verify the value has the exact prefix including the colon, e.g. `size:50MB`.
- 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
- Standardize the property values in deployment templates.
- Validate config at deploy time before starting the process.
- Keep deprecated policy names out of config management modules.
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
- Unsupported value for property
- Fail to load the Logback configuration:
- log level in property is not a supported value (allowed…
- Logback configuration not found in classloader:
- Address in property is not a valid address
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)