Problem "File indexed twice" in SonarQube6.7.4


(Mario) #1

I´m having this problem trying to execute sonarqube via gradle.
We have running two versions of sonar, 5.6 and 6.7.4.

In Sonar 5.6 we can execute ‘gradlew analysis’ without problem but in 6.7.4 no, it says this:
“FILE.java can’t be indexed twice. Please check that inclusion/exclusion patterns produce disjoint sets for main and test files”

Please, any idea?


(G Ann Campbell) #2

Hi,

What are the project configuration differences between the two versions?

Ann


(Mario) #3

There arent differences between both projects, because i want to compare results between both versions.
There were launched in different gradle executions.


(Nicolas Bontoux) #4

Hi,

Handling of modules and indexing of files has evolved since 5.6.x, so it’s possible that your configuration went through the cracks in older versions, and that latest 6.7.x is more cautious.

I would suggest you review the debug logs of your analysis, and understand which file paths are being treated by the scanner, and why are some paths seemingly indexed twice.

Note that I’ve observed such error in some cases where a broad sonar.sources was set either via command line and/or in one of the configuration files, which would override some of the scanner’s behaviour and/or create some overlap. A possible reason here is that. Double-check that on your end, and make sure to review both configuration on CI side and also on the scanner/project side.