Could not find the pullrequest with key '1098'

  • ALM used - Azure DevOps
  • CI system used - Azure DevOps
  • Scanner command used when applicable - private
  • Languages of the repository - .NET 5.0
##[error]ERROR: Error during SonarScanner execution
ERROR: Error during SonarScanner execution
##[error]ERROR: Could not find the pullrequest with key '1098'
ERROR: Caused by: Error 404 on https://sonarcloud.io/api/alm_integration/show_pullrequest?project=********&pullrequestKey=1098 : {"errors":[{"msg":"Requested resource wasn\u0027t found on Azure DevOps.","reason":"AZURE_DEVOPS_UNABLE_TO_FETCH_REQUESTED_RESOURCE"}]}
ERROR:
ERROR: Could not find the pullrequest with key '1098'
ERROR: Caused by: Error 404 on https://sonarcloud.io/api/alm_integration/show_pullrequest?project=************&pullrequestKey=1098 : {"errors":[{"msg":"Requested resource wasn\u0027t found on Azure DevOps.","reason":"AZURE_DEVOPS_UNABLE_TO_FETCH_REQUESTED_RESOURCE"}]}
ERROR: 
##[error]The SonarScanner did not complete successfully
The SonarScanner did not complete successfully
##[error]17:38:52.568  Post-processing failed. Exit code: 1
17:38:52.568  Post-processing failed. Exit code: 1
##[error]The process 'D:\a\_tasks\SonarCloudPrepare_{some_GUID_here}\1.22.0\classic-sonar-scanner-msbuild\SonarScanner.MSBuild.exe' failed with exit code 1
Finishing: Run Code Analysis

I trying to integrate PR analysis. Simple branch analysis works fine.
For configuring PR integration I’ve used next tutorial: https://azuredevopslabs.com/labs/vstsextend/sonarcloud/

Hey there.

Thanks for reaching out to us on this.

  • Are other projects in your organization affected, or just this one (or is this the first project you’ve tried activating PR analysis for?)
  • Please have an organization administrator check the status of your Azure DevOps PAT configured under organization-level Administration > Organization settings > Azure DevOps connectivity management

Finally, can you check your scanner logs and report what logs you find around whether or not your project is bound?

2021-11-24T15:08:41.5819599Z INFO: Check ALM binding of project 'xxxxxxx'
2021-11-24T15:08:41.7529949Z INFO: Detected project binding: BOUND
2021-11-24T15:08:41.7531176Z INFO: Check ALM binding of project 'xxxxxxxx' (done) | time=170ms
  1. It’s the first project I’ve tried to activate PR analysis
  2. token is valid

Hey there.

Have you made sure to use the private key? Is it possible you are trying to run this pipeline, not on the precise same repository the project was provisioned for?

We recently were able to track down an issue for a user here:

The pipeline must be run on precisely the same repository as the project is bound to.

the private key is correct because I can run the same pipeline manually and it would succeed. only with PRs failed :frowning_face: don’t understand why…