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

**URL:** <https://community.sonarsource.com/t/error-could-not-find-the-pullrequest-with-key-6/61410>\
**Category:** SonarQube Cloud\
**Tags:** scanner, sonarqube-cloud, coverage, java\
**Created:** [April 8, 2022, 9:57pm UTC](https://community.sonarsource.com/t/error-could-not-find-the-pullrequest-with-key-6/61410 "2022-04-08T21:57:21Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Warfront1](https://dub1.discourse-cdn.com/sonarsource/user_avatar/community.sonarsource.com/warfront1/32/32302_2.png) [@Warfront1](https://community.sonarsource.com/u/Warfront1)\
**Post date:** [April 8, 2022, 9:57pm UTC](https://community.sonarsource.com/t/error-could-not-find-the-pullrequest-with-key-6/61410/1 "2022-04-08T21:57:21Z")

</div>

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](https://github.com/REDACTED/REDACTED/pull/6)

I did see another another SonarCloud user with a similar [issue](https://community.sonarsource.com/t/could-not-find-the-pullrequest-with-key-69/29939/12) .  
We checked and it would appear that the sonarcloud app has access to all of our repositories on github.

 ![image](https://europe1.discourse-cdn.com/sonarsource/uploads/sonarcommunity/original/3X/6/b/6b9561fe48475fa5de718ef4e616c1aa3fc89f16.png)

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](https://circleci.com/developer/machine/image/ubuntu-2004))

Logs:  
[REDACTED\_Logs.txt](https://community.sonarsource.com/uploads/short-url/h9A4E1YmQAeRY6wvGvTxg6auDSd.txt) (2.5 KB)

---

<div class="post-metadata">

**Author:** ![Warfront1](https://dub1.discourse-cdn.com/sonarsource/user_avatar/community.sonarsource.com/warfront1/32/32302_2.png) [@Warfront1](https://community.sonarsource.com/u/Warfront1)\
**Post date:** [April 12, 2022, 4:15pm UTC](https://community.sonarsource.com/t/error-could-not-find-the-pullrequest-with-key-6/61410/2 "2022-04-12T16:15:28Z")

</div>

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

```auto
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

```

---

<div class="post-metadata">

**Author:** ![Marcin\_Majewski](https://dub1.discourse-cdn.com/sonarsource/user_avatar/community.sonarsource.com/marcin_majewski/32/15358_2.png) [@Marcin\_Majewski](https://community.sonarsource.com/u/Marcin_Majewski)\
**Post date:** [April 14, 2022, 3:19pm UTC](https://community.sonarsource.com/t/error-could-not-find-the-pullrequest-with-key-6/61410/7 "2022-04-14T15:19:52Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Marcin\_Majewski](https://dub1.discourse-cdn.com/sonarsource/user_avatar/community.sonarsource.com/marcin_majewski/32/15358_2.png) [@Marcin\_Majewski](https://community.sonarsource.com/u/Marcin_Majewski)\
**Post date:** [August 10, 2022, 3:40pm UTC](https://community.sonarsource.com/t/error-could-not-find-the-pullrequest-with-key-6/61410/11 "2022-08-10T15:40:44Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![system](https://dub1.discourse-cdn.com/sonarsource/user_avatar/community.sonarsource.com/system/32/31083_2.png) [@system](https://community.sonarsource.com/u/system)\
**Post date:** [August 17, 2022, 3:41pm UTC](https://community.sonarsource.com/t/error-could-not-find-the-pullrequest-with-key-6/61410/12 "2022-08-17T15:41:29Z")

</div>

Closed on August 17, 2022, 3:41pm UTC

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