User "system" automatically reactivates rule upon restart

Sonarqube 1.4.1 running in podman.

Whenever I stop SonarQube, add or remove a plugin and then restart SonarQube, a particular rule is reactived by “system”. It is the built-in rule java:S6813.
Is there a way of permanent deactivation, that survives restarts?

Hi,

Could you check your page footer and share the version you see there?

Do you see the rule being turned back on in a Quality Profile change log? Or does it just reappear? Are you connected to an external database?

 
Ann

I see similar behaviour in our SonarQube installation. All deactivated rules on a profile gets (re)activated by a “System” user.

My C# Quality Profile (extended from sonar Way) is reset to default Sonar one.

I has happened three times in the last few months. The last time (this friday) the sonarqube software was updated. It is possible the previous ones were due to reboots (I am not the admin).

On the changelog page I see
(/profiles/changelog?language=cs&name=My+way)

Date User Action Rule Updates
September 5, 2024 at 1:13 PM System Activated Nested blocks of code should not be left empty Old severity set to Major
Methods should not have too many parameters] Old severity set to Major

etc…

From footer

  • Community Edition
  • v10.6 (92116)[ACTIVE]

Hi @vjohansen,

Welcome to the community!

What profile are we talking about here? To be clear, it’s the “My way” profile?

And you say there was a reboot on the 5th at ~1:13p? Not an upgrade?

 
Thx,
Ann

Yes, “my way” is an extension of the built-in “Sonar Way” for C#. When I click Quality Profiles at the top I see “My way” tabbed/indented just below “Sonar Way” to indicate it is extended.

The Sep 5th was after an upgrade of server. It is the first time I see an “First analysis since …” message in the Overview page for my projects:

September 6, 2024 at 6:21 AM
First analysis since upgrading to SonarQube 10.6.0.92116
Quality Profile:“My way” (C#) updated with [72 new rules and 1 deactivated rule]

My rules were reset July 18 and August 13 without this message appearing.

Hi,

The ability to remove rules from an ‘extended’ profile is relatively recent. I guess we forgot to also add the ability to keep them removed. :sweat_smile:

More seriously, this sounds like a bug in the mechanism to me & I’m going to flag this for the team.

 
Thx,
Ann

1 Like

Yes, exactly.

It is also suspicious that when you make a backup of the extended profile you get an XML file with a list of the active rules. It does not contain information about deactivated rules.

1 Like

Dear @vjohansen and @garlicbread

Thanks a lot for reporting the issue.

I created a task to follow up on the activation of the rules after an upgrade or plugin change: [SONAR-23184] - Jira
Just restarting the SonarQube instance doesn’t impact deactivated rules.

Anita