Sonar Scan fails with can't be index twice for sonarqube version 8.3

Hi All, I am using the latest version of sonarQube 8.3 and have been running into the issue of can’t be indexed twice. Please check that inclusion/exclusion patterns produce disjoint sets for main and test files.
My project structure is:
Apollo
|- Apollo.UI
|- Apollo.UI.Tests
|- packages
|- Apollo.sln

I am using these commands to build the project -
SonarScanner.MSBuild.exe begin -k:“abc” -d:sonar.cs.dotcover.reportsPaths=dotCover.html -d:sonar.sources=Apollo.UI -d:sonar.tests=Apollo.UI.Tests

MSBuild.exe Apollo.sln /t:Rebuild

SonarScanner.MSBuild.exe end

Please help. This was working fine until SonarQube 5.6 and with the upgrade to 8.3 it has started giving this issue.

hi @Paras_Sharma

  • please give us the verbose output of the END step (please run SonarScanner.MSBuild.exe begin /k:"MyProject" /d:sonar.verbose=true as the BEGIN step, and please attach the output of END step)

Hi @Endrei After removing sonar.source and sonar.tests from the begin command, it has started working now. Now the report doesn’t show any test data even though dotCover.html and Tests.trx is there. Do we have to pass --collect for this to work ?

hi @Paras_Sharma, it seems I forgot to follow up.

If you don’t give us the verbose output of your commands, as I asked, it’s very hard to tell what’s going wrong.

Hey @Andrei_Epure Thanks for getting back. The issue is fixed

cool, thanks for the update

for the community: what was the problem?

@Andrei_Epure & All - I was passign the wrong path for dotcover.html in the sonar build statement. After correcting the path, it started to work.

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.