Search code examples
sonarqubesonarqube-websonarqube5.6

Unable to Activate Coding Rules in new Quality Profile


I'm attempting to create a clone of the existing java Sonar Way Quality Profile. I'm following the instructions at http://docs.sonarqube.org/display/SONAR/Quality+Profiles for "How do I ... Copy the rules from one profile to another?" SQ 5.6/Java plugin 4.2.

  1. Create a new Quality Profile (MyQP with language type java). [Creation successful. 0 active rules, as expected.]

MyQP created - 0 active rules

  1. Filter on Sonar Way (java) Quality Profile to get 235 active code rules.

  2. Bulk Change -> Activate In MyQP. [Seems to work - "235 rule(s) changed in MyQP"].

  3. But, MyQP when "active" has "No Coding Rules" and my list of rules is completely blank. However, when MyQP is "inactive" I get a list of all 386 java rules (some of which are active and some are not). If I Bulk Change -> Activate in MyQP all 386 rules something happens (all the Deactivated rules seem to activate), but I still can't see any of them (No Coding Rules) when I change the status of MyQP from inactive -> active (under the Quality Profile section).

Error log:

ERROR web[o.s.s.es.BulkIndexer] Fail to execute bulk index request: Bulk[237 index request(s) on index rules and type activeRule] org.elasticsearch.transport.RemoteTransportException: [sonar-1474516381064][inet[/127.0.0.1:9001]][indices:data/wr‌​ite/bulk] Caused by: org.elasticsearch.index.mapper.MapperParsingException: The provided routing value [common-java] doesn't match the routing key stored in the document: [common-java:DuplicatedBlocks]

Am I missing something? I think I'm following the directions to the letter.


Solution

  • Drop the directory data/es and restart the server. Your ES data must be corrupted.