Azure pipelines with SonarCloud (paid) fails while running code analysis

Hi, i have an Azure Devops pipline setup for SonarCloud analysis and currently getting the error during code analysis process. Build process is using SonarCloud extension tasks…

18:18:13.824 INFO: Branch name: iteration30, type: short living
18:18:13.844 INFO: SCM collecting changed files in the branch
18:18:13.993 INFO: ------------------------------------------------------------------------
18:18:13.993 INFO: EXECUTION FAILURE
18:18:13.993 INFO: ------------------------------------------------------------------------
18:18:13.994 INFO: Total time: 12.198s
18:18:14.131 INFO: Final Memory: 22M/242M
18:18:14.132 INFO: ------------------------------------------------------------------------
##[error]18:18:14.132 ERROR: Error during SonarQube Scanner execution
18:18:14.132 ERROR: Error during SonarQube Scanner execution
##[error]18:18:14.132 ERROR: Unable to load component class org.sonar.scanner.scan.filesystem.ProjectFileIndexer
18:18:14.132 ERROR: Caused by: Unable to load component class org.sonar.scanner.scan.filesystem.FileIndexer
18:18:14.132 ERROR: Caused by: Unable to load component class org.sonar.scanner.scan.filesystem.MetadataGenerator
18:18:14.132 ERROR: Caused by: Unable to load component class org.sonar.scanner.scan.filesystem.StatusDetection
18:18:14.132 ERROR: Caused by: Unable to load component class org.sonar.scanner.scm.ScmChangedFiles
18:18:14.132 ERROR: 
18:18:14.132 ERROR: Re-run SonarQube Scanner using the -X switch to enable full debug logging.
18:18:14.132 ERROR: Unable to load component class org.sonar.scanner.scan.filesystem.ProjectFileIndexer
18:18:14.132 ERROR: Caused by: Unable to load component class org.sonar.scanner.scan.filesystem.FileIndexer
18:18:14.132 ERROR: Caused by: Unable to load component class org.sonar.scanner.scan.filesystem.MetadataGenerator
18:18:14.132 ERROR: Caused by: Unable to load component class org.sonar.scanner.scan.filesystem.StatusDetection
18:18:14.132 ERROR: Caused by: Unable to load component class org.sonar.scanner.scm.ScmChangedFiles
18:18:14.132 ERROR: 
18:18:14.132 ERROR: Re-run SonarQube Scanner using the -X switch to enable full debug logging.
##[error]/home/mycare-build/vsts_agent/_work/_tasks/SonarCloudAnalyze_ce096e50-6155-4de8-8800-4221aaeed4a1/1.6.3/sonar-scanner/bin/sonar-scanner failed with return code: 1


Any suggestion on what is missing?

Hi @Fabrice_Bellingard could you look at SonarCloud analysis issue on this post?

Configuration details of “Prepare analysis on SonarCloud” info provided below.

Looks like issue was in the order of Sonar Cloud tasks on Azure pipelines.
All work as expected now.

1 Like

Could you please add more detail? What was wrong with the Sonar Cloud tasks’ order?
Thank you.

Basically, your prepare analysis should come before any other tests and coverage report tasks.

That’s what I have.
I needed to create the project in SonarCloud first, ans specify in Administration->Branches&Pull Requests which branches to work with prior to running the pipeline in Azure. Otherwise only the master branch gets analysed and its results published. Kudos to my colleague YL.

You could share the error or screen, if still experience an issue.