ERROR: Could not find the pullrequest with key '6'

Branch analysis is working great; coverage, smells, everything perfectly.
Only when I create a pull request, and make a new commit does this error occur.
100% of them time, when creating a new pull request, and adding a commit on top.
Also the pull request is valid, if I go to github pull request 6 is right there:
https://github.com/REDACTED/REDACTED/pull/6

I did see another another SonarCloud user with a similar issue .
We checked and it would appear that the sonarcloud app has access to all of our repositories on github.

The only thing that seemed material was… the other sonarcloud user with an issue was using a private repo, where as ours was an internal repo. Perhaps Sonar doesn’t work with internal repositories yet?

Using: sonar-scanner-4.7.0.2747-linux
On: ubuntu-2004 (circle/ci prebuilt image)

Logs:
REDACTED_Logs.txt (2.5 KB)

Key Portion of the Log Output (full logs provided above):

INFO: Load project pull requests (done) | time=112ms
INFO: Load branch configuration
INFO: Auto-configuring pull request 6
INFO: ------------------------------------------------------------------------
INFO: EXECUTION FAILURE
INFO: ------------------------------------------------------------------------
INFO: Total time: 35.252s
INFO: Final Memory: 19M/70M
INFO: ------------------------------------------------------------------------
ERROR: Error during SonarScanner execution
ERROR: Could not find the pullrequest with key '6'
ERROR: Caused by: Error 404 on https://sonarcloud.io/api/alm_integration/show_pullrequest?project=REDACTED&pullrequestKey=6

Hello @Warfront1,

Sonar scanner is doing a call to GitHub API to verify that the pull request that you provided in the properties exists, it appears there is some issue with this call.

To investigate further, I will start a private thread where you can share, your project key, organization key.

Best,
Marcin

Solved in a private thread. The reason for the error was using the wrong project key during the scan.

1 Like

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