SonarQube analysis fails randomly in Azure DevOps on self-hosted agents

Hi team,

We are using SonarQube 8.5.0.37579 and using msbuild tasks on Azure DevOps.
It would seem that more and more we get random analysis failures with the below messaging

The SonarScanner for MSBuild integration failed: SonarQube was unable to collect the required information about your projects.
Possible causes:

  1. The project has not been built - the project must be built in between the begin and end steps
  2. An unsupported version of MSBuild has been used to build the project. Currently MSBuild 14.0.25420.1 and higher are supported.
  3. The begin, build and end steps have not all been launched from the same folder
  4. None of the analyzed projects have a valid ProjectGuid and you have not used a solution (.sln)
    12:41:55.794 The SonarScanner for MSBuild integration failed: SonarQube was unable to collect the required information about your projects.
    Possible causes:
  5. The project has not been built - the project must be built in between the begin and end steps
  6. An unsupported version of MSBuild has been used to build the project. Currently MSBuild 14.0.25420.1 and higher are supported.
  7. The begin, build and end steps have not all been launched from the same folder
  8. None of the analyzed projects have a valid ProjectGuid and you have not used a solution (.sln)
    12:41:55.794 Generation of the sonar-properties file failed. Unable to complete the analysis.

The build machines are the same exactly.
Also, we noticed that in the failed builds we have the following lines:

SonarQube.Integration.ImportBefore.targets does not exist at C:\Users\Azure_build\AppData\Local\Microsoft\MSBuild\Current\Microsoft.Common.targets\ImportBefore

Where in the successful ones:
Uninstalling target: C:\Users\Azure_build\AppData\Local\Microsoft\MSBuild\Current\Microsoft.Common.targets\ImportBefore\SonarQube.Integration.ImportBefore.targets

Thanks in advance.

Hi @LeathelBacon ,

Welcome to SonarSource Community! :sonarsource:

I believe you may be running concurrent analyses on the same build machine, so I suggest checking how your parallelism for builds may be set up. If you intend on concurrent analyses of MSBuild/.NET projects, please read Advanced Topics: Concurrent analyses on the same build machine.

More info here:

Joe