-
-
Notifications
You must be signed in to change notification settings - Fork 520
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Please don't block the flow(just ignore the PR which missing the pull_request_binary). #759
Comments
The error you're hitting indicates that a pull request is recorded in the database, but that it has no data recorded against it. This is definitely invalid (you have a pull request with no source branch) so I'd need you to provide more information about what the data in the database looks like, and also any other information you can think of (i.e. is this a new project that auto-created in an invalid state or one that has existed with working branches and PRs until now, is this only impacting one project are multiple ones, do you actively do anything like deleting PRs or branches from Sonarqube etc). I don't think that removing that check is necessarily the right direction to go in since it's highlighting that something elsewhere in this plugin - or in your wider Sonarqube instance - is generating invalid data, and this could lead to further issues for you elsewhere. |
Closing as not-planned given there's no replication steps on this, and the check if there to prevent Sonarqube doing things that may further damage a project that already contains invalid data. |
We encountered the same issue and realized the root cause was the specific rows of table Deleting these rows fixed the issue. |
This issue occurs randomly with a CI client trying to retrieve the pull request data, just after the pull request analysis end. On the CI side, the client executes the following steps:
The last step sometime fails with an error 500, most of the time succeeds. I'd say 5% of failures. Logs of the client side:14:17:21 Waiting PT5S before re-checking SonarQube task 'AYthnVLGZBhuWkO_RLa4' status ...
14:17:26 SonarQube task 'AYthnVLGZBhuWkO_RLa4' is in progress.
14:17:26 Waiting PT5S before re-checking SonarQube task 'AYthnVLGZBhuWkO_RLa4' status ...
14:17:31 SonarQube task 'AYthnVLGZBhuWkO_RLa4' completed.
Error when executing always post condition:
Also: org.jenkinsci.plugins.workflow.actions.ErrorAction$ErrorId: 462f1912-524b-40d4-a8c9-d2412ffc2e7b
me.redaalaoui.org.sonarqube.ws.client.HttpException: Error 500 on https://sonarqube.acme.dev/api/project_pull_requests/list?project=com.acme.project%3Aproject : {"errors":[{"msg":"An error has occurred. Please contact your administrator"}]}
at me.redaalaoui.org.sonarqube.ws.client.BaseResponse.failIfNotSuccessful(BaseResponse.java:36)
at me.redaalaoui.org.sonarqube.ws.client.BaseService.call(BaseService.java:52)
at me.redaalaoui.org.sonarqube.ws.client.BaseService.call(BaseService.java:47)
at me.redaalaoui.org.sonarqube.ws.client.projectpullrequests.ProjectPullRequestsService.list(ProjectPullRequestsService.java:65)
at org.jenkinsci.plugins.sonargerrit.sonar.pull_request_analysis.PullRequestAnalysisTask.fetchIssues(PullRequestAnalysisTask.java:138)
at org.jenkinsci.plugins.sonargerrit.sonar.pull_request_analysis.PullRequestAnalysisStrategy.analyse(PullRequestAnalysisStrategy.java:29)
at org.jenkinsci.plugins.sonargerrit.sonar.Inspection.analyse(Inspection.java:78) Logs of the Sonarqube side:2023.10.24 14:18:13 ERROR web[AYmsYTBYF/Mc0HsECAr2][o.s.s.w.WebServiceEngine] Fail to process request http://sonarqube.acme.dev/api/project_pull_requests
/list?project=com.acme.project%3Aproject
java.lang.NullPointerException: Pull request data should be available for branch type PULL_REQUEST
at java.base/java.util.Objects.requireNonNull(Objects.java:235)
at com.github.mc1arke.sonarqube.plugin.server.pullrequest.ws.pullrequest.action.ListAction.addPullRequest(ListAction.java:123)
at com.github.mc1arke.sonarqube.plugin.server.pullrequest.ws.pullrequest.action.ListAction.lambda$handleProjectRequest$2(ListAction.java:102)
at java.base/java.util.ArrayList.forEach(ArrayList.java:1511)
at com.github.mc1arke.sonarqube.plugin.server.pullrequest.ws.pullrequest.action.ListAction.handleProjectRequest(ListAction.java:102)
at com.github.mc1arke.sonarqube.plugin.server.pullrequest.ws.pullrequest.action.ProjectWsAction.handle(ProjectWsAction.java:61)
at org.sonar.server.ws.WebServiceEngine.execute(WebServiceEngine.java:111) On the database sidesonarqube=> select * from project_branches where kee = '37625-10';
-[ RECORD 1 ]-----------------+---------------------------------------------------------------------------------------------------------------------------
uuid | AYtiNLl7ZBhuWkO_RLbl
project_uuid | AWOeaMUnRKTGso_RJvNe
kee | 37625-10
branch_type | PULL_REQUEST
merge_branch_uuid | AWOeaMUnRKTGso_RJvNe
created_at | 1698159704492
updated_at | 1698160012494
pull_request_binary | [redacted]
manual_baseline_analysis_uuid |
exclude_from_purge | f
need_issue_sync | f
After a little while, the endpoint does not fail again since all other CI builds are green. Maybe there is a delay between the PR analysis availability and the |
This change tries to account for issue like the one described in mc1arke/sonarqube-community-branch-plugin#759 (comment)
This change tries to account for issue like the one described in mc1arke/sonarqube-community-branch-plugin#759 (comment)
Describe the bug
To Reproduce
Steps to reproduce the behavior:
Unknow the reason which the PR don't have pull_request_binary data
Expected behavior
Please don't block the flow(just ignore the PR which missing the pull_request_binary).
Screenshots
None
Software Versions
Additional context
None
The text was updated successfully, but these errors were encountered: