PRs on AzureDevOps not working anymore

Template for a good new topic, formatted with Markdown:

  • ALM used: Azure DevOps
  • CI system used: Azure DevOps
  • Scanner command used: - task: SonarCloudAnalyze@1
  • Languages of the repository: TypeScript
  • Error observed: ##[error]ERROR: Error during SonarScanner execution ERROR: Could not find the pullrequest with key '4838' ERROR: Caused by: Error 404 on https://sonarcloud.io/api/alm_integration/show_pullrequest?project=***masked project key***&pullrequestKey=4838 : {"errors":[{"msg":"Requested resource wasn\u0027t found on Azure DevOps.","reason":"AZURE_DEVOPS_UNABLE_TO_FETCH_REQUESTED_RESOURCE"}]} ERROR: ERROR: Re-run SonarScanner using the -X switch to enable full debug logging. ERROR: Error during SonarScanner execution ERROR: Could not find the pullrequest with key '4838' ERROR: Caused by: Error 404 on https://sonarcloud.io/api/alm_integration/show_pullrequest?project=***masked project key***&pullrequestKey=4838 : {"errors":[{"msg":"Requested resource wasn\u0027t found on Azure DevOps.","reason":"AZURE_DEVOPS_UNABLE_TO_FETCH_REQUESTED_RESOURCE"}]} 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.29.1/sonar-scanner/bin/sonar-scanner' failed with exit code 2
  • For around two weeks the PR check does not work anymore. Before that everything worked fine. New branches are still detected as usual.

Hey there.

It looks like the token being used to make the connection between SonarCloud and Azure DevOps is (no longer) valid. Take a look at your project-level Administration > Pull Requests or organization-level Administration > Organization settings > Azure DevOps connectivity management and make sure a valid token is set.

Thank you Colin, that was to problem! Someone in the organization who did not have access to our repo updated the access token and that’s why it did not work for us anymore.

Glad you sorted it out.

On my side I’ve passed along feedback internally that we could have a better error message (it was super clear from the backend what the issue was, I’m not sure why we don’t pass the info to the scanner logs)

1 Like

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