{"record":{"id":"e1a135505a6fe67d","repo":"SonarSource/sonarqube","slug":"unsupported-value-for-property-s-s-e1a135","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/LogbackHelper.java","lineNumber":276,"sourceCode":"    return encoder;\n  }\n\n  public RollingPolicy createRollingPolicy(Context ctx, Props props, 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    File logsDir = props.nonNullValueAsFile(PATH_LOGS.getKey());\n\n    if (rollingPolicy.startsWith(\"time:\")) {\n      return new TimeRollingPolicy(ctx, filenamePrefix, logsDir, maxFiles, StringUtils.substringAfter(rollingPolicy, \"time:\"));\n\n    } else if (rollingPolicy.startsWith(\"size:\")) {\n      return new SizeRollingPolicy(ctx, filenamePrefix, logsDir, maxFiles, StringUtils.substringAfter(rollingPolicy, \"size:\"));\n\n    } else if (\"none\".equals(rollingPolicy)) {\n      return new NoRollingPolicy(ctx, filenamePrefix, logsDir, maxFiles);\n\n    } else {\n      throw new MessageException(format(\"Unsupported value for property %s: %s\", LOG_ROLLING_POLICY.getKey(), rollingPolicy));\n    }\n  }\n\n  public abstract static class RollingPolicy {\n    protected final Context context;\n    final String filenamePrefix;\n    final File logsDir;\n    final int maxFiles;\n\n    RollingPolicy(Context context, String filenamePrefix, File logsDir, int maxFiles) {\n      this.context = context;\n      this.filenamePrefix = filenamePrefix;\n      this.logsDir = logsDir;\n      this.maxFiles = maxFiles;\n    }\n\n    public abstract FileAppender<ILoggingEvent> createAppender(String appenderName);\n  }","sourceCodeStart":258,"sourceCodeEnd":294,"githubUrl":"https://github.com/SonarSource/sonarqube/blob/184c821202192afc1c599fc912d0889b69fffa53/server/sonar-process/src/main/java/org/sonar/process/logging/LogbackHelper.java#L258-L294","documentation":"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.","triggerScenarios":"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.","commonSituations":"Migration from old properties files with legacy policy names; typos when editing sonar.log.rollingPolicy; tools templating the property with wrong values.","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."],"exampleFix":"// before (sonar.properties)\nsonar.log.rollingPolicy=rotate\n// after\nsonar.log.rollingPolicy=size:50MB","handlingStrategy":"validation","validationCode":"String p = config.get(\"sonar.log.rollingPolicy\");\nboolean ok = p == null || \"none\".equals(p) || p.startsWith(\"time:\") || p.startsWith(\"size:\");\nif (!ok) throw new IllegalArgumentException(\"Invalid sonar.log.rollingPolicy: \" + p);","typeGuard":null,"tryCatchPattern":null,"preventionTips":["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."],"tags":["logging","configuration","rolling-policy"],"backgroundTag":"invalid-config-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"}