Could not fetch analysis for ID

Template for a good new topic, formatted with Markdown:

  • ALM used (Azure DevOps)
  • CI system used (Azure DevOps)
  • Scanner command used when applicable (private details masked)
  • Languages of the repository
  • Only if the SonarCloud project is public, the URL
    • And if you need help with pull request decoration, then the URL to the PR too
  • Error observed (wrap logs/code around with triple quotes ``` for proper formatting)
  • Steps to reproduce
  • task: SonarCloudAnalyze@1
    INFO: ANALYSIS SUCCESSFUL, you can find the results at: https://sonarcloud.io/dashboard?id=xxxxxxxxxxx&pullRequest=110462
    INFO: Note that you will be able to access the updated dashboard once the server has processed the submitted analysis report
    INFO: More about the report processing at https://sonarcloud.io/api/ce/task?id=AYhQ0NVedJmV0pSyEqbN
    INFO: Analysis total time: 15.162 s
    INFO: ------------------------------------------------------------------------
    INFO: EXECUTION SUCCESS
    INFO: ------------------------------------------------------------------------
    INFO: Total time: 40.995s
    INFO: Final Memory: 40M/137M
    INFO: ------------------------------------------------------------------------
    The SonarScanner CLI has finished
    02:50:43.957 Post-processing succeeded.

  • task: SonarCloudPublish@1
    ##[error][SQ] Error retrieving analysis: [SQ] API GET ‘/api/qualitygates/project_status’ failed, status code was: 404
    ##[error][SQ] Could not fetch analysis for ID ‘AYhQ0NbEwGX4EvKj39Qh’

  • Potential workaround

Do not share screenshots of logs – share the text itself (bonus points for being well-formatted)!

Hey there.

Are you sure that the SonarCloud token in your Azure DevOps Service Connection (referenced in your pipeline) is valid?

Judging by the fact I can browse https://sonarcloud.io/api/ce/task?id=AYhQ0NVedJmV0pSyEqbN directly (unauthenticated) means you have set Execute Analysis permissions to Anyone – but the project_status API requires Browse permissions as well.