Last analysis failed Analysis ID "AY43Kg5eurEPEdsRa4aa"

  • ALM - GitHub
  • CI system - Azure DevOps
  • Automatic Analysis
  • C#

Analysis keeps failing. No clue why. Can anyone provide more info?

Hello @n-zaaijer-topicus,

We took a look at the analysis and this is the error message returned:

File test/[...]/Helpers/XmlValidationHelper.cs can't be indexed twice. Please check that inclusion/exclusion patterns produce disjoint sets for main and test files

It seems that the automatic detection of source and test files is overlapping. You can try to force the values for the properties sonar.sources and sonar.tests manually in the .sonarcloud.properties file. See documentation here.
And you can find more information on how to set these properties on this page.

Thanks for the reply.

I’ve managed to update the sonar.properties file and tried to exclude the Helpers folder. But now I’m getting another error code ‘AY56eNfpCs0hQG7upQg8’. I’ve tried to run things locally with a SonarQube docker container and I’m not getting any errors there. So I’m a bit confused.

This is my sonar.properties file.

# Path to sources
sonar.sources=src/[...]
#sonar.exclusions=
#sonar.inclusions=

# Path to tests
sonar.tests=test/[...]
sonar.test.exclusions=test/[...]/Helpers/**
#sonar.test.inclusions=

# Source encoding
sonar.sourceEncoding=UTF-8

# Exclusions for copy-paste detection
#sonar.cpd.exclusions=

Thank you for trying this.
The new error is similar to the previous one, but on a different file as the helpers are excluded.

ERROR: File test/[...]/TestSoapFactory.cs can't be indexed twice. Please check that inclusion/exclusion patterns produce disjoint sets for main and test files

So it looks like your configuration is correctly being picked up.

Could you try to run the analysis on SonarCloud with CI-based analysis (the same way you did on SonarQube) instead of using the automatic analysis? It would help us identify if the issue comes from SonarCloud as a whole or if it’s somehow related to automatic analysis.
Here is the documentation if you need it.