SonarSource/sonarqube · error · MessageException
Unsupported value for property
Error message
Unsupported value for property %s: %s
What it means
Thrown by Log4JPropertiesBuilder.createRollingPolicy when the `sonar.log.rollingPolicy` property does not match any of the supported values: `time:<pattern>`, `size:<maxSize>`, or `none`. The builder parses this property to construct a logback-style rolling policy for the process log, and any unrecognized string is a fatal configuration error that aborts process startup.
Solutions
- Set sonar.log.rollingPolicy to one of: `none`, `time:yyyy-MM-dd` (or another pattern), or `size:15MB` (or another size).
- Remove the property entirely to fall back to the default rolling behavior.
- Check for typos and correct the `time:` / `size:` prefix including the colon.
- If you intended rotation by size, also set sonar.log.maxFiles to control retention.
Example fix
// before (sonar.properties) sonar.log.rollingPolicy=daily // after sonar.log.rollingPolicy=time:yyyy-MM-dd
Defensive patterns
Strategy: validation
Validate before calling
String p = System.getProperty("sonar.log.rollingPolicy", props.getProperty("sonar.log.rollingPolicy", "none"));
if (!("none".equals(p) || p.startsWith("time:") || p.startsWith("size:"))) {
throw new IllegalArgumentException("sonar.log.rollingPolicy must be none, time:<pattern> or size:<size>, got: " + p);
} Prevention
- Keep sonar.log.rollingPolicy values in a validated template of sonar.properties.
- Always include the `time:` or `size:` prefix with the colon.
- Lint configuration files in CI for allowed rollingPolicy values.
When it happens
Trigger: Setting sonar.log.rollingPolicy in sonar.properties to anything other than `time:...`, `size:...`, or `none` (e.g. a typo like `size` without prefix, `daily`, or `time` with no pattern).
Common situations: Hand-edited sonar.properties copied from outdated documentation; upgrades where a previously tolerated value was removed; copy-paste from other products' log rotation configs.
Understand the failure class
Background: Invalid enum value errors: "Unknown type", "Invalid scope", "must be one of" — when a string is not on the library's allowed list — this error's family across 23 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/ff32f6f09b0b2add.
Report an issue: GitHub.
Appendix: source
Thrown at server/sonar-process/src/main/java/org/sonar/process/logging/Log4JPropertiesBuilder.java:167
writeConsoleAppender(appenderName, logPattern, jsonOutput);
putProperty(ROOT_LOGGER_NAME + ".appenderRef." + appenderName + ".ref", appenderName);
}
private RollingPolicy createRollingPolicy(File logDir, String filenamePrefix) {
String rollingPolicy = props.value(LOG_ROLLING_POLICY.getKey(), "time:yyyy-MM-dd");
int maxFiles = props.valueAsInt(LOG_MAX_FILES.getKey(), 7);
if (maxFiles <= 0) {
maxFiles = UNLIMITED_MAX_FILES;
}
if (rollingPolicy.startsWith("time:")) {
return new TimeRollingPolicy(filenamePrefix, logDir, maxFiles, StringUtils.substringAfter(rollingPolicy, "time:"));
} else if (rollingPolicy.startsWith("size:")) {
return new SizeRollingPolicy(filenamePrefix, logDir, maxFiles, StringUtils.substringAfter(rollingPolicy, "size:"));
} else if ("none".equals(rollingPolicy)) {
return new NoRollingPolicy(filenamePrefix, logDir);
} else {
throw new MessageException(format("Unsupported value for property %s: %s", LOG_ROLLING_POLICY.getKey(), rollingPolicy));
}
}
private void applyLogLevelConfiguration(LogLevelConfig logLevelConfig) {
if (!ROOT_LOGGER_NAME.equals(logLevelConfig.getRootLoggerName())) {
throw new IllegalArgumentException("Value of LogLevelConfig#rootLoggerName must be \"" + ROOT_LOGGER_NAME + "\"");
}
Level propertyValueAsLevel = getPropertyValueAsLevel(props, LOG_LEVEL.getKey());
boolean traceGloballyEnabled = propertyValueAsLevel == Level.TRACE;
List<String> loggerNames = Stream.of(
logLevelConfig.getConfiguredByProperties().keySet().stream(),
logLevelConfig.getConfiguredByHardcodedLevel().keySet().stream(),
logLevelConfig.getOffUnlessTrace().stream().filter(k -> !traceGloballyEnabled))
.flatMap(s -> s)
.filter(loggerName -> !ROOT_LOGGER_NAME.equals(loggerName))
.distinct()View on GitHub (pinned to 184c821202)