{"record":{"id":"ff32f6f09b0b2add","repo":"SonarSource/sonarqube","slug":"unsupported-value-for-property-s-s","errorCode":null,"errorMessage":"Unsupported value for property %s: %s","messagePattern":"Unsupported value for property (.+?): (.+?)","errorType":"validation","errorClass":"MessageException","httpStatus":null,"severity":"error","filePath":"server/sonar-process/src/main/java/org/sonar/process/logging/Log4JPropertiesBuilder.java","lineNumber":167,"sourceCode":"    writeConsoleAppender(appenderName, logPattern, jsonOutput);\n    putProperty(ROOT_LOGGER_NAME + \".appenderRef.\" + appenderName + \".ref\", appenderName);\n  }\n\n  private RollingPolicy createRollingPolicy(File logDir, String filenamePrefix) {\n    String rollingPolicy = props.value(LOG_ROLLING_POLICY.getKey(), \"time:yyyy-MM-dd\");\n    int maxFiles = props.valueAsInt(LOG_MAX_FILES.getKey(), 7);\n    if (maxFiles <= 0) {\n      maxFiles = UNLIMITED_MAX_FILES;\n    }\n\n    if (rollingPolicy.startsWith(\"time:\")) {\n      return new TimeRollingPolicy(filenamePrefix, logDir, maxFiles, StringUtils.substringAfter(rollingPolicy, \"time:\"));\n    } else if (rollingPolicy.startsWith(\"size:\")) {\n      return new SizeRollingPolicy(filenamePrefix, logDir, maxFiles, StringUtils.substringAfter(rollingPolicy, \"size:\"));\n    } else if (\"none\".equals(rollingPolicy)) {\n      return new NoRollingPolicy(filenamePrefix, logDir);\n    } else {\n      throw new MessageException(format(\"Unsupported value for property %s: %s\", LOG_ROLLING_POLICY.getKey(), rollingPolicy));\n    }\n  }\n\n  private void applyLogLevelConfiguration(LogLevelConfig logLevelConfig) {\n    if (!ROOT_LOGGER_NAME.equals(logLevelConfig.getRootLoggerName())) {\n      throw new IllegalArgumentException(\"Value of LogLevelConfig#rootLoggerName must be \\\"\" + ROOT_LOGGER_NAME + \"\\\"\");\n    }\n\n    Level propertyValueAsLevel = getPropertyValueAsLevel(props, LOG_LEVEL.getKey());\n    boolean traceGloballyEnabled = propertyValueAsLevel == Level.TRACE;\n\n    List<String> loggerNames = Stream.of(\n      logLevelConfig.getConfiguredByProperties().keySet().stream(),\n      logLevelConfig.getConfiguredByHardcodedLevel().keySet().stream(),\n      logLevelConfig.getOffUnlessTrace().stream().filter(k -> !traceGloballyEnabled))\n      .flatMap(s -> s)\n      .filter(loggerName -> !ROOT_LOGGER_NAME.equals(loggerName))\n      .distinct()","sourceCodeStart":149,"sourceCodeEnd":185,"githubUrl":"https://github.com/SonarSource/sonarqube/blob/184c821202192afc1c599fc912d0889b69fffa53/server/sonar-process/src/main/java/org/sonar/process/logging/Log4JPropertiesBuilder.java#L149-L185","documentation":"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.","triggerScenarios":"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).","commonSituations":"Hand-edited sonar.properties copied from outdated documentation; upgrades where a previously tolerated value was removed; copy-paste from other products' log rotation configs.","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."],"exampleFix":"// before (sonar.properties)\nsonar.log.rollingPolicy=daily\n// after\nsonar.log.rollingPolicy=time:yyyy-MM-dd","handlingStrategy":"validation","validationCode":"String p = System.getProperty(\"sonar.log.rollingPolicy\", props.getProperty(\"sonar.log.rollingPolicy\", \"none\"));\nif (!(\"none\".equals(p) || p.startsWith(\"time:\") || p.startsWith(\"size:\"))) {\n  throw new IllegalArgumentException(\"sonar.log.rollingPolicy must be none, time:<pattern> or size:<size>, got: \" + p);\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["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."],"tags":["logging","configuration","rolling-policy"],"backgroundTag":"invalid-enum-value","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"}