Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Sonar fails with can't be indexed twice. Please check that inclusion/exclusion patterns produce disjoint sets for main and test files

I have just upgraded to SonarQube 6.4 and at the same time moved to mysql. Whenever I try to parse a particular solution I get the message:

can't be indexed twice. Please check that inclusion/exclusion patterns produce disjoint sets for main and test files

I am running the scanner through VSTS using the new SonarQube tasks. I have also tried to pass the -X flag to SQ but it is not getting through the VSTS task. I have also upped the mysql max packet to 512M and restarted both mysql and Sonar servers. I'm at a loss

like image 237
JBelbute Avatar asked Aug 11 '17 15:08

JBelbute


2 Answers

In my case, along with the exclusions, I had written

sonar.sources=.

Once I removed this, it started working.

like image 150
Ganesh Satpute Avatar answered Nov 16 '22 08:11

Ganesh Satpute


Have a look at the post here: https://github.com/SonarSource/sonar-csharp/issues/958

and follow the advice in the bottom:

The problem it's caused by /d:sonar.source="Project" or /d:sonar.tests="Project.Tests", just remove and works.

It works for me.

like image 36
civic.LiLister Avatar answered Nov 16 '22 09:11

civic.LiLister