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

Form too large if there are many patchsets in the selection list (manual trigger)

    XMLWordPrintable

Details

    Description

      java.lang.IllegalStateException: Form too large 4763443>200000
      at org.eclipse.jetty.server.Request.extractParameters(Request.java:352)
      at org.eclipse.jetty.server.Request.getParameterNames(Request.java:813)
      at hudson.security.csrf.CrumbFilter.doFilter(CrumbFilter.java:67)
      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 org.acegisecurity.ui.basicauth.BasicProcessingFilter.doFilter(BasicProcessingFilter.java:174)
      at hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:87)
      at jenkins.security.ApiTokenFilter.doFilter(ApiTokenFilter.java:64)
      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.content(AbstractHttpConnection.java:960)
      at org.eclipse.jetty.server.AbstractHttpConnection$RequestHandler.content(AbstractHttpConnection.java:1021)
      at org.eclipse.jetty.http.HttpParser.parseNext(HttpParser.java:865)
      at org.eclipse.jetty.http.HttpParser.parseAvailable(HttpParser.java:240)
      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:724)

      Attachments

        Issue Links

          Activity

            pedersen Björn Pedersen created issue -

            One possible solution would be to only list the latest patchset of each change by default.

            pedersen Björn Pedersen added a comment - One possible solution would be to only list the latest patchset of each change by default.
            rin_ne rin_ne added a comment -

            Solution: JENKINS-20327

            rin_ne rin_ne added a comment - Solution: JENKINS-20327
            rin_ne rin_ne made changes -
            Field Original Value New Value
            Resolution Won't Fix [ 2 ]
            Status Open [ 1 ] Resolved [ 5 ]

            I checked the code and stepped through with Firebug. There is a logical flaw inside:
            On checking a patch, this patch is addded to the selectedIds input. But as the checkboxes are input fields in the form as well, all the data is sent beack to the server
            (1.1Mb of data for ~500 patch-sets in ~200 open changes)
            The serverside then just uses the selectedIds field.

            Of course one can increase the limit, but that seems only like a workaorund, not a solution.

            Additionally, as normally only the latest patchset can get merged anyway, the list would much shorter if by default only this set is listed.

            pedersen Björn Pedersen added a comment - I checked the code and stepped through with Firebug. There is a logical flaw inside: On checking a patch, this patch is addded to the selectedIds input. But as the checkboxes are input fields in the form as well, all the data is sent beack to the server (1.1Mb of data for ~500 patch-sets in ~200 open changes) The serverside then just uses the selectedIds field. Of course one can increase the limit, but that seems only like a workaorund, not a solution. Additionally, as normally only the latest patchset can get merged anyway, the list would much shorter if by default only this set is listed.
            pedersen Björn Pedersen made changes -
            Resolution Won't Fix [ 2 ]
            Status Resolved [ 5 ] Reopened [ 4 ]
            rin_ne rin_ne added a comment -

            I think this is not a bug because not sure that expected solution.
            Can you present it?

            rin_ne rin_ne added a comment - I think this is not a bug because not sure that expected solution. Can you present it?
            pedersen Björn Pedersen added a comment - - edited

            Possible solution for the too large form:

            use two forms in src/main/resources/com/sonyericsson/hudson/plugins/gerrit/trigger/hudsontrigger/actions/manual/ManualTriggerAction/index.jelly

            One for the table with empty target (and no submit button)
            One for the submitButton and the hidden selectedIds input. Then only selected changes will get sent.

            Possible solution to only show most recent patchsets:

            add a flag in the search form and pre-filter the ajax reponse on the server side ( call queryJava(queryString, false , true ,false, false) instead of queryJava(queryString, true , true ,false, false)

            pedersen Björn Pedersen added a comment - - edited Possible solution for the too large form: use two forms in src/main/resources/com/sonyericsson/hudson/plugins/gerrit/trigger/hudsontrigger/actions/manual/ManualTriggerAction/index.jelly One for the table with empty target (and no submit button) One for the submitButton and the hidden selectedIds input. Then only selected changes will get sent. Possible solution to only show most recent patchsets: add a flag in the search form and pre-filter the ajax reponse on the server side ( call queryJava(queryString, false , true ,false, false) instead of queryJava(queryString, true , true ,false, false)
            rin_ne rin_ne added a comment -
            • Pagenation using limit and resume_sortkey
            • Increase MaxPermSize for JVM
            • Improve query string to narrow down the result
            rin_ne rin_ne added a comment - Pagenation using limit and resume_sortkey Disable manual trigger then install the below plugin to Gerrit https://github.com/rinrinne/gerrit-raise-patch Increase MaxPermSize for JVM Improve query string to narrow down the result

            Code changed in jenkins
            User: rinrinne
            Path:
            src/main/java/com/sonyericsson/hudson/plugins/gerrit/trigger/hudsontrigger/actions/manual/ManualTriggerAction.java
            src/main/resources/com/sonyericsson/hudson/plugins/gerrit/trigger/hudsontrigger/actions/manual/ManualTriggerAction/help-allPatchSets.html
            src/main/resources/com/sonyericsson/hudson/plugins/gerrit/trigger/hudsontrigger/actions/manual/ManualTriggerAction/help-allPatchSets_ja.html
            src/main/resources/com/sonyericsson/hudson/plugins/gerrit/trigger/hudsontrigger/actions/manual/ManualTriggerAction/index.jelly
            http://jenkins-ci.org/commit/gerrit-trigger-plugin/8a9839ce165620fd045d062e897c5ca186a52fb9
            Log:
            Include the latest patchset only in manual trigger page

            Gerrit search in manual trigger page shows all patchsets in a change.
            But session needs much memory if result has many rows.
            It causes poor PermGen space.

            This patch adds a feature that includes the latest patchset only in
            search result.

            Fix for JENKINS-21064

            Task-Url: https://issues.jenkins-ci.org/browse/JENKINS-21064

            scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: rinrinne Path: src/main/java/com/sonyericsson/hudson/plugins/gerrit/trigger/hudsontrigger/actions/manual/ManualTriggerAction.java src/main/resources/com/sonyericsson/hudson/plugins/gerrit/trigger/hudsontrigger/actions/manual/ManualTriggerAction/help-allPatchSets.html src/main/resources/com/sonyericsson/hudson/plugins/gerrit/trigger/hudsontrigger/actions/manual/ManualTriggerAction/help-allPatchSets_ja.html src/main/resources/com/sonyericsson/hudson/plugins/gerrit/trigger/hudsontrigger/actions/manual/ManualTriggerAction/index.jelly http://jenkins-ci.org/commit/gerrit-trigger-plugin/8a9839ce165620fd045d062e897c5ca186a52fb9 Log: Include the latest patchset only in manual trigger page Gerrit search in manual trigger page shows all patchsets in a change. But session needs much memory if result has many rows. It causes poor PermGen space. This patch adds a feature that includes the latest patchset only in search result. Fix for JENKINS-21064 Task-Url: https://issues.jenkins-ci.org/browse/JENKINS-21064

            Code changed in jenkins
            User: Björn Pedersen
            Path:
            src/main/resources/com/sonyericsson/hudson/plugins/gerrit/trigger/hudsontrigger/actions/manual/ManualTriggerAction/index.jelly
            http://jenkins-ci.org/commit/gerrit-trigger-plugin/4ce142704b59319521a91801b9ca7741fe61b05d
            Log:
            Only send selected change data back to the server

            Use a separate form for the submit, containing only
            the hidden field that is used by the serverside code.

            Fixes: JENKINS-21064

            scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Björn Pedersen Path: src/main/resources/com/sonyericsson/hudson/plugins/gerrit/trigger/hudsontrigger/actions/manual/ManualTriggerAction/index.jelly http://jenkins-ci.org/commit/gerrit-trigger-plugin/4ce142704b59319521a91801b9ca7741fe61b05d Log: Only send selected change data back to the server Use a separate form for the submit, containing only the hidden field that is used by the serverside code. Fixes: JENKINS-21064
            rin_ne rin_ne made changes -
            Resolution Fixed [ 1 ]
            Status Reopened [ 4 ] Resolved [ 5 ]
            rin_ne rin_ne made changes -
            Link This issue is blocking JENKINS-25383 [ JENKINS-25383 ]

            Code changed in jenkins
            User: Stephen Connolly
            Path:
            src/java/winstone/Launcher.java
            src/java/winstone/cmdline/Option.java
            http://jenkins-ci.org/commit/winstone/9ae4206d85863b1f478bf21aa1a80a9111c66722
            Log:
            [FIXED JENKINS-20327][FIXED JENKINS-23221][FIXED JENKINS-24804][FIXED JENKINS-21064] java.lang.IllegalStateException: Form too large

            scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Stephen Connolly Path: src/java/winstone/Launcher.java src/java/winstone/cmdline/Option.java http://jenkins-ci.org/commit/winstone/9ae4206d85863b1f478bf21aa1a80a9111c66722 Log: [FIXED JENKINS-20327] [FIXED JENKINS-23221] [FIXED JENKINS-24804] [FIXED JENKINS-21064] java.lang.IllegalStateException: Form too large
            rtyler R. Tyler Croy made changes -
            Workflow JNJira [ 152926 ] JNJira + In-Review [ 194396 ]

            People

              rsandell rsandell
              pedersen Björn Pedersen
              Votes:
              1 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: