I am upgrading a 5.6 SonarQube installation to 6.7 LTS. The backend server is PostgreSQL.
The PostgreSQL database used to run 8.4 with ASCII encoding. It has been successfully converted to 9.6 with UTF-8 prior to the SonarQube upgrade.
The target system is sonarqube:6.7.4-alpine in Docker (https://hub.docker.com/_/sonarqube/) with docker-compose, based on the recipe here: https://github.com/SonarSource/docker-sonarqube/blob/master/recipes.md
Successful steps so far:
- started the converted database running Postgres 9.6
- started SonarQube 5.6 image with plugins (based on sonarqube:5.6-alpine), login successful, everything looks fine
- started SonarQube 5.6.7 image with the same plugins (based on sonarqube:5.6.7-alpine)
- ran SONAR-URL/setup to convert the database to 5.6.7, took about 10 minutes
- still SonarQube 5.6.7, login successful, everything looks fine, restart works
- started SonarQube 6.7.4 image with upgraded plugins (based on sonarqube:6.7.4-alpine)
- ran SONAR-URL/setup to convert the database to 6.7.4, took about 3 hours
After the migration, SonarQube performed initialization: disabling of rules, indexing etc. The login UI was displayed but the last time I wasn’t able to login (using the LDAP plugin for authentication). This could be a temporary problem, I have managed to get this far before and was able to login directly after the migration.
However, always after migration to 6.7.4, the server fails to restart with “Rule not found”. Logs
2018.07.06 09:27:50 INFO web[o.s.s.q.RegisterQualityProfiles] Update profile java/Sonar way
2018.07.06 09:27:50 ERROR web[o.s.s.p.Platform] Background initialization failed. Stopping SonarQube
org.sonar.server.exceptions.BadRequestException: Rule not found: squid:RedundantThrowsDeclarationCheck
[followed by stacktrace and server shutdown]
I have tried 3-4 times (which is quite arduous, since the upgrade takes so long). The failing rule is not always the same, but startup always fails in the same way.
Things I have tried between upgrade attempts:
- upgrading plugins to the latest version, e.g. SonarC# 7.1 -> 7.2, SonarJava 5.4 -> 5.5
- emptying the SonarQube data volume before restarting