• Icon: Bug Bug
    • Resolution: Won't Fix
    • Icon: Major Major
    • analysis-core-plugin
    • None
    • Jenkins 1.584
      Checkstyle plugin 3.39

      When making API requests for jobs with "depth=1" or greater, Jenkins return a 500 error (the "Oops!" page) with a stack trace.

      I ran a test job several times with different plugin combinations and it crashes when I use the Checkstyle plugin.

      This seems related to JENKINS-24458 and JENKINS-23409

      javax.servlet.ServletException: java.lang.IllegalArgumentException
      at org.kohsuke.stapler.Stapler.tryInvoke(Stapler.java:778)
      at org.kohsuke.stapler.Stapler.invoke(Stapler.java:858)
      at org.kohsuke.stapler.MetaClass$4.doDispatch(MetaClass.java:210)
      at org.kohsuke.stapler.NameBasedDispatcher.dispatch(NameBasedDispatcher.java:53)
      at org.kohsuke.stapler.Stapler.tryInvoke(Stapler.java:728)
      at org.kohsuke.stapler.Stapler.invoke(Stapler.java:858)
      at org.kohsuke.stapler.MetaClass$12.dispatch(MetaClass.java:390)
      at org.kohsuke.stapler.Stapler.tryInvoke(Stapler.java:728)
      at org.kohsuke.stapler.Stapler.invoke(Stapler.java:858)
      at org.kohsuke.stapler.MetaClass$6.doDispatch(MetaClass.java:248)
      at org.kohsuke.stapler.NameBasedDispatcher.dispatch(NameBasedDispatcher.java:53)
      at org.kohsuke.stapler.Stapler.tryInvoke(Stapler.java:728)
      at org.kohsuke.stapler.Stapler.invoke(Stapler.java:858)
      at org.kohsuke.stapler.Stapler.invoke(Stapler.java:631)
      at org.kohsuke.stapler.Stapler.service(Stapler.java:225)
      at javax.servlet.http.HttpServlet.service(HttpServlet.java:848)
      at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:686)
      at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1494)
      at hudson.util.PluginServletFilter$1.doFilter(PluginServletFilter.java:96)
      at hudson.plugins.greenballs.GreenBallFilter.doFilter(GreenBallFilter.java:58)
      at hudson.util.PluginServletFilter$1.doFilter(PluginServletFilter.java:99)
      at hudson.plugins.scm_sync_configuration.extensions.ScmSyncConfigurationFilter$1.call(ScmSyncConfigurationFilter.java:46)
      at hudson.plugins.scm_sync_configuration.ScmSyncConfigurationDataProvider.provideRequestDuring(ScmSyncConfigurationDataProvider.java:103)
      at hudson.plugins.scm_sync_configuration.extensions.ScmSyncConfigurationFilter.doFilter(ScmSyncConfigurationFilter.java:42)
      at hudson.util.PluginServletFilter$1.doFilter(PluginServletFilter.java:99)
      at hudson.util.PluginServletFilter.doFilter(PluginServletFilter.java:88)
      at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1482)
      at hudson.security.csrf.CrumbFilter.doFilter(CrumbFilter.java:48)
      at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1482)
      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:86)
      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:164)
      at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1482)
      at org.kohsuke.stapler.compression.CompressionFilter.doFilter(CompressionFilter.java:46)
      at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1482)
      at hudson.util.CharacterEncodingFilter.doFilter(CharacterEncodingFilter.java:81)
      at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1474)
      at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:499)
      at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:137)
      at org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:533)
      at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:231)
      at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1086)
      at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:428)
      at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:193)
      at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1020)
      at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:135)
      at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:116)
      at org.eclipse.jetty.server.Server.handle(Server.java:370)
      at org.eclipse.jetty.server.AbstractHttpConnection.handleRequest(AbstractHttpConnection.java:489)
      at org.eclipse.jetty.server.AbstractHttpConnection.headerComplete(AbstractHttpConnection.java:949)
      at org.eclipse.jetty.server.AbstractHttpConnection$RequestHandler.headerComplete(AbstractHttpConnection.java:1011)
      at org.eclipse.jetty.http.HttpParser.parseNext(HttpParser.java:644)
      at org.eclipse.jetty.http.HttpParser.parseAvailable(HttpParser.java:235)
      at org.eclipse.jetty.server.AsyncHttpConnection.handle(AsyncHttpConnection.java:82)
      at org.eclipse.jetty.io.nio.SelectChannelEndPoint.handle(SelectChannelEndPoint.java:668)
      at org.eclipse.jetty.io.nio.SelectChannelEndPoint$1.run(SelectChannelEndPoint.java:52)
      at winstone.BoundedExecutorService$1.run(BoundedExecutorService.java:77)
      at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
      at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
      at java.lang.Thread.run(Thread.java:744)
      Caused by: java.lang.IllegalArgumentException
      at sun.reflect.GeneratedMethodAccessor454.invoke(Unknown Source)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      at java.lang.reflect.Method.invoke(Method.java:606)
      at org.kohsuke.stapler.export.MethodProperty.getValue(MethodProperty.java:66)
      at org.kohsuke.stapler.export.Property.writeTo(Property.java:116)
      at org.kohsuke.stapler.export.Model.writeNestedObjectTo(Model.java:190)
      at org.kohsuke.stapler.export.Model.writeNestedObjectTo(Model.java:185)
      at org.kohsuke.stapler.export.Property.writeValue(Property.java:241)
      at org.kohsuke.stapler.export.Property.writeValue(Property.java:187)
      at org.kohsuke.stapler.export.Property.writeValue(Property.java:139)
      at org.kohsuke.stapler.export.Property.writeTo(Property.java:116)
      at org.kohsuke.stapler.export.Model.writeNestedObjectTo(Model.java:190)
      at org.kohsuke.stapler.export.Model.writeNestedObjectTo(Model.java:185)
      at org.kohsuke.stapler.export.Model.writeNestedObjectTo(Model.java:185)
      at org.kohsuke.stapler.export.Model.writeNestedObjectTo(Model.java:185)
      at org.kohsuke.stapler.export.Model.writeNestedObjectTo(Model.java:185)
      at org.kohsuke.stapler.export.Model.writeTo(Model.java:157)
      at org.kohsuke.stapler.ResponseImpl.serveExposedBean(ResponseImpl.java:267)
      at hudson.model.Api.doPython(Api.java:216)
      at sun.reflect.GeneratedMethodAccessor161.invoke(Unknown Source)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      at java.lang.reflect.Method.invoke(Method.java:606)
      at org.kohsuke.stapler.Function$InstanceFunction.invoke(Function.java:298)
      at org.kohsuke.stapler.Function.bindAndInvoke(Function.java:161)
      at org.kohsuke.stapler.Function.bindAndInvokeAndServeResponse(Function.java:96)
      at org.kohsuke.stapler.MetaClass$1.doDispatch(MetaClass.java:120)
      at org.kohsuke.stapler.NameBasedDispatcher.dispatch(NameBasedDispatcher.java:53)
      at org.kohsuke.stapler.Stapler.tryInvoke(Stapler.java:728)
      ... 74 more

          [JENKINS-25167] API requests crash with depth greater than 0

          Daniel Beck added a comment -

          SCM Sync appears to be just another filter here. The error is with the job data that is being serialized. JENKINS-25054 appears to be relevant here, that user was able to determine the issue was caused by use of the Warnings plugin. Maybe a similar strategy of determining the cause works for you as well.

          Daniel Beck added a comment - SCM Sync appears to be just another filter here. The error is with the job data that is being serialized. JENKINS-25054 appears to be relevant here, that user was able to determine the issue was caused by use of the Warnings plugin. Maybe a similar strategy of determining the cause works for you as well.

          João Vale added a comment -

          That's pretty close to what I did: I created a copy of the job (through the UI), disabled publishers and ran the job until I found a combination that didn't throw an error. It was simple enough as it is just a Freestlye job that fetches data from git, has a shell build step and calls the Cobertura and Checkstyle plugins.

          These were the combinations:

          • both plugins: fails with the above trace
          • only Cobertura: succeeds
          • only Checkstyle: fails with the above trace

          João Vale added a comment - That's pretty close to what I did: I created a copy of the job (through the UI), disabled publishers and ran the job until I found a combination that didn't throw an error. It was simple enough as it is just a Freestlye job that fetches data from git, has a shell build step and calls the Cobertura and Checkstyle plugins. These were the combinations: both plugins: fails with the above trace only Cobertura: succeeds only Checkstyle: fails with the above trace

          Daniel Beck added a comment -

          Right, already mentioned in the original report. My apologies. Reassigning this specific issue to checkstyle.

          Core (or rather Stapler) could use better error reporting, will try to look into that. That's an improvement though, not a bug.

          Daniel Beck added a comment - Right, already mentioned in the original report. My apologies. Reassigning this specific issue to checkstyle. Core (or rather Stapler) could use better error reporting, will try to look into that. That's an improvement though, not a bug.

          Ulli Hafner added a comment -

          I don't see why this is not a bug in stapler? Until we see what actually is broken I think both components make sense. In my plug-in I just use the suggested annotations. So if these are misplaced this should be reported at compile time. I also don't think that is an improvement in core, this actually is an important fix, since so many plugins are affected...

          Ulli Hafner added a comment - I don't see why this is not a bug in stapler? Until we see what actually is broken I think both components make sense. In my plug-in I just use the suggested annotations. So if these are misplaced this should be reported at compile time. I also don't think that is an improvement in core, this actually is an important fix, since so many plugins are affected...

          Daniel Beck added a comment -

          Right, the fact it only occurred with Checkstyle lead me to believe it's an issue with that prematurely.

          I was able to reproduce the reported problem in standalone Jenkins 1.584 with Checkstyle 3.39, in a freestyle job with Git checking out jenkinsci/checkstyle-plugin, Maven checkstyle:checkstyle, and a default checkstyle publicher (otherwise pristine install). /job/foo/api/xml?depth=2 and /job/foo/1/api/xml?depth=1 failed.

          Debugging into Stapler now.

          Daniel Beck added a comment - Right, the fact it only occurred with Checkstyle lead me to believe it's an issue with that prematurely. I was able to reproduce the reported problem in standalone Jenkins 1.584 with Checkstyle 3.39, in a freestyle job with Git checking out jenkinsci/checkstyle-plugin, Maven checkstyle:checkstyle, and a default checkstyle publicher (otherwise pristine install). /job/foo/api/xml?depth=2 and /job/foo/1/api/xml?depth=1 failed. Debugging into Stapler now.

          Daniel Beck added a comment -

          Analysis Core annotates hudson.plugins.analysis.core.AbstractResultAction.getTooltip(int) with @Exported, but Stapler seems incapable of exporting methods with parameters.

          Daniel Beck added a comment - Analysis Core annotates hudson.plugins.analysis.core.AbstractResultAction.getTooltip(int) with @Exported , but Stapler seems incapable of exporting methods with parameters.

          Daniel Beck added a comment -

          Assigning back to analysis-core to fix the annotation/getter.

          Improvement in Stapler to e.g. skip methods with arguments despite being @Exported (+ log warning), and/or adding an annotation processor preventing this would certainly be useful improvements, but separate from this specific occurrence.

          Daniel Beck added a comment - Assigning back to analysis-core to fix the annotation/getter. Improvement in Stapler to e.g. skip methods with arguments despite being @Exported (+ log warning), and/or adding an annotation processor preventing this would certainly be useful improvements, but separate from this specific occurrence.

          Ulli Hafner added a comment -

          Thanks for tracking this down!

          Ulli Hafner added a comment - Thanks for tracking this down!

          Code changed in jenkins
          User: Ulli Hafner
          Path:
          src/main/java/hudson/plugins/analysis/core/AbstractResultAction.java
          http://jenkins-ci.org/commit/analysis-core-plugin/7d2f63c7c04889ac05c9c4849b67fad9fcc1c449
          Log:
          [FIXED JENKINS-25167][FIXED JENKINS-25054] Do not export tooltip since it requires parameter.

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: Ulli Hafner Path: src/main/java/hudson/plugins/analysis/core/AbstractResultAction.java http://jenkins-ci.org/commit/analysis-core-plugin/7d2f63c7c04889ac05c9c4849b67fad9fcc1c449 Log: [FIXED JENKINS-25167] [FIXED JENKINS-25054] Do not export tooltip since it requires parameter.

          Ulli Hafner added a comment -

          The plugin is deprecated and not maintained anymore. Please upgrade to the warnings-ng plugin.

          Ulli Hafner added a comment - The plugin is deprecated and not maintained anymore. Please upgrade to the warnings-ng plugin.

            Unassigned Unassigned
            jvale João Vale
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: