ERROR Could not find the pullrequest with key 'xxx'

Using Azure Devops Services, CPP project, Sonar-CLI 6.x

I can confirm it is not related to an expired SONAR token, as the same node (on prem) successfully went through the project analysis on the dev branch last night.
It works and reports successfully the SCA reports for dev and release\* branches.

But we I run a test PR (which forces the sonar analysis), it fails with the same error message, everytime.

The PR 7900 is a valid one, existing in Azure Devops.

Much appreciated.

Failing scan log:

11:50:57.727 INFO  Windows Server 2016 10.0 amd64
11:50:57.742 INFO  User cache: [***]\.sonar\cache
11:50:58.344 INFO  JRE provisioning: os[windows], arch[amd64]
11:50:59.173 INFO  Communicating with SonarCloud
11:50:59.635 INFO  Starting SonarScanner Engine...
11:50:59.635 INFO  Java 17.0.11 Eclipse Adoptium (64-bit)
11:51:00.512 INFO  Load global settings
11:51:00.927 INFO  Load global settings (done) | time=415ms
11:51:00.927 INFO  Server id: [***]
11:51:01.083 INFO  Loading required plugins
11:51:01.083 INFO  Load plugins index
11:51:01.154 INFO  Load plugins index (done) | time=71ms
11:51:01.154 INFO  Load/download plugins
11:51:01.186 INFO  Load/download plugins (done) | time=32ms
11:51:01.545 INFO  Found an active CI vendor: 'Azure DevOps'
11:51:01.561 INFO  Load project settings for component key: '[***]'
11:51:01.661 INFO  Load project settings for component key: '[***]' (done) | time=116ms
11:51:01.661 INFO  Process project properties
11:51:01.677 INFO  Project key: [***]
11:51:01.677 INFO  Base dir: [***]\_work\50\s
11:51:01.677 INFO  Working dir: [***]\_work\50\s\.scannerwork
11:51:01.677 INFO  Load project branches
11:51:01.786 INFO  Load project branches (done) | time=109ms
11:51:01.786 INFO  Check ALM binding of project '[***]'
11:51:01.869 INFO  Detected project binding: BOUND
11:51:01.870 INFO  Check ALM binding of project '[***]' (done) | time=83ms
11:51:01.871 INFO  Load project pull requests
11:51:01.945 INFO  Load project pull requests (done) | time=75ms
11:51:01.945 INFO  Load branch configuration
##[error]11:51:02.148 ERROR Could not find the pullrequest with key '7900'
11:51:02.148 ERROR Could not find the pullrequest with key '7900'
11:51:02.672 INFO  EXECUTION FAILURE
11:51:02.672 INFO  Total time: 5.023s

Hey there.

Have you configured a valid token at either the project-level Administration > General Settings > Pull Requests) or at the organiztion-level (Administration > Organization settings > Azure DevOps connectivity management)?

Colin

Thanks Colin,

There was indeed no token specified in the PR settings (which I wasn’t aware there was such input field), but even after the update, it still fails with the same error.

...
14:46:01.688 INFO  Load project pull requests
14:46:01.782 INFO  Load project pull requests (done) | time=94ms
14:46:01.782 INFO  Load branch configuration
##[error]14:46:02.000 ERROR Could not find the pullrequest with key '7900'
14:46:02.000 ERROR Could not find the pullrequest with key '7900'
14:46:02.519 INFO  EXECUTION FAILURE
14:46:02.519 INFO  Total time: 4.922s

Today I managed to make it work, I believe after setting the Provider and PAT fields in the project / admin / settings page, it went through the PR scan w/o any issue.

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