We’ve been encountering an issue with one of our build pipelines in Azure DevOps.
The pipeline has 2 Agent Jobs, the first builds our web application and the second builds our Database Red Gate Change Automation 3 project. They jobs are configured to not use parallelism.
The first job executes successfully, this pipeline has SonarQube configured for analysis and by the end of this job, the analysis report is uploaded to our locally hosted SonarQube install.
The second job intermittently fails and we’re noticing when it does fail a SonarQube occurs in the log which appears to be causing the database project build to fail.
Here’s a screenshot (I’ve temporarily disabled the SonarQube steps to bypass the issue):
When the build fails:
We see the following in the error log for the second agent job:
##[debug] Message: Current MSBuildToolsVersion: 4.0
##[debug] Message: Current MSBuildAssemblyVersion: 15.0
##[debug] MSBuild: Using “Error” task from assembly “Microsoft.Build.Tasks.v4.0, Version=126.96.36.199, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a”.
##[warning] Error: ERROR C:\agent_work\67.sonarqube\bin\targets\SonarQube.Integration.targets(148,5): SonarQube analysis is only supported with MSBuild 14 or later.
##[debug]Processed: ##vso[task.logissue type=warning] Error: ERROR C:\agent_work\67.sonarqube\bin\targets\SonarQube.Integration.targets(148,5): SonarQube analysis is only supported with MSBuild 14 or later.
##[debug] : Target “_CleanGetCurrentAndPriorFileWrites” skipped. Previously built successfully.
##[debug]Done building project “Intelligence.sqlproj” – FAILED.
Should SonarQube be analyzing during the build phase of the 2nd agent job?
According to the logs it’s using SonarScanner for MSBuild 4.6.2.