Back up of a Quality profile includes deactivated rules

SonarQube 8.5.1

I have deactivated many rules and created a custom quality profile. In the UI I used the ‘Back up’ menu under the quality profile ‘Gear icon’ to back up my custom profile.

The downloaded xml contains the rules that are deactivated.

Hi @MoZee,

Welcome to the SonarSource community!

Can you attach the custom quality profile (or a subset of the rules) xml file here so that I can try reproducing the error?

Did these rules come from a prior SonarQube version older than 8.5.1?

Joe

Hi Joe,
I copied canned default profile to a new ‘Sonar way Sample’. Deactivated all Major, Minor and Info rules. Sonar way Sample now has 109 rules ( Blocker - 35, Critical - 74)
But the backup xml has Major, Minor and Info rules in addition to Blocker and Critical. Find the xml attached.

Sonar_way_Sample.xml.zip (2.4 KB)

Hi Mo,

Thank you for the screenshots, that was very helpful.

I tried the exact steps with the “Sonar way” Java default quality profile and I did not have the same mismatch as you:



129 is matching for total active rules, both in left-hand summary box and the Inheritance box.

There are strange things on your screenshot:

  • Yours show 1.3k inactive rules, whereas mine only shows 485.
  • In the first screenshot, you show 6, 17, 11, 1 rules by type, but in the second screenshot it shows 20, 29, 47, 13 rules by type.

Did you upgrade to SonarQube 8.5.1 recently or how long have you been using SonarQube for? Did your database undergo any changes recently or how long do you think this problem has been happening?

Joe

Can you please zip your $SONARQUBE_HOME/logs folder and attach it to your next response?

AFAIK, SonarQube has been used for a long time and was upgraded to 8.5.1 few days ago.
I had done the same exercise using 8.4 and did not face this issue.

Thanks for the information. If you don’t mind, can you include the zip of $SONARQUBE_HOME/logs folder including the date of the upgrade up to now? If not, at least the most recent logs that show the restart or startup of SonarQube 8.5.1?

Hi @MoZee,

If you haven’t tried this already, please follow the same procedure as described here:

  1. Stop SonarQube
  2. Delete the $SONARQUBE_HOME/data/es6 directory
  3. Restart SonarQube

Then check the quality profile and its rules count again. This will force a rebuild of the Elasticsearch indices (this operation can take a long time depending on the number of issues and components).

Joe

1 Like

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