Metrics and Rules Disabled after Upgrade from 7.4 to 7.8

Hi,
I’ve upgraded from version 7.4 to 7.8

Plugins Installed:

    -rwxrwxr-x 1 root root    2958 Sep 11 08:48 install_plugins.sh
-rw-r--r-- 1 root root 2488257 Sep 11 08:48 sonar-cobertura-plugin-2.0.jar
-rw-r--r-- 1 root root 4094975 Sep 11 08:48 sonar-csharp-plugin-7.15.0.8572.jar
-rw-r--r-- 1 root root 9693125 Sep 11 08:48 sonar-findbugs-plugin-3.11.0.jar
-rw-r--r-- 1 root root 8302745 Sep 11 08:48 sonar-java-plugin-5.13.1.18282.jar
-rw-r--r-- 1 root root 6866969 Sep 11 08:48 sonar-javascript-plugin-5.2.1.7778.jar
-rw-r--r-- 1 root root  300503 Sep 11 08:48 sonar-ldap-plugin-2.2.0.608.jar
-rw-r--r-- 1 root root   14188 Sep 11 08:48 sonar-motion-chart-plugin-1.7.jar
-rw-r--r-- 1 root root 5107348 Sep 11 08:48 sonar-php-plugin-3.1.1.4762.jar
-rw-r--r-- 1 root root 2752167 Sep 11 08:48 sonar-python-plugin-1.14.1.3143.jar
-rw-r--r-- 1 root root 2650234 Sep 11 08:48 sonar-scm-git-plugin-1.4.1.1128.jar
-rw-r--r-- 1 root root    6229 Sep 11 08:48 sonar-tab-metrics-plugin-1.4.1.jar
-rw-r--r-- 1 root root    7364 Sep 11 08:48 sonar-timeline-plugin-1.5.jar
-rw-r--r-- 1 root root 2239156 Sep 11 08:48 sonar-typescript-plugin-1.9.0.3766.jar
-rw-r--r-- 1 root root   18338 Sep 11 08:48 sonar-widget-lab-plugin-1.8.1.jar
-rw-r--r-- 1 root root   36406 Sep 11 08:48 sonarqube-community-branch-plugin-1.1.1.jar

SonarQube Starts successfully after upgrade, but on logging in, I’m missing most of my Rules

Ex. I used to have 1.4K Java Rules,
After the upgrade i only have 192

Upgrade Logs:

Reviewing the upgrade logs, you can see lots of messages regarding the disabling of Metrics
Followed by lots of message regarding disabling of Rules…

