Custom rules missing after sonarqube upgrade from 6.7.1 to 6.7.4

upgrade
custom_rules

(Ramdas Sivaramakrishnan) #1

Hello,

I recently upgraded Sonarqube from 6.7.1 to 6.7.4.
The custom rules I created have all gone missing after the upgrade. Is there anyway to restore those custom rules.

Thanks


(G Ann Campbell) #2

Hi,

Are these custom rules based on rule templates, or via a plugin? And are you sure you have all the underlying language analyzers installed in your new instance? (You have to do that manually.)

Ann


(Ramdas Sivaramakrishnan) #3

Hi Ann,

Yes, I have all the language analyzers installed. These rules are based on rule templates.


(G Ann Campbell) #4

Can you share the language, analyzer version, and template id, please?


(Ramdas Sivaramakrishnan) #5

Hi,

Here are the details
rule template - Regexp Singleline
language - Java
version - 5.5


(G Ann Campbell) #6

Hi,

I can’t find record of a rule like that in our system. My guess is that it was provided by Checkstyle or PMD and you don’t have the analyzer loaded.

Ann


(Ramdas Sivaramakrishnan) #7

Hi,

Yes, it is from checkstyle. But I have the analyzer loaded.


(G Ann Campbell) #8

Was there anything relevant-seeming in any of the server logs at startup?


(Jeff Baker) #9

Hi G Ann, When we did the upgrade there we no errors in the log o any kind. There were also no messages about rules being removed, not found, etc…

Here are the steps taken for the upgrade:

  1. Upgraded all plugins to latest from marketplace.
  2. Followed the Upgrade steps outlined in the documentation online (link from upgrade notice in app).
    2.1) In our case the only change is adding the database credentials and the PostgreSQL JDBC lines to the conf/sonar.properties
  3. I started the Sonarqube 6.7.4
  4. I installed the plugins that were installed before.

(Ramdas Sivaramakrishnan) #10

Hi,

Can some one please helps us regarding the missing custom rules?


(Ramdas Sivaramakrishnan) #11

Hi,

So we lost all the custom rules after the upgrade from 6.7.1 to 6.7.4.

I added all the custom rules back. Now the problem is I have marked like 50+ issues as false positive. I have lost those aswell. Sonar is flagging those as issues now.

Is there a workaround to get the missing custom rules. I thought the upgrade will not create a problem.


(G Ann Campbell) #12

Hi,

Re-reading this, I think I’ve found the problem:

The plugins that were installed before needed to have been in place before your first startup on the new version.

I guess that’s where your custom rules went. And unfortunately, there’s no way to recover the issues you had previously marked False Positive except to restore your database to the backup you made before the upgrade, and re-do the upgrade.

Sorry,
Ann


(Ramdas Sivaramakrishnan) #13

Thanks for the response.


(Jeff Baker) #14

Ann, I followed the steps in this page: https://docs.sonarqube.org/display/SONAR/Upgrading

Step 2 is where I need clarification. I started the new Sonar to install the plugins, before I changed the configuration to use our PostgreSQL DB. Is there a different way to install the plugins?


(G Ann Campbell) #15

Hi Jeff,

You needed to have performed a manual install. I’ve updated the docs to make that explicit. I’m sorry about the confusion.

Ann


(G Ann Campbell) #16

A post was split to a new topic: Writing custom rule that checks commit date