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

Method code too large using declarative pipelines

    XMLWordPrintable

Details

    Description

       
      i got the error below when i use a lot of parallel stages , this error disappear when i just fill in a few parallel stages but of course that will not work for us. has anyone a work a round for this? we use declarative pipelines, how can i make the method shorter as i cant use dynamic stages with declarative pipelines

      stages {
      stage('Test') {
      parallel {
          stage('1') {
            when {expression bla1}}
              steps {node(label: 'bla') {test('bla1', '')}}}

          stage('2') {
            when {expression bla2}}
              steps {node(label: 'bla') {test('bla2', '')}}}

          stage('3') {
            when {expression bla1}}
              steps {node(label: 'bla') {test('bla3', '')}}}

          stage(bla4') {
            when {expression bla3}}
              steps {node(label: 'bla') {test('bla4', '')}}}

           ..... more as 200

      Notified JIRA that a build has completed.
      org.codehaus.groovy.control.MultipleCompilationErrorsException: startup failed:
      General error during class generation: Method code too large!

      java.lang.RuntimeException: Method code too large!
      at groovyjarjarasm.asm.MethodWriter.a(Unknown Source)
      at groovyjarjarasm.asm.ClassWriter.toByteArray(Unknown Source)
      at org.codehaus.groovy.control.CompilationUnit$17.call(CompilationUnit.java:827)
      at org.codehaus.groovy.control.CompilationUnit.applyToPrimaryClassNodes(CompilationUnit.java:1065)
      at org.codehaus.groovy.control.CompilationUnit.doPhaseOperation(CompilationUnit.java:603)
      at org.codehaus.groovy.control.CompilationUnit.processPhaseOperations(CompilationUnit.java:581)
      at org.codehaus.groovy.control.CompilationUnit.compile(CompilationUnit.java:558)
      at groovy.lang.GroovyClassLoader.doParseClass(GroovyClassLoader.java:298)
      at groovy.lang.GroovyClassLoader.parseClass(GroovyClassLoader.java:268)
      at groovy.lang.GroovyShell.parseClass(GroovyShell.java:688)
      at groovy.lang.GroovyShell.parse(GroovyShell.java:700)
      at org.jenkinsci.plugins.workflow.cps.CpsGroovyShell.doParse(CpsGroovyShell.java:133)
      at org.jenkinsci.plugins.workflow.cps.CpsGroovyShell.reparse(CpsGroovyShell.java:127)
      at org.jenkinsci.plugins.workflow.cps.CpsFlowExecution.parseScript(CpsFlowExecution.java:557)
      at org.jenkinsci.plugins.workflow.cps.CpsFlowExecution.start(CpsFlowExecution.java:518)
      at org.jenkinsci.plugins.workflow.job.WorkflowRun.run(WorkflowRun.java:290)
      at hudson.model.ResourceController.execute(ResourceController.java:97)
      at hudson.model.Executor.run(Executor.java:421)

      1 error

      at org.codehaus.groovy.control.ErrorCollector.failIfErrors(ErrorCollector.java:310)
      at org.codehaus.groovy.control.CompilationUnit.applyToPrimaryClassNodes(CompilationUnit.java:1085)
      at org.codehaus.groovy.control.CompilationUnit.doPhaseOperation(CompilationUnit.java:603)
      at org.codehaus.groovy.control.CompilationUnit.processPhaseOperations(CompilationUnit.java:581)
      at org.codehaus.groovy.control.CompilationUnit.compile(CompilationUnit.java:558)
      at groovy.lang.GroovyClassLoader.doParseClass(GroovyClassLoader.java:298)
      at groovy.lang.GroovyClassLoader.parseClass(GroovyClassLoader.java:268)
      at groovy.lang.GroovyShell.parseClass(GroovyShell.java:688)
      at groovy.lang.GroovyShell.parse(GroovyShell.java:700)
      at org.jenkinsci.plugins.workflow.cps.CpsGroovyShell.doParse(CpsGroovyShell.java:133)
      at org.jenkinsci.plugins.workflow.cps.CpsGroovyShell.reparse(CpsGroovyShell.java:127)
      at org.jenkinsci.plugins.workflow.cps.CpsFlowExecution.parseScript(CpsFlowExecution.java:557)
      at org.jenkinsci.plugins.workflow.cps.CpsFlowExecution.start(CpsFlowExecution.java:518)
      at org.jenkinsci.plugins.workflow.job.WorkflowRun.run(WorkflowRun.java:290)
      at hudson.model.ResourceController.execute(ResourceController.java:97)
      at hudson.model.Executor.run(Executor.java:421)
      Finished: FAILURE

      Attachments

        Issue Links

          Activity

            amaimon Amnon Maimon added a comment - - edited

            ruudp, abayer - Is it really resolved? On which version?

            Thanks

            amaimon Amnon Maimon added a comment - - edited ruudp , abayer  - Is it really resolved? On which version? Thanks
            ruudp Ruud P added a comment -

            my bug was a duplicate bug, but it is not solved and so far as i know it will also not happen, I change my code and using script blocks.

            see

            https://issues.jenkins-ci.org/browse/JENKINS-37984

             

            ruudp Ruud P added a comment - my bug was a duplicate bug, but it is not solved and so far as i know it will also not happen, I change my code and using script blocks. see https://issues.jenkins-ci.org/browse/JENKINS-37984  
            amaimon Amnon Maimon added a comment -

            ruudp - Thank you. I just didn't understand the resolved part of this issue

            amaimon Amnon Maimon added a comment - ruudp - Thank you. I just didn't understand the resolved part of this issue

            People

              Unassigned Unassigned
              ruudp Ruud P
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: