# Unable to find the pullrequest with key \`X\`

**URL:** <https://community.sonarsource.com/t/unable-to-find-the-pullrequest-with-key-x/69025>\
**Category:** SonarQube Cloud\
**Tags:** scanner\
**Created:** [August 1, 2022, 9:30am UTC](https://community.sonarsource.com/t/unable-to-find-the-pullrequest-with-key-x/69025 "2022-08-01T09:30:22Z")\
**Posts on this page:** 16\
**Page:** 1

<div class="post-metadata">

**Author:** ![Raka\_Adi\_Nugroho](https://dub1.discourse-cdn.com/sonarsource/user_avatar/community.sonarsource.com/raka_adi_nugroho/32/35673_2.png) [@Raka\_Adi\_Nugroho](https://community.sonarsource.com/u/Raka_Adi_Nugroho)\
**Post date:** [August 1, 2022, 9:30am UTC](https://community.sonarsource.com/t/unable-to-find-the-pullrequest-with-key-x/69025/1 "2022-08-01T09:30:22Z")

</div>

hi, i hve an issues when running scanner for `merge_requests`, but its running well when scan `master, development`

the error log like this

```auto
Caused by: Error 404 on [MASKED]/api/alm_integration/show_pullrequest?project=xyz&pullrequestKey=1263 : {"errors":[{"msg":"Unable to find the pullrequest with key \u00271263\u0027"}]}

```

---

<div class="post-metadata">

**Author:** ![ganncamp](https://dub1.discourse-cdn.com/sonarsource/user_avatar/community.sonarsource.com/ganncamp/32/1261_2.png) [@ganncamp](https://community.sonarsource.com/u/ganncamp)\
**Post date:** [August 1, 2022, 3:27pm UTC](https://community.sonarsource.com/t/unable-to-find-the-pullrequest-with-key-x/69025/2 "2022-08-01T15:27:17Z")

</div>

Hi,

Welcome to the community!

Does the PR number in the error message exist in GitLab?

&nbsp;  
Ann

---

<div class="post-metadata">

**Author:** ![Raka\_Adi\_Nugroho](https://dub1.discourse-cdn.com/sonarsource/user_avatar/community.sonarsource.com/raka_adi_nugroho/32/35673_2.png) [@Raka\_Adi\_Nugroho](https://community.sonarsource.com/u/Raka_Adi_Nugroho)\
**Post date:** [August 2, 2022, 1:13am UTC](https://community.sonarsource.com/t/unable-to-find-the-pullrequest-with-key-x/69025/3 "2022-08-02T01:13:24Z")

</div>

yaps, the PR its already on Gitlab.

But, When i to go to sonarCcloud UI → Pull Request, its empty state like this

 ![Screen Shot 2022-08-02 at 08.14.48](https://europe1.discourse-cdn.com/sonarsource/uploads/sonarcommunity/original/3X/7/1/71e6ce04e86a996407786bb96dc4fdca340953da.png)

---

<div class="post-metadata">

**Author:** ![ganncamp](https://dub1.discourse-cdn.com/sonarsource/user_avatar/community.sonarsource.com/ganncamp/32/1261_2.png) [@ganncamp](https://community.sonarsource.com/u/ganncamp)\
**Post date:** [August 2, 2022, 1:33pm UTC](https://community.sonarsource.com/t/unable-to-find-the-pullrequest-with-key-x/69025/4 "2022-08-02T13:33:16Z")

</div>

Hi,

Could you

- double check the auth token and make sure it hasn’t expired
- click on the GitLab icon in the UI and make sure that the PR exists in the repo you land in?

&nbsp;  
Ann

---

<div class="post-metadata">

**Author:** ![Raka\_Adi\_Nugroho](https://dub1.discourse-cdn.com/sonarsource/user_avatar/community.sonarsource.com/raka_adi_nugroho/32/35673_2.png) [@Raka\_Adi\_Nugroho](https://community.sonarsource.com/u/Raka_Adi_Nugroho)\
**Post date:** [August 3, 2022, 1:50am UTC](https://community.sonarsource.com/t/unable-to-find-the-pullrequest-with-key-x/69025/5 "2022-08-03T01:50:44Z")

</div>

it’s not expired i think, cause its running well for `master` and `development` branch. just issues for merge request.

the PR is exist

---

<div class="post-metadata">

**Author:** ![Raka\_Adi\_Nugroho](https://dub1.discourse-cdn.com/sonarsource/user_avatar/community.sonarsource.com/raka_adi_nugroho/32/35673_2.png) [@Raka\_Adi\_Nugroho](https://community.sonarsource.com/u/Raka_Adi_Nugroho)\
**Post date:** [August 4, 2022, 9:48am UTC](https://community.sonarsource.com/t/unable-to-find-the-pullrequest-with-key-x/69025/6 "2022-08-04T09:48:38Z")

</div>

any suggestion @ganncamp?

---

<div class="post-metadata">

**Author:** ![ganncamp](https://dub1.discourse-cdn.com/sonarsource/user_avatar/community.sonarsource.com/ganncamp/32/1261_2.png) [@ganncamp](https://community.sonarsource.com/u/ganncamp)\
**Post date:** [August 4, 2022, 2:31pm UTC](https://community.sonarsource.com/t/unable-to-find-the-pullrequest-with-key-x/69025/7 "2022-08-04T14:31:16Z")

</div>

Hi,

Can you click on the GitLab icon in the UI and make sure that the PR exists in the repo you land in?

&nbsp;  
Ann

---

<div class="post-metadata">

**Author:** ![Raka\_Adi\_Nugroho](https://dub1.discourse-cdn.com/sonarsource/user_avatar/community.sonarsource.com/raka_adi_nugroho/32/35673_2.png) [@Raka\_Adi\_Nugroho](https://community.sonarsource.com/u/Raka_Adi_Nugroho)\
**Post date:** [August 5, 2022, 12:36am UTC](https://community.sonarsource.com/t/unable-to-find-the-pullrequest-with-key-x/69025/8 "2022-08-05T00:36:59Z")

</div>

yap its exists in repo

---

<div class="post-metadata">

**Author:** ![ganncamp](https://dub1.discourse-cdn.com/sonarsource/user_avatar/community.sonarsource.com/ganncamp/32/1261_2.png) [@ganncamp](https://community.sonarsource.com/u/ganncamp)\
**Post date:** [August 8, 2022, 1:46pm UTC](https://community.sonarsource.com/t/unable-to-find-the-pullrequest-with-key-x/69025/9 "2022-08-08T13:46:27Z")

</div>

Hi,

We’ve checked the logs, and SonarCloud is getting a 404 for the merge request URL.

Can you double check the project id in the URL is the same as the one that shows up in your GitLab repo in the top of the UI?

Note also that GitLab will return a 404 for a valid URL if the person/account making the request doesn’t have permissions to access it. So this could be a question of the access token you’ve configured for SonarCloud to use. Can you try accessing that URL using the same token you’ve configured for SonarCloud to use?

&nbsp;  
Ann

---

<div class="post-metadata">

**Author:** ![Esfandiyar\_Talebi](https://dub1.discourse-cdn.com/sonarsource/user_avatar/community.sonarsource.com/esfandiyar_talebi/32/39795_2.png) [@Esfandiyar\_Talebi](https://community.sonarsource.com/u/Esfandiyar_Talebi)\
**Post date:** [December 5, 2022, 3:05pm UTC](https://community.sonarsource.com/t/unable-to-find-the-pullrequest-with-key-x/69025/11 "2022-12-05T15:05:14Z")

</div>

Hi,

I have exactly the same issue. I have integrated the gitlab-ci to run the sonar on merge-requests but it fails every time and I can see within the logs that MR can’t be found by SonarApi:

```auto
Caused by: Could not find the pullrequest with key '110'
Caused by: org.sonarqube.ws.client.HttpException: Error 404 on https://sonarcloud.io/api/alm_integration/show_pullrequest?project=parkhere_invoice-event-processor&pullrequestKey=110 : {"errors":[{"msg":"Unable to find the pullrequest with key \u0027110\u0027"}]}

```

When I check the dashboard, I see exactly the same screen as it’s posted by Raka\_Adi\_Nugroho .

Just to make sure, I created a MR manually and refreshed the UI and still the same.

I will appreciate your advice how to resolve this issue.

Thanks

---

<div class="post-metadata">

**Author:** ![Esfandiyar\_Talebi](https://dub1.discourse-cdn.com/sonarsource/user_avatar/community.sonarsource.com/esfandiyar_talebi/32/39795_2.png) [@Esfandiyar\_Talebi](https://community.sonarsource.com/u/Esfandiyar_Talebi)\
**Post date:** [December 8, 2022, 11:07am UTC](https://community.sonarsource.com/t/unable-to-find-the-pullrequest-with-key-x/69025/12 "2022-12-08T11:07:18Z")

</div>

Any advice for this issue? It’s a bit urgent for us. Thank you

---

<div class="post-metadata">

**Author:** ![TomMunich4](https://dub1.discourse-cdn.com/sonarsource/user_avatar/community.sonarsource.com/tommunich4/32/39893_2.png) [@TomMunich4](https://community.sonarsource.com/u/TomMunich4)\
**Post date:** [December 8, 2022, 11:08am UTC](https://community.sonarsource.com/t/unable-to-find-the-pullrequest-with-key-x/69025/13 "2022-12-08T11:08:09Z")

</div>

Who can help on this topic what @ Esfandiyar\_Talebi mentioned?

Thanks a lot

---

<div class="post-metadata">

**Author:** ![ganncamp](https://dub1.discourse-cdn.com/sonarsource/user_avatar/community.sonarsource.com/ganncamp/32/1261_2.png) [@ganncamp](https://community.sonarsource.com/u/ganncamp)\
**Post date:** [December 8, 2022, 12:07pm UTC](https://community.sonarsource.com/t/unable-to-find-the-pullrequest-with-key-x/69025/14 "2022-12-08T12:07:47Z")

</div>

Hi @Esfandiyar_Talebi & @TomMunich4,

When you “me too” on a thread that ends by asking the user to double-check some stuff without actually responding to the request… there’s not much to say on our side.

So, what is your response to this?

> [@ganncamp](#):
>
> Note also that GitLab will return a 404 for a valid URL if the person/account making the request doesn’t have permissions to access it. So this could be a question of the access token you’ve configured for SonarCloud to use. Can you try accessing that URL using the same token you’ve configured for SonarCloud to use?

&nbsp;  
Ann

---

<div class="post-metadata">

**Author:** ![Esfandiyar\_Talebi](https://dub1.discourse-cdn.com/sonarsource/user_avatar/community.sonarsource.com/esfandiyar_talebi/32/39795_2.png) [@Esfandiyar\_Talebi](https://community.sonarsource.com/u/Esfandiyar_Talebi)\
**Post date:** [December 8, 2022, 12:33pm UTC](https://community.sonarsource.com/t/unable-to-find-the-pullrequest-with-key-x/69025/15 "2022-12-08T12:33:25Z")

</div>

Hi Ann,

Thanks for your reply. I already checked the access token is set correctly. We actually can import a project from our gitlab repo to sonar dashboard without any issue and can run the code analysis and test coverage on those projects by manually running the gradle in local. This part works fine.

Now, we want to integrate the sonar with our gitlab CI/CD pipeline to run the sonar tasks on merge requests. The problem is when I create a MR in Gitlab for a specific project, the MR does not appear in our SonarCloud dashboard and that could be the reason why the pipeline also fails when I use the merge\_requests rule for my stage. The pipeline works fine if I don’t use “merge\_requests” rule.

I was wondering if we can somehow troubleshoot the integration of gitlab and sonarcould through some logs. I hope the above explanation helps.

Thanks  
Esfandiyar

---

<div class="post-metadata">

**Author:** ![ganncamp](https://dub1.discourse-cdn.com/sonarsource/user_avatar/community.sonarsource.com/ganncamp/32/1261_2.png) [@ganncamp](https://community.sonarsource.com/u/ganncamp)\
**Post date:** [December 8, 2022, 1:30pm UTC](https://community.sonarsource.com/t/unable-to-find-the-pullrequest-with-key-x/69025/16 "2022-12-08T13:30:32Z")

</div>

Hi Esfandiyar,

This deserves its own thread. With logs &etc.

&nbsp;  
Ann

---

<div class="post-metadata">

**Author:** ![atandel](https://avatars.discourse-cdn.com/v4/letter/a/e68b1a/32.png) [@atandel](https://community.sonarsource.com/u/atandel)\
**Post date:** [June 27, 2023, 11:00pm UTC](https://community.sonarsource.com/t/unable-to-find-the-pullrequest-with-key-x/69025/17 "2023-06-27T23:00:28Z")

</div>

I also bumped into similar error . We were not able to scan and analyze report for pull requests specifically.

We figured out that we have selected wrong project when adding a project. We have multiple projects with same name under different groups and that made it confusing to select .

Not sure if that applies to all but we were at the same status before we figured this out.

You can refer this topic if it helps you.

> [@Sonarcloud analysis fails to analyze reports for pull request](https://community.sonarsource.com/t/sonarcloud-analysis-fails-to-analyze-reports-for-pull-request/94771/2):
>
> We were able to resolve this issue. And I want to share it here so that it can be useful for others. We tried looking around for this error and figured out that we had added different project to sonarcloud which has same name in our different group under our organization. As shown in screenshot below, when we try to add a project to sonarcloud , we can see that under our organization , we have multiple projects with same name present . As there was no d…

Thanks
