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 FAILUREERROR: 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:
- How to determine whether SonarCloud can access the pull request in Azure DevOps.
- Whether the project’s ALM binding or service connection needs to be refreshed.
- Whether any changes are required in the Azure DevOps pipeline or SonarCloud extension configuration.
- Whether there is a current workaround for this failure.
Thank you.