SonarCloud error "The last analysis has failed" after successful Azure DevOps "Run Code Analysis"

When are trying to integrate SonarCloud with Azure DevOps and we have the following build steps:

  1. Prepare analysis on SonarCloud
  2. Build solution ***.sln
  3. Run Code Analysis

Step 3 is running correctly and i can see the following at the end of the log:

_2019-02-07T07:13:29.7391713Z WARNING: WARN: This may lead to missing/broken features in SonarQube_
_2019-02-07T07:13:30.2262900Z INFO: 548 files had no CPD blocks_
_2019-02-07T07:13:30.2263310Z INFO: Calculating CPD for 2780 files_
_2019-02-07T07:13:30.4388404Z WARNING: WARN: Too many duplication groups on file example1.cshtml. Keep only the first 100 groups._
_2019-02-07T07:13:30.8109726Z WARNING: WARN: Too many duplication groups on file example2.cshtml. Keep only the first 100 groups._
_2019-02-07T07:13:31.2472354Z WARNING: WARN: Too many duplication groups on file example3.cshtml. Keep only the first 100 groups._
_2019-02-07T07:13:31.8958326Z INFO: CPD calculation finished_
_2019-02-07T07:13:37.4386054Z INFO: Analysis report generated in 4943ms, dir size=51 MB_
_2019-02-07T07:13:45.1862721Z INFO: Analysis report compressed in 7760ms, zip size=15 MB_
_2019-02-07T07:14:17.2315551Z INFO: Analysis report uploaded in 32040ms_
_2019-02-07T07:14:17.2702299Z INFO: ANALYSIS SUCCESSFUL, you can browse
_2019-02-07T07:14:17.2702485Z INFO: Note that you will be able to access the updated dashboard once the server has processed the submitted analysis report_
_2019-02-07T07:14:17.2702664Z INFO: More about the report processing at
_2019-02-07T07:14:21.4323901Z INFO: Analysis total time: 5:21.458 s_
_2019-02-07T07:14:22.0812734Z INFO: ------------------------------------------------------------------------_
_2019-02-07T07:14:22.0812990Z INFO: EXECUTION SUCCESS_
_2019-02-07T07:14:22.0813090Z INFO: ------------------------------------------------------------------------_
_2019-02-07T07:14:22.0813199Z INFO: Total time: 6:31.141s_
_2019-02-07T07:14:22.2693766Z INFO: Final Memory: 39M/541M_
_2019-02-07T07:14:22.2693944Z INFO: ------------------------------------------------------------------------_
_2019-02-07T07:14:22.4637040Z The SonarQube Scanner has finished_
_2019-02-07T07:14:22.4753893Z 07:14:22.456  Creating a summary markdown file..._
_2019-02-07T07:14:22.4754325Z 07:14:22.471  Analysis results:
_2019-02-07T07:14:22.4754434Z 07:14:22.471  Post-processing succeeded._
_2019-02-07T07:14:22.5106733Z ##[section]Finishing: Run Code Analysis_

I have tried to look in SonarCloud for information why this has failed but it is hard to get logs for what we’d normally see in SonarQube.

Any ideas or suggestions for how we can diagnose what happens on the SonarCloud side?

Thanks. Adam

What makes you think that the analysis has failed? From what I see in the logs, everything looks good.

Hi Fabrice. When you say “from what i see in the logs, everything is ok”. Do you mean the log snippet i provided from Azure DevOps job? Or have you been able to take a look on the SonarCloud side?

The reason for believing it failed is that:

  • We don’t see the message in a red bar for the project in the portal “The last analysis has failed.”
  • Also looking at the specific branch, we see the error “The last analysis on this project (undefined) failed.”
  • We only see the an older build version and not the latest
  • No metrics update

Yes, the log you copy-pasted on your question: there is no error (only some warnings) and the result is: INFO: EXECUTION SUCCESS.

I guess you mean “we see the message in a red bar”, right? And in that case, when you go to the project “Administration > Background Tasks” page, what exact message do you get when you click on "Show Error Details":