gitlab-plugin
gitlab-plugin copied to clipboard
500 internal server error (NPE) on Gitlab Webhook
We upgraded the plugin from version 1.5.20 to version 1.5.21-SNAPSHOT (mainline). Since the upgrade our Gitlab webhooks do not work anymore. The Jenkins syslog shows a NullpointerException. The webhook calls get a 500 internal server error as response. The response body is the "oops" html code.
We think this issue was introduced with this commit: https://github.com/jenkinsci/gitlab-plugin/commit/ffc405f9d5b80fcd5af5220eae43a5ae75e72c79
Jenkins Syslog:
Caught unhandled exception with ID eb615b0b-3342-4304-8b86-554d4ab2d532 java.lang.NullPointerException at com.dabsquared.gitlabjenkins.webhook.GitLabWebHook.getConfiguredGlobalWebhookConnections(GitLabWebHook.java:131) at com.dabsquared.gitlabjenkins.webhook.GitLabWebHook.getDynamic(GitLabWebHook.java:91) at java.lang.invoke.MethodHandle.invokeWithArguments(Unknown Source) at org.kohsuke.stapler.Function$MethodFunction.invoke(Function.java:396) at org.kohsuke.stapler.Function$InstanceFunction.invoke(Function.java:408) at org.kohsuke.stapler.Function.bindAndInvoke(Function.java:212) at org.kohsuke.stapler.MetaClass$9.dispatch(MetaClass.java:455) at org.kohsuke.stapler.Stapler.tryInvoke(Stapler.java:766) Caused: javax.servlet.ServletException at org.kohsuke.stapler.Stapler.tryInvoke(Stapler.java:816) at org.kohsuke.stapler.Stapler.invoke(Stapler.java:898) at org.kohsuke.stapler.MetaClass$9.dispatch(MetaClass.java:457) at org.kohsuke.stapler.Stapler.tryInvoke(Stapler.java:766) at org.kohsuke.stapler.Stapler.invoke(Stapler.java:898) at org.kohsuke.stapler.Stapler.invoke(Stapler.java:694) at org.kohsuke.stapler.Stapler.service(Stapler.java:240)
It looks like this can be worked around by going to 'Manage Jenkins' -> 'Configure System' and in the GitLab section filling in the 'Global GitLab CI Service URL Identifier' field with something.. I just put in 'empty'..
https://github.com/jenkinsci/gitlab-plugin/pull/1187#issuecomment-980487751 says it was released in 1.5.23.