Closed slauth closed 6 years ago
Are you getting this error when a job is triggered? Can you show a snippet of your Jenkinsfile? Can you elaborate on how you have set up your GitLab webhooks? Is your Jenkins using authentication?
Please follow the README instructions under User Support to enable additional logging from the plugin, so we can see what it is doing.
Hi and thanks for looking into this. I'll try to answer your questions:
Are you getting this error when a job is triggered?
What I did is the following:
Can you show a snippet of your Jenkinsfile?
Can you elaborate on how you have set up your GitLab webhooks?
Nothing special here. URL copied from "GitLab CI Service URL" section. Secret token created via "Generate" button. Checked "Push events", "Merge Request events" and "Enable SSL verification".
Is your Jenkins using authentication?
Yes it is. Local Jenkins users only.
Please follow the README instructions under User Support to enable additional logging from the plugin, so we can see what it is doing.
The NPE is happening when we try to log the job name and trigger type:
LOGGER.log(Level.INFO, "{0} triggered for {1}.", LoggerUtil.toArray(job.getFullName(), getTriggerType()));
So one of those values must be coming back null. Looking at the code, I don't see how getTriggerType can ever be null, it's just a protected string with different possible values. It might be that the job object is ending up null, and when you say that you saw the GitLab setting mysteriously unchecked in your Jenkins config, that's another clue. I don't know why that would be happening though.
Can you try triggering the job with an actual commit, rather than by using the Test webhook button?
Can you try triggering the job with an actual commit, rather than by using the Test webhook button?
Already tried that without success. Interestingly, freestyle and Maven jobs run fine.
Not sure what to make of it. Let's leave this open, if you find any other clues please post them.
Same exception in #546.
FYI: I was seeing this exception today when setting up my first pipeline job. My Jenkinsfile too comes from SCM and I had neglected to set up the proper checkout parameters as described in https://github.com/jenkinsci/gitlab-plugin#git-configuration-for-freestyle-jobs - yes, that is the link to the description for freestyle jobs.
@slauth were you ever able to resolve this issue? Does @mhaas's comment help?
Issue
NPE in
AbstractWebHookTriggerHandler.java:50
Context
Logs & Traces
/var/log/jenkins/jenkins.log
Problem description
I'm currently trying to set up GitLab 9.1.2, Jenkins 2.46.2, GitLab Plugin 1.4.5 but getting an NPE in
AbstractWebHookTriggerHandler.java:50
. The job is a pipeline, the Jenkinsfile comes from SCM.