hi, i hve an issues when running scanner for merge_requests, but its running well when scan master, development
the error log like this
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"}]}
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?
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:
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.
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.
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.
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.