4
votes

We recently upgraded to version SonarQube 6.2. For all the projects (16) the statistics for:

Bugs, Vulnerabilities, Debt, Smells, Duplications, Duplicated Blocks

are all zero (0). Only the Coverage measures show positive coverage values and is present as expected.

As an independent test we created a simple Java project with a few tech debt issues. This project, like the other projects all use Gradle and the Gradle plugin: id 'org.sonarqube' version '2.2.1'. When the SonarQube task published the data to SonarQube it appears again as still zero. We then changed the sonar host url to a local Docker instance:

systemProp.sonar.host.url = http:/192.168.99.100:9000

The Docker instance was successfully started with:

docker run -d --name sonarqube -p 9000:9000 -p 9092:9092 sonarqube

With the same, simple project when the Gradle task SonarQube posts the results to the Docker url then this same version 6.2 of SonarQube shows all the correct data and nothing is zero or missing.

Both of our SonarQube version 6.2 servers are running the same plugins yet present different results. The main difference is the Docker instance is starting with a fresh database where the older network node that presents the zero data has been upgraded from previous SonarQube versions over the last 2 years.

We suspect something with the upgrades has introduced a defect that is causing all these zeros (0). It appears the problem would be resolved by starting with a new database, but sadly the history will be lost.

Does anyone have experience with these zeroed measures?

How might one fix the problem (database?) without loosing the history?

2
Have you tried rm $SONARQUBE_HOME/data/es? That has to be in the middle of a restart, of course.G. Ann - SonarSource Team
Thank you, this solved the problem and it was an easy fix. Perhaps this symptom could be added to the FAQ page as my question was "I'm missing data" and not "How to trigger a full SonarQube ES reindex?"javajon
Seams that the problem got fixed. At least since we updated to version 6.5 the problem does no longer exist.MrSmith42

2 Answers

2
votes

G. Ann's (SonarSource Team) suggestion of

rm $SONARQUBE_HOME/data/es 

solved the problem. Once this was applied the subsequent posted analysis appeared with the correct values with no data loss.

More on how to apply this solution can be found here: How to trigger a full SonarQube ES reindex.

-2
votes

sudo rm -r $SONARQUBE_HOME/data/es turned out to be not a good idea. I was not able to restart Sonarqube again. Better rename the directory so you can restore it.