Is it possible to control housekeeping params via <sonar_home>/conf/sonar.properties file?

Must-share information (formatted with Markdown):

  • which versions are you using (SonarQube Server / Community Build, Scanner, Plugin, and any relevant extension): Community EditionVersion 9.9.1 (build 69595)
  • how is SonarQube deployed: zip, Docker, Helm: Docker
  • what are you trying to achieve: Enable housekeeping configuration via sonar.properties file
  • what have you tried so far to achieve this: Configuration according existing keys

Hello,
There is a case:
I have sonarqube running in docker container. It is supplied by properties file with db, ldap and other config. It is picked up as expected and works fully.

Recently, i decided to enable custom housekeeping params. I adjusted them via UI to expected values.

However, i can’t apply the same config via sonar.properties files based on admin tab provided keys. I placed the following values inside <sonar_home>/conf/sonar.properties file

sonar.dbcleaner.hoursBeforeKeepingOnlyOneSnapshotByDay=4
sonar.dbcleaner.weeksBeforeKeepingOnlyOneSnapshotByWeek=52
sonar.dbcleaner.weeksBeforeKeepingOnlyAnalysesWithVersion=52
sonar.dbcleaner.weeksBeforeDeletingAllSnapshots=52
sonar.dbcleaner.daysBeforeDeletingClosedIssues=30

Unfortunately, sonarqube ignores all properties file changes and do not apply them to the system even i restart a container or create it from the scratch with an updated properties file.

I definitely can apply the configs via UI or API without problems, but it is confusing why it doesn’t work via <sonar_home>/conf/sonar.properties

Is it possible to control housekeeping via <sonar_home>/conf/sonar.properties at all?

Hey there.

Only the properties that are documented in /conf/sonar.properties should be configured there. The rest are handled via the UI / Web API.

Thanks for the reply, it is really appreciated, did i get you right that the props not mentioned in the following sonar.properties default file sonarqube/sonar-application/src/main/assembly/conf/sonar.properties at master · SonarSource/sonarqube · GitHub could not be managed via sonar.properties file and should be adjusted via UI\Web API only?

That’s correct!

Got you, thanks for the information. It clarified the problem which i had encountered

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.