Could not find the pullrequest with key when creating PR in Azure Devops

Template for a good new topic, formatted with Markdown:

  • ALM used Azure DevOps
  • CI system used Azure DevOps
  • Scanner command used when applicable (private details masked)
  • Languages of the repository: TypeScript
  • Error observed (wrap logs/code around with triple quotes ``` for proper formatting)

Can not find pull request when creating a pull request in Azure DevOps.

INFO: Load plugins index
INFO: Load plugins index (done) | time=1136ms
INFO: Load/download plugins (done) | time=22640ms
INFO: Loaded core extensions: developer-scanner
INFO: Found an active CI vendor: 'Azure DevOps'
INFO: Load project settings for component key: 'DPRGroupLtd_PremiumBank'
INFO: Load project settings for component key: 'DPRGroupLtd_PremiumBank' (done) | time=183ms
INFO: Process project properties
INFO: Execute project builders
INFO: Execute project builders (done) | time=2ms
INFO: Project key: DPRGroupLtd_PremiumBank
INFO: Base dir: /home/vsts/work/1/s
INFO: Working dir: /home/vsts/work/1/s/.scannerwork
INFO: Load project branches
INFO: Load project branches (done) | time=197ms
INFO: Check ALM binding of project 'DPRGroupLtd_PremiumBank'
INFO: Detected project binding: BOUND
INFO: Check ALM binding of project 'DPRGroupLtd_PremiumBank' (done) | time=195ms
INFO: Load project pull requests
INFO: Load project pull requests (done) | time=204ms
INFO: Load branch configuration
INFO: ------------------------------------------------------------------------
INFO: EXECUTION FAILURE
INFO: ------------------------------------------------------------------------
INFO: Total time: 29.717s
INFO: Final Memory: 20M/70M
INFO: ------------------------------------------------------------------------
##[error]ERROR: Error during SonarScanner execution
ERROR: Could not find the pullrequest with key '26762'
ERROR: Caused by: Error 404 on https://sonarcloud.io/api/alm_integration/show_pullrequest?project=DPRGroupLtd_PremiumBank&pullrequestKey=26762 : {"errors":[{"msg":"Unable to find the pullrequest with key \u002726762\u0027"}]}
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 '26762'
ERROR: Caused by: Error 404 on https://sonarcloud.io/api/alm_integration/show_pullrequest?project=DPRGroupLtd_PremiumBank&pullrequestKey=26762 : {"errors":[{"msg":"Unable to find the pullrequest with key \u002726762\u0027"}]}
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.40.0/sonar-scanner/bin/sonar-scanner' failed with exit code 2
Finishing: SonarCloudAnalyze
  • Steps to reproduce
  • Potential workaround

Do not share screenshots of logs – share the text itself (bonus points for being well-formatted)!

Hey there.

Was this working before?

Typicaly if this was working before and stops working, it means 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.

Thanks for the response.
It has never worked for this project but it has worked for other projects in the organisation. We have checked our tokens and they seem valid.

Thanks.

Is the SonarCloud project bound correctly to the right project – and you see PR #26762 when clicking into that repo from the binding?

Hi, the binding is there:
image

If I click the binding and then select “Pull Request” the PR 26762 is there
image

Thanks.

Can you raise a new pull request and, assuming the issue persists, let me know the pull request key (#28xxx)? I can take a look in the backend logs, but it will be tough to find #26762 as it was from a few weeks ago.

This seems to be working now (not sure how). Thanks for looking into it.

Let us know if it happens again!

Same issue here, the branch is not created when a PR is created. Please help

Hey Marc.

I suggest raising a new thread with more details – including answering the questions I was asking previously in this thread!

I will close this thread in the meantime.