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

URLTrigger Plugin doesn't work in jenkins 2.0 alpha 3 when using job type Pipeline

    XMLWordPrintable

    Details

    • Similar Issues:

      Description

      When enabling the URLTrigger plugin with the Pipeline job type in jenkins 2.0 alpha 3 it gives the following stack trace when trying to save..

      javax.servlet.ServletException: java.lang.ClassCastException: org.jenkinsci.plugins.workflow.job.WorkflowJob cannot be cast to hudson.model.AbstractProject
      at org.kohsuke.stapler.Stapler.tryInvoke(Stapler.java:796)
      at org.kohsuke.stapler.Stapler.invoke(Stapler.java:876)
      at org.kohsuke.stapler.MetaClass$5.doDispatch(MetaClass.java:233)
      at org.kohsuke.stapler.NameBasedDispatcher.dispatch(NameBasedDispatcher.java:58)
      at org.kohsuke.stapler.Stapler.tryInvoke(Stapler.java:746)
      at org.kohsuke.stapler.Stapler.invoke(Stapler.java:876)
      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:731)
      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:303)
      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
      at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)
      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
      at hudson.util.PluginServletFilter$1.doFilter(PluginServletFilter.java:134)
      at com.smartcodeltd.jenkinsci.plugin.assetbundler.filters.LessCSS.doFilter(LessCSS.java:47)
      at hudson.util.PluginServletFilter$1.doFilter(PluginServletFilter.java:131)
      at hudson.util.PluginServletFilter.doFilter(PluginServletFilter.java:125)
      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)
      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
      at hudson.security.csrf.CrumbFilter.doFilter(CrumbFilter.java:86)
      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)
      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
      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:142)
      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.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)
      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
      at org.kohsuke.stapler.compression.CompressionFilter.doFilter(CompressionFilter.java:49)
      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)
      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
      at hudson.util.CharacterEncodingFilter.doFilter(CharacterEncodingFilter.java:81)
      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)
      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
      at org.kohsuke.stapler.DiagnosticThreadNameFilter.doFilter(DiagnosticThreadNameFilter.java:30)
      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)
      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
      at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:220)
      at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:122)
      at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:614)
      at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:169)
      at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:103)
      at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:956)
      at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:116)
      at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:436)
      at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1078)
      at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:625)
      at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:318)
      at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
      at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
      at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
      at java.lang.Thread.run(Unknown Source)
      Caused by: java.lang.ClassCastException: org.jenkinsci.plugins.workflow.job.WorkflowJob cannot be cast to hudson.model.AbstractProject
      at org.jenkinsci.lib.xtrigger.AbstractTrigger.getPollingNodeListRequiredNoWS(AbstractTrigger.java:361)
      at org.jenkinsci.lib.xtrigger.AbstractTrigger.getPollingNodeList(AbstractTrigger.java:347)
      at org.jenkinsci.lib.xtrigger.AbstractTrigger.getPollingNodesWithExecutors(AbstractTrigger.java:329)
      at org.jenkinsci.lib.xtrigger.AbstractTrigger.getPollingNode(AbstractTrigger.java:309)
      at org.jenkinsci.lib.xtrigger.AbstractTrigger.start(AbstractTrigger.java:84)
      at org.jenkinsci.lib.xtrigger.AbstractTrigger.start(AbstractTrigger.java:29)
      at org.jenkinsci.plugins.workflow.job.WorkflowJob.submit(WorkflowJob.java:186)
      at hudson.model.Job.doConfigSubmit(Job.java:1228)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
      at java.lang.reflect.Method.invoke(Unknown Source)
      at org.kohsuke.stapler.Function$InstanceFunction.invoke(Function.java:324)
      at org.kohsuke.stapler.interceptor.RequirePOST$Processor.invoke(RequirePOST.java:52)
      at org.kohsuke.stapler.PreInvokeInterceptedFunction.invoke(PreInvokeInterceptedFunction.java:26)
      at org.kohsuke.stapler.Function.bindAndInvoke(Function.java:167)
      at org.kohsuke.stapler.Function.bindAndInvokeAndServeResponse(Function.java:100)
      at org.kohsuke.stapler.MetaClass$1.doDispatch(MetaClass.java:124)
      at org.kohsuke.stapler.NameBasedDispatcher.dispatch(NameBasedDispatcher.java:58)
      at org.kohsuke.stapler.Stapler.tryInvoke(Stapler.java:746)
      ... 66 more

        Attachments

          Issue Links

            Activity

            Hide
            rtyler R. Tyler Croy added a comment -

            steven armstrong, have you had an opportunity to test this with the Pipeline plugin against the current LTS, or latest release (1.642.3 and 1.653 respectively)

            Show
            rtyler R. Tyler Croy added a comment - steven armstrong , have you had an opportunity to test this with the Pipeline plugin against the current LTS, or latest release (1.642.3 and 1.653 respectively)
            Hide
            rtyler R. Tyler Croy added a comment - - edited

            I went ahead and tested this myself since I had the binaries lying around. This reproduces with the Pipeline plugin installed.

            Reproduction

            1. Install Pipeline and URL Trigger plugins
            2. Create a Pipeline
            3. Enable the "[URLTrigger] - Poll with a URL" Build Trigger
            4. Attempt to save

            I believe this is just an incompatible project type and the URL Trigger plugin must be updated.

            Show
            rtyler R. Tyler Croy added a comment - - edited I went ahead and tested this myself since I had the binaries lying around. This reproduces with the Pipeline plugin installed. Reproduction Install Pipeline and URL Trigger plugins Create a Pipeline Enable the " [URLTrigger] - Poll with a URL" Build Trigger Attempt to save I believe this is just an incompatible project type and the URL Trigger plugin must be updated.
            Hide
            tapsa Tapio Reijonen added a comment -

            Same happen also with Jenkins 2.13 and URLTrigger Plug-in 0.41

            Show
            tapsa Tapio Reijonen added a comment - Same happen also with Jenkins 2.13 and URLTrigger Plug-in 0.41
            Hide
            mksmith Matthew Smith added a comment -

            Same error for Jenkins 1.651.2 with URLTrigger Plug-in 0.41

            Show
            mksmith Matthew Smith added a comment - Same error for Jenkins 1.651.2 with URLTrigger Plug-in 0.41
            Hide
            ddaumiller Dorian Daumiller added a comment -

            Same error for Jenkins 2.7.4 with URLTrigger Plug-in 0.41

            Show
            ddaumiller Dorian Daumiller added a comment - Same error for Jenkins 2.7.4 with URLTrigger Plug-in 0.41
            Hide
            oleg_nenashev Oleg Nenashev added a comment -

            This is a trivial bug in the plugin. It should not do unsafe casts

            Show
            oleg_nenashev Oleg Nenashev added a comment - This is a trivial bug in the plugin. It should not do unsafe casts
            Hide
            ccoleman Curt Coleman added a comment -

            I see that this plugin is marked as "up for adoption" (https://wiki.jenkins-ci.org/display/JENKINS/URLTrigger+Plugin), which suggests to me that we can't expect a fix for this anytime soon - at least not from the original author(s).

            I briefly looked at the code to see if it would be a quick fix, but from what I could tell resolving this issue would be more than just changing a couple of lines of code. It looks like updates would also be needed in the x-trigger-lib (https://github.com/jenkinsci/xtrigger-lib) that the plugin depends on.

            Show
            ccoleman Curt Coleman added a comment - I see that this plugin is marked as "up for adoption" ( https://wiki.jenkins-ci.org/display/JENKINS/URLTrigger+Plugin ), which suggests to me that we can't expect a fix for this anytime soon - at least not from the original author(s). I briefly looked at the code to see if it would be a quick fix, but from what I could tell resolving this issue would be more than just changing a couple of lines of code. It looks like updates would also be needed in the x-trigger-lib ( https://github.com/jenkinsci/xtrigger-lib ) that the plugin depends on.
            Hide
            basil Basil Crow added a comment -

            To fix this properly, we need to wait for JENKINS-42614 to be fixed, which adds Pipeline support to the EnvInject plugin (which URL Trigger uses). As of today, that work is still under way.

            In the meantime, I've put together a version of URL Trigger that works with Pipeline jobs by removing EnvInject support. This means you can't use environment variables in your URLs, but it's better than nothing. See this commit to xtrigger-lib and this commit to urltrigger-plugin. You'll need to build the .hpi yourself.

            Once JENKINS-42614 is fixed, I'll look into re-adding the EnvInject functionality that I ripped out and then pushing my changes upstream.

            Show
            basil Basil Crow added a comment - To fix this properly, we need to wait for  JENKINS-42614 to be fixed, which adds Pipeline support to the EnvInject plugin (which URL Trigger uses). As of today, that work is still under way. In the meantime, I've put together a version of URL Trigger that works with Pipeline jobs by removing EnvInject support. This means you can't use environment variables in your URLs, but it's better than nothing. See this commit to xtrigger-lib  and this commit to urltrigger-plugin . You'll need to build the .hpi yourself. Once JENKINS-42614 is fixed, I'll look into re-adding the EnvInject functionality that I ripped out and then pushing my changes upstream.
            Hide
            ccoleman Curt Coleman added a comment -

            Basil Crow, from recent comments on JENKINS-42614, it sounds like they think most of the work has been done already. Is there still something in that Epic to be done that URL Trigger is dependent on?

            Show
            ccoleman Curt Coleman added a comment - Basil Crow , from recent comments on JENKINS-42614 , it sounds like they think most of the work has been done already. Is there still something in that Epic to be done that URL Trigger is dependent on?
            Hide
            basil Basil Crow added a comment -

            Curt Coleman, I was able to re-add the EnvInject functionality that I had ripped out and compile the plugin, but I haven't tested the result or posted my changes on GitHub yet. I will probably get to that within the next 2-4 weeks. When I do, I'll look into upstreaming the changes.

            Show
            basil Basil Crow added a comment - Curt Coleman , I was able to re-add the EnvInject functionality that I had ripped out and compile the plugin, but I haven't tested the result or posted my changes on GitHub yet. I will probably get to that within the next 2-4 weeks. When I do, I'll look into upstreaming the changes.
            Hide
            basil Basil Crow added a comment -

            Curt Coleman, I finished testing my changes and have now posted two pull requests in order to have the fix integrated upstream. I am awaiting a reply from the maintainers regarding getting these pull requests.

            Show
            basil Basil Crow added a comment - Curt Coleman , I finished testing my changes and have now posted two pull requests in order to have the fix integrated upstream. I am awaiting a reply from the maintainers regarding getting these pull requests.
            Hide
            basil Basil Crow added a comment -

            I discovered that this issue is a duplicate of JENKINS-27301 and the scope of work required to fix this is larger than I had originally anticipated. I'm afraid this will have to remain an open issue until someone has the time to write a more comprehensive fix.

            Show
            basil Basil Crow added a comment - I discovered that this issue is a duplicate of JENKINS-27301 and the scope of work required to fix this is larger than I had originally anticipated. I'm afraid this will have to remain an open issue until someone has the time to write a more comprehensive fix.
            Hide
            ccoleman Curt Coleman added a comment -

            Basil Crow, I appreciate you making the effort. Given that the pull request for that other ticket appears to almost be approved, I guess there's still some hope this could be resolved in the not-too-distant-future.

            Show
            ccoleman Curt Coleman added a comment - Basil Crow , I appreciate you making the effort. Given that the pull request for that other ticket appears to almost be approved, I guess there's still some hope this could be resolved in the not-too-distant-future.

              People

              Assignee:
              gbois Gregory Boissinot
              Reporter:
              stevenarmstrong steven armstrong
              Votes:
              10 Vote for this issue
              Watchers:
              14 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: