Could not find the pullrequest with key yy

  • ALM used: Azure DevOps
  • CI system used: Azure DevOps
  • Languages of the repository: Javascript, React

Error when running SonarCloud on Pull Requests. Works fine with main branch. Used to work until last week and stopped with no apparent reason.

Token is active and NOT expired.
We did not change any permissions

##[error]ERROR: Error during SonarScanner execution
ERROR: Error during SonarScanner execution
##[error]ERROR: Could not find the pullrequest with key '323'
ERROR: Could not find the pullrequest with key '323'
##[error]ERROR: Caused by: Error 404 on https://sonarcloud.io/api/alm_integration/show_pullrequest?project=XXX_YYY&pullrequestKey=323 : {"errors":[{"msg":"Unable to find the pullrequest with key \u0027323\u0027"}]}
ERROR:
ERROR: Caused by: Error 404 on https://sonarcloud.io/api/alm_integration/show_pullrequest?project=XXX_YYY&pullrequestKey=323 : {"errors":[{"msg":"Unable to find the pullrequest with key \u0027323\u0027"}]}
ERROR: 
##[error]ERROR: Re-run SonarScanner using the -X switch to enable full debug logging.
ERROR: Re-run SonarScanner using the -X switch to enable full debug logging.
##[error]The process 'D:\a\_tasks\SonarCloudAnalyze_ce096e50-6155-4de8-8800-4221aaeed4a1\1.43.2\sonar-scanner\bin\sonar-scanner.bat' failed with exit code 1

Hey there.

Have you checked to see if you’ve set a token at the project-level as well? (Project-level Administration > Pull Requests > Integration with Azure DevOps Services > Personal access token).

SonarCloud will use what’s set at the project-level if something is set. Perhaps you only verified the global, org-level token (global Administration > Organization settings)

Hi, thanks for answering.

It was the PAT on organization settings of SonarCloud.

I still don’t understand how the PAT was lost since the main branch was still working and the PRs from last week were still working.

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