# Could not find the pullrequest with key '1098'

**URL:** <https://community.sonarsource.com/t/could-not-find-the-pullrequest-with-key-1098/53660>\
**Category:** SonarQube Cloud\
**Tags:** azuredevops-services, dotnet, sonarqube-cloud\
**Created:** [November 23, 2021, 6:20pm UTC](https://community.sonarsource.com/t/could-not-find-the-pullrequest-with-key-1098/53660 "2021-11-23T18:20:45Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![tkachuk2222](https://avatars.discourse-cdn.com/v4/letter/t/a587f6/32.png) [@tkachuk2222](https://community.sonarsource.com/u/tkachuk2222)\
**Post date:** [November 23, 2021, 6:20pm UTC](https://community.sonarsource.com/t/could-not-find-the-pullrequest-with-key-1098/53660/1 "2021-11-23T18:20:45Z")

</div>

- ALM used - Azure DevOps
- CI system used - Azure DevOps
- Scanner command used when applicable - private
- Languages of the repository - .NET 5.0

```auto
##[error]ERROR: Error during SonarScanner execution
ERROR: Error during SonarScanner execution
##[error]ERROR: Could not find the pullrequest with key '1098'
ERROR: Caused by: Error 404 on https://sonarcloud.io/api/alm_integration/show_pullrequest?project= ******** &pullrequestKey=1098 : {"errors":[{"msg":"Requested resource wasn\u0027t found on Azure DevOps.","reason":"AZURE_DEVOPS_UNABLE_TO_FETCH_REQUESTED_RESOURCE"}]}
ERROR:
ERROR: Could not find the pullrequest with key '1098'
ERROR: Caused by: Error 404 on https://sonarcloud.io/api/alm_integration/show_pullrequest?project= ************ &pullrequestKey=1098 : {"errors":[{"msg":"Requested resource wasn\u0027t found on Azure DevOps.","reason":"AZURE_DEVOPS_UNABLE_TO_FETCH_REQUESTED_RESOURCE"}]}
ERROR: 
##[error]The SonarScanner did not complete successfully
The SonarScanner did not complete successfully
##[error]17:38:52.568 Post-processing failed. Exit code: 1
17:38:52.568 Post-processing failed. Exit code: 1
##[error]The process 'D:\a\_tasks\SonarCloudPrepare_{some_GUID_here}\1.22.0\classic-sonar-scanner-msbuild\SonarScanner.MSBuild.exe' failed with exit code 1
Finishing: Run Code Analysis

```

I trying to integrate PR analysis. Simple branch analysis works fine.  
For configuring PR integration I’ve used next tutorial: `https://azuredevopslabs.com/labs/vstsextend/sonarcloud/`

---

<div class="post-metadata">

**Author:** ![Colin](https://dub1.discourse-cdn.com/sonarsource/user_avatar/community.sonarsource.com/colin/32/55255_2.png) [@Colin](https://community.sonarsource.com/u/Colin)\
**Post date:** [November 26, 2021, 1:12pm UTC](https://community.sonarsource.com/t/could-not-find-the-pullrequest-with-key-1098/53660/2 "2021-11-26T13:12:34Z")

</div>

Hey there.

Thanks for reaching out to us on this.

- Are other projects in your organization affected, or just this one (or is this the first project you’ve tried activating PR analysis for?)
- Please have an organization administrator check the status of your Azure DevOps PAT configured under organization-level **Administration \> Organization settings \> Azure DevOps connectivity management**

 ![Screenshot 2021-11-26 at 14.11.34](https://europe1.discourse-cdn.com/sonarsource/uploads/sonarcommunity/original/3X/2/f/2f26771f1cab2ff6330781cd81165034cbb8adab.png)

Finally, can you check your scanner logs and report what logs you find around whether or not your project is bound?

```auto
2021-11-24T15:08:41.5819599Z INFO: Check ALM binding of project 'xxxxxxx'
2021-11-24T15:08:41.7529949Z INFO: Detected project binding: BOUND
2021-11-24T15:08:41.7531176Z INFO: Check ALM binding of project 'xxxxxxxx' (done) | time=170ms

```

---

<div class="post-metadata">

**Author:** ![tkachuk2222](https://avatars.discourse-cdn.com/v4/letter/t/a587f6/32.png) [@tkachuk2222](https://community.sonarsource.com/u/tkachuk2222)\
**Post date:** [December 6, 2021, 11:57am UTC](https://community.sonarsource.com/t/could-not-find-the-pullrequest-with-key-1098/53660/3 "2021-12-06T11:57:57Z")

</div>

> [@Colin](#):
>
> Finally, can you check your scanner logs and report what logs you find around whether or not your project is bound?

1. It’s the first project I’ve tried to activate PR analysis
2. token is valid  
 ![image](https://europe1.discourse-cdn.com/sonarsource/uploads/sonarcommunity/original/3X/1/b/1b3ce2300d4707e14e9d1af14cc7bbaa890163eb.png)

 ![image](https://europe1.discourse-cdn.com/sonarsource/uploads/sonarcommunity/original/3X/0/2/02b77380ed365bd0a9942850dbf3202a715e251c.png)

---

<div class="post-metadata">

**Author:** ![Colin](https://dub1.discourse-cdn.com/sonarsource/user_avatar/community.sonarsource.com/colin/32/55255_2.png) [@Colin](https://community.sonarsource.com/u/Colin)\
**Post date:** [December 7, 2021, 3:48pm UTC](https://community.sonarsource.com/t/could-not-find-the-pullrequest-with-key-1098/53660/4 "2021-12-07T15:48:55Z")

</div>

Hey there.

Have you made sure to use the private key? Is it possible you are trying to run this pipeline, not on the precise same repository the project was provisioned for?

We recently were able to track down an issue for a user here:

> [@404 error on pull requests](https://community.sonarsource.com/t/404-error-on-pull-requests/54250/3):
>
> Working with @akinm we realized that the wrong project key was being used – the result of having two repositories in separate Azure DevOps projects (in the same organization) with the same name. Once the right project key was used, the issue was resolved.

The pipeline must be run on precisely the same repository as the project is bound to.

 ![Screenshot 2021-12-07 at 16.47.54](https://europe1.discourse-cdn.com/sonarsource/uploads/sonarcommunity/original/3X/0/7/07c87ea4738bc00b41c41d75b9f503a2774f78ad.png)

---

<div class="post-metadata">

**Author:** ![tkachuk2222](https://avatars.discourse-cdn.com/v4/letter/t/a587f6/32.png) [@tkachuk2222](https://community.sonarsource.com/u/tkachuk2222)\
**Post date:** [December 8, 2021, 9:44am UTC](https://community.sonarsource.com/t/could-not-find-the-pullrequest-with-key-1098/53660/5 "2021-12-08T09:44:36Z")

</div>

the private key is correct because I can run the same pipeline manually and it would succeed. only with PRs failed ☹ don’t understand why…

---

<div class="post-metadata">

**Author:** ![Colin](https://dub1.discourse-cdn.com/sonarsource/user_avatar/community.sonarsource.com/colin/32/55255_2.png) [@Colin](https://community.sonarsource.com/u/Colin)\
**Post date:** [December 9, 2021, 2:13pm UTC](https://community.sonarsource.com/t/could-not-find-the-pullrequest-with-key-1098/53660/6 "2021-12-09T14:13:44Z")

</div>

I’ll send you a private message @tkachuk2222

---

<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, 10:00am UTC](https://community.sonarsource.com/t/could-not-find-the-pullrequest-with-key-1098/53660/7 "2022-08-04T10:00:36Z")

</div>

i hve same issues @Colin

---

<div class="post-metadata">

**Author:** ![Philip\_Trevino](https://dub1.discourse-cdn.com/sonarsource/user_avatar/community.sonarsource.com/philip_trevino/32/45410_2.png) [@Philip\_Trevino](https://community.sonarsource.com/u/Philip_Trevino)\
**Post date:** [May 24, 2023, 4:13pm UTC](https://community.sonarsource.com/t/could-not-find-the-pullrequest-with-key-1098/53660/8 "2023-05-24T16:13:03Z")

</div>

I’m experiencing the same issue. This worked in the past, but has stopped working recently.

---

<div class="post-metadata">

**Author:** ![Philip\_Trevino](https://dub1.discourse-cdn.com/sonarsource/user_avatar/community.sonarsource.com/philip_trevino/32/45410_2.png) [@Philip\_Trevino](https://community.sonarsource.com/u/Philip_Trevino)\
**Post date:** [May 24, 2023, 4:26pm UTC](https://community.sonarsource.com/t/could-not-find-the-pullrequest-with-key-1098/53660/9 "2023-05-24T16:26:48Z")

</div>

Nevermind. The PAT for the project was fine, but the one on the organization level had expired. Hope that helps someone!
