Pull request pipeline in azure devops throws error

Hello,

For our project running on azure devops we are struggling getting the pull request decoration to work.

We configured a pipeline that analyses the code and normally this pipeline runs fine. However when running after a pull request the pipeline threw an error at the SonarCloudAnalyse step:

ERROR: Could not find the pullrequest with key '5732'
ERROR: Caused by: Error 404 on https://sonarcloud.io/api/alm_integration/show_pullrequest?project=ponsitecore_pon.pccm.20.configurator&pullrequestKey=5732 : {"errors":[{"msg":"Requested resource wasn\u0027t found on Azure DevOps.","reason":"AZURE_DEVOPS_UNABLE_TO_FETCH_REQUESTED_RESOURCE"}]}

Looking at the documentation everything should be configured correctly. The personal access token was created using “Code Read and Write” scope and is added to sonarcloud in administration/general settings/pull request section (note the provider is also set correctly to Azure Devops Services). Reinstalling sonarcloud azure devops plugin and recreating personal access token does not solve the problem.

We would greatly appreciate any help on this problem as we are currently stuck.

Hi,

Welcome to the community!

Cool. Thanks for answering that up front. It’s typically my first question since sometimes 404s are the “secure” version of a 401 (Unauthorized).

Can you verify that PR 5732 actually exists in the project?

 
Ann

Hi Ann,

Thx for your response! Great to be part of the sonarcloud community. Such a great tool!

We managed to solve this issue by deleting the sonarcloud project and than add it again. For what went wrong we are not sure. The first analysis of the code base was done in a feature branch, maybe that was the culprit.

Marcel

1 Like