Error during SonarScanner execution

Hello,

Since last week, our Azure DevOps build pipeline has started failing during the SonarCloud analysis step, but only when the pipeline is triggered by a pull request.

Regular branch builds continue to complete successfully across all branches. Pull request validation builds fail during SonarCloudAnalyze, after the scanner has successfully connected to SonarCloud and confirmed that the project is bound to Azure DevOps.

INFO: Analyzing on SonarCloud
INFO: Found an active CI vendor: ‘Azure DevOps’
INFO: Check ALM binding of project
INFO: Detected project binding: BOUND
INFO: Load branch configuration
INFO: EXECUTION FAILURE

ERROR: Could not find the pullrequest with key ‘[redacted]’
ERROR: Caused by: Error 404 on
https://sonarcloud.io/api/alm_integration/show_pullrequest
{“errors”:[{“msg”:“You don’t have permission, or the provided pullrequest with key ‘[redacted]’ doesn’t exist.”}]}

ERROR: The SonarScanner did not complete successfully
ERROR: Post-processing failed. Exit code: 1

The failure occurs while loading the branch configuration, before analysis is uploaded. The same project and pipeline configuration work successfully for normal branch builds.

Could this indicate an issue with the SonarCloud/Azure DevOps ALM integration, pull request visibility, or pull request metadata being supplied by Azure DevOps? Has there been a recent change affecting pull request analysis?

We would appreciate guidance on:

  1. How to determine whether SonarCloud can access the pull request in Azure DevOps.
  2. Whether the project’s ALM binding or service connection needs to be refreshed.
  3. Whether any changes are required in the Azure DevOps pipeline or SonarCloud extension configuration.
  4. Whether there is a current workaround for this failure.

Thank you.

Dear Andy,

I do not know if this will help, since it is a complety different scenario, but I also had problems with pull requests a long ago Cannot analyze pull requests in bound projects between SonarCloud and Bitbucket Cloud - #11 by mvillanueva

Does the error rises with not bound projects?

Sorry if I am completly off-topic

Best regards.