Sonar Cloud - no longer creating PRs - Azure DevOps

We have been using Sonarcloud trouble free for months - however today our PR builds are all failing across different repositories with the error below.

  • ALM used (Azure DevOps)

  • CI system used (Azure DevOps)

Looking at sonar cloud we are missing PRs from around 3 days ago – any new PRs we create are not being added to SonarCloud and therefore it fails with the error below.

this DevOps yaml is below – what do I need to change to add the -X switch?

      - task: SonarCloudPrepare@1
          SonarCloud: SonarCloud
          organization: $(SonarCloud_Organization)
          scannerMode: CLI
          projectKey: $(SonarCloud_ProjectKey)
          projectName: $(SonarCloud_ProjectName)

      - task: Npm@1
          command: "install"

      - task: SonarCloudAnalyze@1

      - task: Npm@1
        displayName: "npm run build"
          command: "custom"
          customCommand: "run build"
ERROR: Could not find the pullrequest with key '1077' 
ERROR: Caused by: Error 404 on : {"errors":[{"msg":"Unable to find the pullrequest with key \u00271077\u0027"}]} 
ERROR: Error during SonarScanner execution 
ERROR: Could not find the pullrequest with key '1077' 
ERROR: Caused by: Error 404 on 
ERROR: Re-run SonarScanner using the -X switch to enable full debug logging. 
##[error]The process '/home/vsts/work/_tasks/SonarCloudAnalyze_ce096e50-6155-4de8-8800-4221aaeed4a1/1.43.2/sonar-scanner/bin/sonar-scanner' failed with exit code 2 
Finishing: SonarCloudAnalyze```


Given your sudden failure, I think it quite likely that your Azure PAT expired.

Can you generate a new one and replace it in SonarCloud?


Hi Ann,

Thank you - that has resolved the issue.

However it should be raised as a bug. The error message should return a 401 (Unauthorized) not 404 “cannot find pull request”


I don’t disagree with you. And we do this because it’s “more secure”.


This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.