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

JBelbute picture JBelbute · Aug 11, 2017 · Viewed 18k times · Source

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

Answer

civic.LiLister picture civic.LiLister · Mar 6, 2018

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.