19.09.11 16:07:12 INFO  web[][o.s.p.l.LdapContextFactory] Test LDAP connection on ldap://ad-paris.ad-its.credit-agricole.fr:3268: OK
2019.09.11 16:07:12 INFO  web[][org.sonar.INFO] Security realm started
2019.09.11 16:07:12 WARN  web[][o.s.a.s.w.WebService$Action] The response example is not set on action api/plugins/download
2019.09.11 16:07:12 WARN  web[][o.s.a.s.w.WebService$Action] The response example is not set on action api/permissions/search_templates
2019.09.11 16:07:12 DEBUG web[][o.s.s.e.RecoveryIndexer] Elasticsearch recovery - sonar.search.recovery.delayInMs=300000
2019.09.11 16:07:12 DEBUG web[][o.s.s.e.RecoveryIndexer] Elasticsearch recovery - sonar.search.recovery.initialDelayInMs=28547
2019.09.11 16:07:12 INFO  web[][o.s.s.t.TelemetryDaemon] Sharing of SonarQube statistics is enabled.
2019.09.11 16:07:12 INFO  web[][o.s.s.n.NotificationDaemon] Notification service started (delay 60 sec.)
2019.09.11 16:07:12 INFO  web[][o.s.s.s.GeneratePluginIndex] Generate scanner plugin index
2019.09.11 16:07:12 DEBUG web[][o.s.s.s.GeneratePluginIndex] Generate scanner plugin index (done) | time=1ms
2019.09.11 16:07:12 INFO  web[][o.s.s.s.RegisterPlugins] Register plugins
2019.09.11 16:07:12 DEBUG web[][o.s.s.s.RegisterPlugins] Update plugin python
2019.09.11 16:07:12 DEBUG web[][o.s.s.s.RegisterPlugins] Update plugin javascript
2019.09.11 16:07:12 DEBUG web[][o.s.s.s.RegisterPlugins] Update plugin csharp
2019.09.11 16:07:12 DEBUG web[][o.s.s.s.RegisterPlugins] Update plugin findbugs
2019.09.11 16:07:12 DEBUG web[][o.s.s.s.RegisterPlugins] Update plugin java
2019.09.11 16:07:12 DEBUG web[][o.s.s.s.RegisterPlugins] Update plugin php
2019.09.11 16:07:12 DEBUG web[][o.s.s.s.RegisterPlugins] Update plugin typescript
2019.09.11 16:07:12 DEBUG web[][o.s.s.s.RegisterPlugins] Register new plugin communityBranchPlugin
2019.09.11 16:07:12 DEBUG web[][o.s.s.s.RegisterPlugins] Register plugins (done) | time=13ms
2019.09.11 16:07:12 INFO  web[][o.s.s.s.RegisterMetrics] Register metrics
2019.09.11 16:07:13 INFO  web[][o.s.s.s.RegisterMetrics] Disable metric Class Distribution / Complexity [class_complexity_distribution]
2019.09.11 16:07:13 INFO  web[][o.s.s.s.RegisterMetrics] Disable metric Lines to Cover by IT on New Code [new_it_lines_to_cover]
2019.09.11 16:07:13 INFO  web[][o.s.s.s.RegisterMetrics] Disable metric Overall Conditions by Line [overall_conditions_by_line]
2019.09.11 16:07:13 INFO  web[][o.s.s.s.RegisterMetrics] Disable metric Overall Uncovered Conditions [overall_uncovered_conditions]
2019.09.11 16:07:13 INFO  web[][o.s.s.s.RegisterMetrics] Disable metric Coverage by IT on New Code [new_it_coverage]
2019.09.11 16:07:13 INFO  web[][o.s.s.s.RegisterMetrics] Disable metric Uncovered Lines by IT on New Code [new_it_uncovered_lines]
2019.09.11 16:07:13 INFO  web[][o.s.s.s.RegisterMetrics] Disable metric Overall Lines to Cover on New Code [new_overall_lines_to_cover]
2019.09.11 16:07:13 INFO  web[][o.s.s.s.RegisterMetrics] Disable metric Condition Coverage by IT on New Code [new_it_branch_coverage]
2019.09.11 16:07:13 INFO  web[][o.s.s.s.RegisterMetrics] Disable metric Line Coverage by IT on New Code [new_it_line_coverage]
2019.09.11 16:07:13 INFO  web[][o.s.s.s.RegisterMetrics] Disable metric Commented-Out LOC [commented_out_code_lines]
2019.09.11 16:07:13 INFO  web[][o.s.s.s.RegisterMetrics] Disable metric Unit Test Details [test_data]
2019.09.11 16:07:13 INFO  web[][o.s.s.s.RegisterMetrics] Disable metric Overall Uncovered Lines on New Code [new_overall_uncovered_lines]
2019.09.11 16:07:13 INFO  web[][o.s.s.s.RegisterMetrics] Disable metric Overall Line Coverage on New Code [new_overall_line_coverage]
2019.09.11 16:07:13 INFO  web[][o.s.s.s.RegisterMetrics] Disable metric Coverage Hits by Line [coverage_line_hits_data]
2019.09.11 16:07:13 INFO  web[][o.s.s.s.RegisterMetrics] Disable metric IT Covered Conditions by Line [it_covered_conditions_by_line]
2019.09.11 16:07:13 INFO  web[][o.s.s.s.RegisterMetrics] Disable metric IT Uncovered Lines [it_uncovered_lines]
2019.09.11 16:07:13 INFO  web[][o.s.s.s.RegisterMetrics] Disable metric IT Uncovered Conditions [it_uncovered_conditions]

Later…

