[JIRA] (JENKINS-58839) NPE in GitLabMergeRequestSCMEvent and GitLabPushSCMEvent

0 views
Skip to first unread message

christian.koeberl@gmail.com (JIRA)

unread,
Aug 7, 2019, 1:56:02 AM8/7/19
to jenkinsc...@googlegroups.com
Christian Köberl created an issue
 
Jenkins / Bug JENKINS-58839
NPE in GitLabMergeRequestSCMEvent and GitLabPushSCMEvent
Issue Type: Bug Bug
Assignee: Parichay Barpanda
Components: gitlab-branch-source-plugin
Created: 2019-08-07 05:55
Environment: Jenkins 2.176.2, Linux, Master + 10+ Slaves
gitlab-branch-source 0.0.6-beta.5C
Priority: Minor Minor
Reporter: Christian Köberl

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)
...
Add Comment Add Comment
 
This message was sent by Atlassian Jira (v7.11.2#711002-sha1:fdc329d)

parichay.barpanda@gmail.com (JIRA)

unread,
Aug 7, 2019, 2:51:13 AM8/7/19
to jenkinsc...@googlegroups.com
Parichay Barpanda commented on Bug JENKINS-58839
 
Re: NPE in GitLabMergeRequestSCMEvent and GitLabPushSCMEvent

Hi Christian, the log is pretty confusing as neither of the objects we are comparing should be null in any case. So the NPE is strange. On my machine I am not getting the same problem you are facing. I performed a GitLab Group Job type on my GitLab User account and the Push SCM and MR SCM Event are working fine. Can you retest the plugin by building hpi from the develop branch from repository? In that case please remove your old job and create a new job. What gitlab server version are you using?

parichay.barpanda@gmail.com (JIRA)

unread,
Aug 7, 2019, 2:53:02 AM8/7/19
to jenkinsc...@googlegroups.com
Parichay Barpanda updated an issue
 
Change By: Parichay Barpanda
Labels: gsoc-2019
Sprint: GSoC 2019. Coding Phase 3

christian.koeberl@gmail.com (JIRA)

unread,
Aug 7, 2019, 4:59:02 AM8/7/19
to jenkinsc...@googlegroups.com

> neither of the objects we are comparing should be null in any case

I also looked at the code and yes that seems strange.

>  Can you retest the plugin by building hpi from the develop branch from repository?

Yes I will do that but I'll need until tomorrow. I will also add some logging in the isMatch method.

> What gitlab server version are you using?

We are running 12.0.4 - but I think this does not matter since the JSON payload looks OK.

christian.koeberl@gmail.com (JIRA)

unread,
Aug 8, 2019, 3:42:02 AM8/8/19
to jenkinsc...@googlegroups.com

The current develop version built by me works without issues.

parichay.barpanda@gmail.com (JIRA)

unread,
Aug 8, 2019, 11:52:02 AM8/8/19
to jenkinsc...@googlegroups.com
Reply all
Reply to author
Forward
0 new messages