Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-58839

NPE in GitLabMergeRequestSCMEvent and GitLabPushSCMEvent

    Details

    • Sprint:
      GSoC 2019. Coding Phase 3
    • Similar Issues:

      Description

      We get a NullPointerException on every hook event with the current version of gitlab-branch-source (0.0.6-beta.5C).

      07-Aug-2019 07:39:52.137 WARNING [class io.jenkins.plugins.gitlabbranchsource.GitLabMergeRequestSCMEvent Wed Aug 07 07:39:52 CEST 2019 / SCMEvent [#4]] jenkins.scm.api.SCMHeadEvent$DispatcherImpl.log SCMEventListener.onSCMHeadEvent(SCMHeadEvent) jenkins.branch.OrganizationFolder$SCMEventListenerImpl@6e03b818 propagated an exception
              java.lang.NullPointerException
                      at io.jenkins.plugins.gitlabbranchsource.GitLabMergeRequestSCMEvent.isMatch(GitLabMergeRequestSCMEvent.java:59)
                      at io.jenkins.plugins.gitlabbranchsource.AbstractGitLabSCMHeadEvent.isMatch(AbstractGitLabSCMHeadEvent.java:22)
                      at jenkins.branch.OrganizationFolder$SCMEventListenerImpl.onSCMHeadEvent(OrganizationFolder.java:1062)
                      at jenkins.scm.api.SCMHeadEvent$DispatcherImpl.fire(SCMHeadEvent.java:246)
                      at jenkins.scm.api.SCMHeadEvent$DispatcherImpl.fire(SCMHeadEvent.java:229)
                      at jenkins.scm.api.SCMEvent$Dispatcher.run(SCMEvent.java:505)
                      at jenkins.security.ImpersonatingScheduledExecutorService$1.run(ImpersonatingScheduledExecutorService.java:58)
                      at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
                      at java.util.concurrent.FutureTask.run(FutureTask.java:266)
                      at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:180)
                      at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:293)
                      at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
                      at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
                      at java.lang.Thread.run(Thread.java:748)

      The payload (logged before as INFO) looks fine:

      07-Aug-2019 07:39:52.040 INFO [Handling POST /jenkins/gitlab-webhook/post from x.x.x.x : ajp-nio-8039-exec-6] org.gitlab4j.api.webhook.WebHookManager.handleRequest handleEvent: X-Gitlab-Event=Merge Request Hook
      07-Aug-2019 07:39:52.048 INFO [Handling POST /jenkins/gitlab-webhook/post from x.x.x.x : ajp-nio-8039-exec-6] io.jenkins.plugins.gitlabbranchsource.GitLabWebhookListener.onMergeRequestEvent MR EVENT
      07-Aug-2019 07:39:52.052 INFO [Handling POST /jenkins/gitlab-webhook/post from x.x.x.x : ajp-nio-8039-exec-6] io.jenkins.plugins.gitlabbranchsource.GitLabWebhookListener.onMergeRequestEvent {
        "object_kind" : "merge_request",
        "user" : {
          ...
        },
        "project" : {
          ...
          "pathWithNamespace" : "demo/gitlab-jenkins",
          ...
        }
        ...

      Here the same for a push event

      07-Aug-2019 07:39:52.237 WARNING [class io.jenkins.plugins.gitlabbranchsource.GitLabPushSCMEvent Wed Aug 07 07:39:51 CEST 2019 / SCMEvent [#7]] jenkins.scm.api.SCMHeadEvent$DispatcherImpl.log SCMEventListener.onSCMHeadEvent(SCMHeadEvent) jenkins.branch.OrganizationFolder$SCMEventListenerImpl@6e03b818 propagated an exception
              java.lang.NullPointerException
                      at io.jenkins.plugins.gitlabbranchsource.GitLabPushSCMEvent.isMatch(GitLabPushSCMEvent.java:70)
      ...

        Attachments

          Activity

            People

            • Assignee:
              baymac Parichay Barpanda
              Reporter:
              derkoe Christian Köberl
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: