Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

InvocationTargetException at AbstractWebHookTriggerHandler.handle #546

Closed
theirix opened this issue May 3, 2017 · 2 comments
Closed

InvocationTargetException at AbstractWebHookTriggerHandler.handle #546

theirix opened this issue May 3, 2017 · 2 comments

Comments

@theirix
Copy link
Member

theirix commented May 3, 2017

Context

  • Gitlab plugin version: 1.4.5
  • Gitlab version: 9.1.2
  • Jenkins version: 2.46.2
  • Job type: Pipeline

Logs & Traces

Jenkins log:

May 03, 2017 10:33:34 AM com.dabsquared.gitlabjenkins.webhook.GitLabWebHook getDynamic
INFO: WebHook called with url: /project/testci_backend
May 03, 2017 10:33:34 AM org.eclipse.jetty.util.log.JavaUtilLog warn
WARNING: Error while serving http://XXX/project/testci_backend
java.lang.reflect.InvocationTargetException
    at org.kohsuke.stapler.Function$MethodFunction.invoke(Function.java:347)
    at org.kohsuke.stapler.Function.bindAndInvoke(Function.java:184)
    at org.kohsuke.stapler.MetaClass$10.dispatch(MetaClass.java:372)
    at org.kohsuke.stapler.Stapler.tryInvoke(Stapler.java:715)
    at org.kohsuke.stapler.Stapler.invoke(Stapler.java:845)
    at org.kohsuke.stapler.MetaClass$10.dispatch(MetaClass.java:374)
    at org.kohsuke.stapler.Stapler.tryInvoke(Stapler.java:715)
    at org.kohsuke.stapler.Stapler.invoke(Stapler.java:845)
    at org.kohsuke.stapler.Stapler.invoke(Stapler.java:649)
    at org.kohsuke.stapler.Stapler.service(Stapler.java:238)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:790)
    at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:812)
    at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1669)
    at hudson.util.PluginServletFilter$1.doFilter(PluginServletFilter.java:135)
    at org.jenkinsci.plugins.ssegateway.Endpoint$SSEListenChannelFilter.doFilter(Endpoint.java:225)
    at hudson.util.PluginServletFilter$1.doFilter(PluginServletFilter.java:132)
    at io.jenkins.blueocean.ResourceCacheControl.doFilter(ResourceCacheControl.java:134)
    at hudson.util.PluginServletFilter$1.doFilter(PluginServletFilter.java:132)
    at jenkins.metrics.impl.MetricsFilter.doFilter(MetricsFilter.java:125)
    at hudson.util.PluginServletFilter$1.doFilter(PluginServletFilter.java:132)
    at hudson.util.PluginServletFilter.doFilter(PluginServletFilter.java:126)
    at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1652)
    at com.dabsquared.gitlabjenkins.webhook.GitLabWebHook$GitlabWebHookCrumbExclusion.process(GitLabWebHook.java:53)
    at hudson.security.csrf.CrumbFilter.doFilter(CrumbFilter.java:58)
    at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1652)
    at hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:84)
    at hudson.security.UnwrapSecurityExceptionFilter.doFilter(UnwrapSecurityExceptionFilter.java:51)
    at hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:87)
    at jenkins.security.ExceptionTranslationFilter.doFilter(ExceptionTranslationFilter.java:117)
    at hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:87)
    at org.acegisecurity.providers.anonymous.AnonymousProcessingFilter.doFilter(AnonymousProcessingFilter.java:125)
    at hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:87)
    at org.acegisecurity.ui.rememberme.RememberMeProcessingFilter.doFilter(RememberMeProcessingFilter.java:135)
    at hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:87)
    at org.acegisecurity.ui.AbstractProcessingFilter.doFilter(AbstractProcessingFilter.java:271)
    at hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:87)
    at jenkins.security.BasicHeaderProcessor.doFilter(BasicHeaderProcessor.java:93)
    at hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:87)
    at org.acegisecurity.context.HttpSessionContextIntegrationFilter.doFilter(HttpSessionContextIntegrationFilter.java:249)
    at hudson.security.HttpSessionContextIntegrationFilter2.doFilter(HttpSessionContextIntegrationFilter2.java:67)
    at hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:87)
    at hudson.security.ChainedServletFilter.doFilter(ChainedServletFilter.java:76)
    at hudson.security.HudsonFilter.doFilter(HudsonFilter.java:171)
    at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1652)
    at org.kohsuke.stapler.compression.CompressionFilter.doFilter(CompressionFilter.java:49)
    at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1652)
    at hudson.util.CharacterEncodingFilter.doFilter(CharacterEncodingFilter.java:82)
    at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1652)
    at org.kohsuke.stapler.DiagnosticThreadNameFilter.doFilter(DiagnosticThreadNameFilter.java:30)
    at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1652)
    at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:585)
    at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:143)
    at org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:553)
    at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:223)
    at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1127)
    at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:515)
    at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:185)
    at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1061)
    at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:141)
    at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:97)
    at org.eclipse.jetty.server.Server.handle(Server.java:499)
    at org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:311)
    at org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:257)
    at org.eclipse.jetty.io.AbstractConnection$2.run(AbstractConnection.java:544)
    at winstone.BoundedExecutorService$1.run(BoundedExecutorService.java:77)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
    at java.lang.Thread.run(Thread.java:745)