2019.09.11 16:07:13 INFO  web[][o.s.s.s.RegisterMetrics] Disable metric IT Coverage [it_coverage]
2019.09.11 16:07:13 DEBUG web[][o.s.s.s.RegisterMetrics] Register metrics (done) | time=106ms
2019.09.11 16:07:13 INFO  web[][o.s.s.r.RegisterRules] Register rules
2019.09.11 16:07:16 DEBUG web[][o.s.s.r.RegisterRules] Propagate new param with name maximum to active rules of rule typescript:S1479 | time=4ms
2019.09.11 16:07:16 INFO  web[][o.s.s.r.RegisterRules] Disable rule javascript:VariableShadowing
2019.09.11 16:07:16 INFO  web[][o.s.s.r.RegisterRules] Disable rule javascript:S2228
2019.09.11 16:07:16 INFO  web[][o.s.s.r.RegisterRules] Disable rule findsecbugs-jsp:JSP_SPRING_EVAL
2019.09.11 16:07:16 INFO  web[][o.s.s.r.RegisterRules] Disable rule findsecbugs-jsp:JSP_INCLUDE
2019.09.11 16:07:16 INFO  web[][o.s.s.r.RegisterRules] Disable rule findsecbugs-jsp:XSS_REQUEST_PARAMETER_TO_JSP_WRITER
2019.09.11 16:07:16 INFO  web[][o.s.s.r.RegisterRules] Disable rule findsecbugs-jsp:JSP_XSLT
2019.09.11 16:07:16 INFO  web[][o.s.s.r.RegisterRules] Disable rule findsecbugs-jsp:JSP_JSTL_OUT
2019.09.11 16:07:16 INFO  web[][o.s.s.r.RegisterRules] Disable rule findsecbugs-jsp:XSS_JSP_PRINT
2019.09.11 16:07:16 INFO  web[][o.s.s.r.RegisterRules] Disable rule common-jsp:InsufficientBranchCoverage
2019.09.11 16:07:16 INFO  web[][o.s.s.r.RegisterRules] Disable rule common-jsp:InsufficientLineCoverage
2019.09.11 16:07:16 INFO  web[][o.s.s.r.RegisterRules] Disable rule common-jsp:InsufficientCommentDensity
2019.09.11 16:07:16 INFO  web[][o.s.s.r.RegisterRules] Disable rule common-jsp:DuplicatedBlocks
2019.09.11 16:07:16 INFO  web[][o.s.s.r.RegisterRules] Disable rule common-jsp:SkippedUnitTests
2019.09.11 16:07:16 INFO  web[][o.s.s.r.RegisterRules] Disable rule common-jsp:FailedUnitTests
2019.09.11 16:07:16 INFO  web[][o.s.s.r.RegisterRules] Disable rule php:S4721
2019.09.11 16:07:16 INFO  web[][o.s.s.r.RegisterRules] Disable rule squid:S4825
2019.09.11 16:07:16 INFO  web[][o.s.s.r.RegisterRules] Disable rule squid:S4721
2019.09.11 16:07:16 INFO  web[][o.s.s.r.RegisterRules] Disable rule squid:S1523
2019.09.11 16:07:16 INFO  web[][o.s.s.r.RegisterRules] Disable rule squid:S4817
2019.09.11 16:07:16 INFO  web[][o.s.s.r.RegisterRules] Disable rule squid:S4797
2019.09.11 16:07:16 INFO  web[][o.s.s.r.RegisterRules] Disable rule squid:S4529
2019.09.11 16:07:16 INFO  web[][o.s.s.r.RegisterRules] Disable rule external_eslint:space-before-blocks
2019.09.11 16:07:16 INFO  web[][o.s.s.r.RegisterRules] Disable rule external_eslint:valid-jsdoc
2019.09.11 16:07:16 INFO  web[][o.s.s.r.RegisterRules] Disable rule external_eslint:no-unreachable

Hi,

There are several things potentially going on here. First, it’s quite possible that your ES indices are messed up. The cure for that is to shut down, delete $SONARQUBE-HOME/data/es6 and restart. I doubt that will get you back to 1.4k Java rules though.

The current version of the built-in Java analyzer only offers 500+ (too lazy to look up the exact number) so the other ~1k rules were coming from other analyzers. Looking at your list of plugins I see only one other that could be providing Java rules: FindBugs. I’m skeptical that it ever offered that many rules, but if you’ve rules missing, that’s where I would look.

One reason that the FindBugs rules would be missing is that your FindBugs plugin isn’t compatible with your current server version. (This is speculative; I haven’t looked up that version compatibility.)
Looking at your plugin list I suspect that from version to version to version you’re copying over the plugins from the previous installation (PHP gave you away. All the other built-in analyzers are up to date, but PHP is a version behind what shipped with 7.9 :slightly_smiling_face:) The risk with that is that you do port forward out-of-date plugins. For instance, sonar-widget-lab hasn’t been relevant since SQ version 6.3 (IIRC) when dashboards were removed, and the same for Tab Metrics, and Timeline. If I were you, I’d start from a fresh download of the 7.9 bundle and selectively reinstall from the Marketplace any additional plugins you still feel you need.

Finally, regarding your logs, the metrics you see listed are indeed deprecated, most of them for quite a while now. They’re likely lingering in your DB because they have values recorded for old analyses. These disabled metric warnings are just that - only warnings - and I wouldn’t worry much about them if I were you.

Regarding the disabled rules, SonarSource continually iterates on its language analyzers and sometimes drops rules we no longer feel are valuable. That’s going to be the case for all the rule keys that aren’t prefixed findsecbugs-jsp. For those you’d have to ask the folks behind that analyzer. If you have questions about specific disabled rules it would be best to open new, individual threads.

 
HTH,
Ann

Hi Ann,

Thank you for your quick response and helpful answer.
This had me confused as i had run the upgrade previously with the same configuration and had no issues whatsoever.

I tried your first suggestion:
The cure for that is to shut down, delete $SONARQUBE-HOME/data/es6 and restart

This worked perfectly and got me back all 1.4k rules that i was expecting.

I will also remove the out of date plugins as you have suggested.

Thanks again for your great support.
Maurice

1 Like