Custom rules missing after sonarqube upgrade from 6.7.1 to 6.7.4

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

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

Hi Ann,

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

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

Hi,

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

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

Hi,

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

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

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.

Hi,

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

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.

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

Thanks for the response.

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?

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

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