Closed manasatest closed 5 years ago
I'm seeing something similar:
22:16:09.136 INFO: 8/8 components tracked
22:16:09.137 INFO: ANALYSIS SUCCESSFUL
22:16:09.235 DEBUG: Post-jobs : GitLab Commit Issue Publisher
22:16:09.235 INFO: Executing post-job 'GitLab Commit Issue Publisher'
22:16:09.732 INFO: ------------------------------------------------------------------------
22:16:09.733 INFO: EXECUTION FAILURE
22:16:09.733 INFO: ------------------------------------------------------------------------
22:16:09.733 INFO: Total time: 6.358s
22:16:09.798 INFO: Final Memory: 14M/268M
22:16:09.798 INFO: ------------------------------------------------------------------------
22:16:09.798 ERROR: Error during SonarQube Scanner execution
java.lang.NullPointerException
at com.talanlabs.sonar.plugins.gitlab.GitLabApiV4Wrapper.createOrUpdateSonarQubeStatus(GitLabApiV4Wrapper.java:211)
at com.talanlabs.sonar.plugins.gitlab.CommitFacade.createOrUpdateSonarQubeStatus(CommitFacade.java:128)
at com.talanlabs.sonar.plugins.gitlab.CommitPublishPostJob.execute(CommitPublishPostJob.java:112)
at org.sonar.scanner.postjob.PostJobWrapper.execute(PostJobWrapper.java:46)
at org.sonar.scanner.phases.PostJobsExecutor.execute(PostJobsExecutor.java:51)
at org.sonar.scanner.phases.PostJobsExecutor.execute(PostJobsExecutor.java:42)
at org.sonar.scanner.phases.AbstractPhaseExecutor.execute(AbstractPhaseExecutor.java:80)
at org.sonar.scanner.scan.ModuleScanContainer.doAfterStart(ModuleScanContainer.java:164)
at org.sonar.core.platform.ComponentContainer.startComponents(ComponentContainer.java:136)
at org.sonar.core.platform.ComponentContainer.execute(ComponentContainer.java:122)
at org.sonar.scanner.scan.ProjectScanContainer.scan(ProjectScanContainer.java:319)
at org.sonar.scanner.scan.ProjectScanContainer.scanRecursively(ProjectScanContainer.java:314)
at org.sonar.scanner.scan.ProjectScanContainer.doAfterStart(ProjectScanContainer.java:288)
@gjdanis are you using a gradle command for it or sonar-scannner?
@manasatest sonar-scanner but same exception and similar trace
@gjdanis Did you install the gitlab cert on your sonar server?
@manasatest I believe I should be ignoring it (I've removed some of the sensitive variables here):
sonar-scanner -X \
-Dsonar.host.url= \
-Dsonar.login= \
-Dsonar.analysis.mode=preview \
-Dsonar.gitlab.commit_sha= \
-Dsonar.gitlab.ref_name= \
-Dsonar.gitlab.project_id= \
-Dsonar.gitlab.ignore_certificate=true
Here's how my settings look on the server:
@gjdanis I could able to fix the Null pointer exception. gitlab url is supposed to be https://gitlab.com not https://gitlab.com/project
Still have issue with the comments. SonarQube failed to complete the review of this commit: Fail to request https://company.com/sonarqube/api/ce/task?id=XXXXXXXXXXXXXXX
Thanks @manasatest - that was the issue (https://gitlab.com vs https://gitlab.com/project)
@gabrie-allaigre
I'm running following command for my gitlab-sonarqube ./gradlew sonarqube -Dsonar.host.url=$SONAR_URL -Dsonar.analysis.mode=preview -Dsonar.login=$SONAR_TOKEN -Dsonar.gitlab.project_id=$CI_PROJECT_ID -Dsonar.gitlab.commit_sha=$CI_COMMIT_SHA -Dsonar.gitlab.ref_name=$CI_COMMIT_REF_NAME -Dsonar.gitlab.disable_proxy=true -Dsonar.gitlab.ignore_certificate=true -Dsonar.branch.name=$CI_COMMIT_REF_NAME -Dsonar.gitlab.failure_notification_mode=commit-status --debug
Sonarqube - 7.5 GitLab - CI_SERVER_VERSION=11.7.3-ee sonar-gitlab-plugin-4.0.0
3:34:35.832 [INFO] [org.sonarqube.gradle.SonarQubeTask] ANALYSIS SUCCESSFUL 23:34:35.986 [DEBUG] [org.sonarqube.gradle.SonarQubeTask] Post-jobs : GitLab Commit Issue Publisher 23:34:35.987 [INFO] [org.sonarqube.gradle.SonarQubeTask] Executing post-job 'GitLab Commit Issue Publisher' 23:34:37.890 [DEBUG] [org.gradle.api.internal.tasks.execution.ExecuteAtMostOnceTaskExecuter] Finished executing task ':sonarqube' 23:34:37.890 [LIFECYCLE] [class org.gradle.internal.buildevents.TaskExecutionLogger] :sonarqube FAILED 23:34:37.891 [INFO] [org.gradle.execution.taskgraph.AbstractTaskPlanExecutor] :sonarqube (Thread[Daemon worker,5,main]) completed. Took 18.24 secs. 23:34:37.891 [DEBUG] [org.gradle.internal.operations.DefaultBuildOperationWorkerRegistry] Worker root.13 completed (0 in use) 23:34:37.892 [DEBUG] [org.gradle.execution.taskgraph.AbstractTaskPlanExecutor] Task worker [Thread[Daemon worker,5,main]] finished, busy: 24.561 secs, idle: 0.022 secs 23:34:37.900 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] 23:34:37.900 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] FAILURE: Build failed with an exception. 23:34:37.900 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] 23:34:37.903 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] What went wrong: 23:34:37.903 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] Execution failed for task ':sonarqube'. 23:34:37.905 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] > java.lang.NullPointerException (no error message) 23:34:37.905 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] 23:34:37.906 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] Try: 23:34:37.907 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] Run with --stacktrace option to get the stack trace. 23:34:37.908 [LIFECYCLE] [org.gradle.internal.buildevents.BuildResultLogger] 23:34:37.909 [LIFECYCLE] [org.gradle.internal.buildevents.BuildResultLogger] BUILD FAILED