Caused by: java.lang.NullPointerException
    at com.dabsquared.gitlabjenkins.trigger.handler.AbstractWebHookTriggerHandler.handle(AbstractWebHookTriggerHandler.java:50)
    at com.dabsquared.gitlabjenkins.trigger.handler.push.PushHookTriggerHandlerImpl.handle(PushHookTriggerHandlerImpl.java:30)
    at com.dabsquared.gitlabjenkins.trigger.handler.push.PushHookTriggerHandlerImpl.handle(PushHookTriggerHandlerImpl.java:23)
    at com.dabsquared.gitlabjenkins.trigger.handler.push.PushHookTriggerHandlerList.handle(PushHookTriggerHandlerList.java:24)
    at com.dabsquared.gitlabjenkins.trigger.handler.push.PushHookTriggerHandlerList.handle(PushHookTriggerHandlerList.java:13)
    at com.dabsquared.gitlabjenkins.GitLabPushTrigger.onPost(GitLabPushTrigger.java:241)
    at com.dabsquared.gitlabjenkins.webhook.build.PushBuildAction$1.performOnPost(PushBuildAction.java:72)
    at com.dabsquared.gitlabjenkins.webhook.build.BuildWebHookAction$TriggerNotifier.run(BuildWebHookAction.java:54)
    at hudson.security.ACL.impersonate(ACL.java:243)
    at com.dabsquared.gitlabjenkins.webhook.build.PushBuildAction.execute(PushBuildAction.java:69)
    at com.dabsquared.gitlabjenkins.webhook.build.BuildWebHookAction.execute(BuildWebHookAction.java:31)
    at com.dabsquared.gitlabjenkins.webhook.GitLabWebHook.getDynamic(GitLabWebHook.java:44)
    at java.lang.invoke.MethodHandle.invokeWithArguments(MethodHandle.java:627)
    at org.kohsuke.stapler.Function$MethodFunction.invoke(Function.java:343)
    ... 67 more

Fine log:

May 03, 2017 10:33:34 AM INFO com.dabsquared.gitlabjenkins.webhook.GitLabWebHook getDynamic
WebHook called with url: /project/testci_backend
May 03, 2017 10:33:34 AM FINE com.dabsquared.gitlabjenkins.webhook.build.PushBuildAction
Push: {
  "object_kind" : "push",
  "event_name" : "push",
  "before" : "ae3aeab0647922230fe44f3d18b32cd431145eee",
  "after" : "cf73ffd5432fc995709a275216112b8b815b36c0",
  "ref" : "refs/heads/master",
  "checkout_sha" : "cf73ffd5432fc995709a275216112b8b815b36c0",
  "message" : null,
  "user_id" : 2,
  "user_name" : "XXX",
  "user_email" : "XXX",
  "user_avatar" : "https://gitlab.XXX.com/uploads/user/avatar/2/avatar.png",
  "project_id" : 6,
  "project" : {
    "name" : "testci_backend",
    "description" : "",
    "web_url" : "https://gitlab.XXX.com/maingroup/dev/testci_backend",
    "avatar_url" : null,
    "git_ssh_url" : "git@gitlab.XXX.com:maingroup/dev/testci_backend.git",
    "git_http_url" : "https://gitlab.XXX.com/maingroup/dev/testci_backend.git",
    "namespace" : "dev",
    "visibility_level" : 0,
    "path_with_namespace" : "maingroup/dev/testci_backend",
    "default_branch" : "master",
    "homepage" : "https://gitlab.XXX.com/maingroup/dev/testci_backend",
    "url" : "git@gitlab.XXX.com:maingroup/dev/testci_backend.git",
    "ssh_url" : "git@gitlab.XXX.com:maingroup/dev/testci_backend.git",
    "http_url" : "https://gitlab.XXX.com/maingroup/dev/testci_backend.git"
  },
  "commits" : [ {
    "id" : "cf73ffd5432fc995709a275216112b8b815b36c0",
    "message" : "Master commit2\n",
    "timestamp" : "2017-05-03T13:33:30+03:00",
    "url" : "https://gitlab.XXX.com/maingroup/dev/testci_backend/commit/cf73ffd5432fc995709a275216112b8b815b36c0",
    "author" : {
      "name" : "XXX",
      "email" : "XXX"
    },
    "added" : [ ],
    "modified" : [ "app/__init__.py" ],
    "removed" : [ ]
  } ],
  "total_commits_count" : 1,
  "repository" : {
    "name" : "testci_backend",
    "url" : "git@gitlab.XXX.com:maingroup/dev/testci_backend.git",
    "description" : "",
    "homepage" : "https://gitlab.XXX.com/maingroup/dev/testci_backend",
    "git_http_url" : "https://gitlab.XXX.com/maingroup/dev/testci_backend.git",
    "git_ssh_url" : "git@gitlab.XXX.com:maingroup/dev/testci_backend.git",
    "visibility_level" : 0
  }
}

Problem description

Internal GitLab and Jenkins are set up for two-way sync (push hooks from gitlab and status updating from jenkins). Usual Pipeline with a master or devel branch works fine. But after changing HEAD from one to another branch the plugin fails to process a hook.
Git branch specifier to origin/* in a project.

Describe your problem in a meaningful way:

  • Built a few commits in develop branch then switched to master branch, commited and pushed
  • expected it should be built after hook processing
  • nothing happened, only exception
@omehegan
Copy link
Member

omehegan commented Jul 6, 2017

Might be worth looking at my comments in #550.

@omehegan
Copy link
Member

Please see discussion in #550.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants