SonarCloud Analysis Fail in Azure Devops PR Build with ERROR: Could not find the pullrequest with ke

Template for a good new topic, formatted with Markdown:

  • ALM used is Azure DevOps
  • CI system used is Azure DevOps
  • Source code repository is Bitbucket
  • Organization is setup with Bitbucket
  • Scanner command used when applicable
  • Languages of the repository is C#
  • Error observed
    ‘’‘ERROR: Could not find the pullrequest with key’‘’
  • Steps to reproduce:
    PR build pipeline triggered by new PR fails with above error.
  • Potential workaround
    Rerun pipeline manually with the feature branch for the PR and it works fine

Note: Works fine in another project. The only difference I can think of is that the other project was added first and it’s using Visual Studio for the build instead of dotnet.

Hi,

Welcome to the community!

Does PR #287 exist in your project in Bitbucket?

 
Ann

Yes it does.
2022-06-30_11-29-05

Can anyone help with this issue. We have other repos that work just fine and stuck as to why this is an issue for one repo. Any advice on how to troubleshoot this issue. Seems like a common issue with SonarCloud but not a single simple solution.

Hello,

We are currently investigating the issue and reproducing the error mentioned above. We will get back to you as soon as we resolve it.

Thank you

Peter

Has there been any progress on this issue? I still cannot create a PR analysis for this repo doing a dotnet build.

Hey @Kevin_Junghans , sorry for the late reply.

Maybe a dumb question here, what do you use to connect to SonarCloud ? Is your project correctly bound to bitbucket on SonarCloud as well ?

Thanks.

1 “what do you use to connect to SonarCloud?”
I do not understand this question. The full configuration is given in the beginning of this thread.

2 “Is your project correctly bound to bitbucket on SonarCloud as well ?”
Yes. As noted above I can generate an analysis report if I run the build manually. It’s just when the build is triggered through a new PR that it fails, and it fails when trying to find the PR. It is looking for the correct PR number, and that PR number is present, but it cannot find it.

@mickaelcaro Please see my response to your questions above.

Hi,

Thanks.

Can you try again analysing a PR with this project/pipeline please ? So that we can get the logs internally. Also, I will send you a PM so that you can give me the organization/project key.

Thanks in advance.

@mickaelcaro Sent you the requested information and ran analysis again. Still failing on finding the PR.

Issue is resolved : the SonarCloud project was bound and linked to an incorrect repository, that’s why the PullRequests were not found, after recreating a project and linked it to the correct one, it worked again.

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