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
        inputs:
          SonarCloud: SonarCloud
          organization: $(SonarCloud_Organization)
          scannerMode: CLI
          projectKey: $(SonarCloud_ProjectKey)
          projectName: $(SonarCloud_ProjectName)

      - task: Npm@1
        inputs:
          command: "install"

      - task: SonarCloudAnalyze@1

      - task: Npm@1
        displayName: "npm run build"
        inputs:
          command: "custom"
          customCommand: "run build"
ERROR: Could not find the pullrequest with key '1077' 
ERROR: Caused by: Error 404 on https://sonarcloud.io/api/alm_integration/show_pullrequest?project=&pullrequestKey=1077 : {"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]ERROR: 
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```

Hi,

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?

 
Ann

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”

Hi,

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

 
Ann

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