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

Viewed 32656

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

5 Answers

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

sonar.sources=.

Once I removed this, it started working.

"sonar.tests.inclusions=src/**/*.spec.ts" and "sonar.tests=src" are in conflict, take just only one

Access the Sonar, Enter your project screen in the master branch followed: Click Administration> Analysis Scope> In *Code coverage options *Duplications *Source File Exclusions insert the folder that may be being counted twice when reading the code, in my case it was the src folder so I put it in one of the ** /src/ **(no spaces) fields and the problem was solved

If you have mentioned exclusion property in the test command and also in the sonar-project.properties file. Remove it from either of those.

Check all properties, remove any duplicates.

Related