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

StackOverFlowException when using matrix jobs

      I am currently trying to set up a matrix build and whenever I have an axis with more than one values I run into a StackOverFlowException.

      This is my Pipeline (declarative):

      Comments:

      • I am not sure if customWorkspace will do what I want, that's currently only a try. Does anybody happen to have an idea how to use external-workspace-plugin from declarative pipelines?
      • the pipeline is edited for removing internal information, thus there might be unexpetced syntax issues
      • My feeling is there is a connection with another step used here like credentials or customworkspace because I can remember I've seen arunning pipeline in the past only with temporary workspaces on every build stage so missing all the checked out code. I'm trying to reproduce this and deliver that information later.
      #!groovy
      pipeline {
          agent 
          {
          	node {
      		    label ''
      		    customWorkspace "${JOB_NAME}/workspace"
      		}		    
      	}
          
          options { timestamps () }
          stages {
              stage('Build') {
              	environment {
      		    BUSY_HOME = "${BUSYDIR}"
      		    BUSY_CMD = "${BUSYDIR}\\myBuildSystem.cmd"                    
      		    CVS_CREDENTIALS = credentials('BuildUser')
      		}
              	matrix {
              	    axes {
              	        axis {
              	            name 'PLATFORM'
              	            values 'win32vc9'        	            
              	        }
              	        axis {
              	            name 'MODULE'
              	            values 'repo1/module1', 'repo2/module1'
              	        }
              	        axis {
              	            name 'VARIANT'
              	            values 'debug'      	            
              	        }
              	    }
              	    stages {
              	        stage( 'Checkout' ) {
      				environment {
      				    BUSY_VARIANT = "${VARIANT}"                    
      				    CVS_REPOSITORY = MODULE.substring( 0, MODULE.indexOf('/') )
      				    CVS_PATH = MODULE.substring( MODULE.indexOf('/') + 1 , MODULE.length() )
      				    CVS_CREDENTIALS = credentials('BuildUser')
      	         		}
      		            	steps {
      								checkout changelog: true, poll: true, scm: [$class: 'CVSSCM', canUseUpdate: true, checkoutCurrentTimestamp: false
                      					, cleanOnFailedUpdate: false, disableCvsQuiet: false, forceCleanCopy: false, legacy: false, pruneEmptyDirectories: true
                          				, repositories: [[compressionLevel: -1, cvsRoot: ":pserver:${CVS_CREDENTIALS_USR}@MYCVS/${CVS_REPOSITORY}", excludedRegions: [[pattern: '']]
                          				, password: "${CVS_CREDENTIALS_PSW}", passwordRequired: true, repositoryItems: [[location: [$class: 'HeadRepositoryLocation']
                          				, modules: [[localName: "${CVS_REPOSITORY}/${CVS_PATH}", remoteName: "${CVS_PATH}"]]]]]], skipChangeLog: false]
                          		}
              	        }
              	        stage( 'Build' ) {
      						environment {
      							BUSY_VARIANT = "${VARIANT}"                    
      							CVS_REPOSITORY = MODULE.substring( 0, MODULE.indexOf('/') )
      							CVS_PATH = MODULE.substring( MODULE.indexOf('/') + 1 , MODULE.length() )
      	         			}
      						steps {
                  				bat """					
      						
      								pushd "${MODULE}"
      								call  %BUSY_CMD% BUSY_ROOT:%WORKSPACE% BUSY_PLATFORM:${PLATFORM} r -e default
      								popd"""
      				                recordIssues enabledForFailure: true, sourceCodeEncoding: 'ISO-8859-1',
                      						healthy: 1,
                          					tools: [ msBuild( id: "${MODULE}_${PLATFORM}_${VARIANT}" ) ]
                          		}
              	        }        	        stage( 'Test' ) {
      						environment {
      							BUSY_VARIANT = "${VARIANT}"                    
      							CVS_REPOSITORY = MODULE.substring( 0, MODULE.indexOf('/') )
      							CVS_PATH = MODULE.substring( MODULE.indexOf('/') + 1 , MODULE.length() )
      	         			}
      						steps {
                  				bat """					
      					
      								pushd "${MODULE}"
      								call  %BUSY_CMD% BUSY_ROOT:%WORKSPACE% BUSY_PLATFORM:${PLATFORM} r -e run-test
      								popd"""
      						}
              	        }
              	    }
              	}
              }
          }
          post {
              always {
                  script {
                      def mailbody = '${SCRIPT, template="groovy_html.template"}'
                      def mailsubject = 'Jenkins Build ' + currentBuild.fullDisplayName + ' finished: ' + currentBuild.currentResult
                      emailext attachLog: false, body: mailbody, recipientProviders: [culprits(), brokenTestsSuspects(), brokenBuildSuspects(), upstreamDevelopers()], subject: mailsubject
                  }
              }
          }
      }
      
      

          [JENKINS-61423] StackOverFlowException when using matrix jobs

          Christoph Fetzer created issue -
          Christoph Fetzer made changes -
          Description Original: I am currently trying to set up a matrix build and whenever I have an axis with more than one values I run into a StackOverFlowException.

          This is my Pipeline (declarative):

          Comments:
           * I am not sure if customWorkspace will do what I want, that's currently only a try. Does anybody happen to have an idea how to use external-workspace-plugin from declarative pipelines?
           * the pipeline is edited for removing internal information, thus there might be unexpetced syntax issues

          {code:java}
          #!groovy
          pipeline {
              agent
              {
               node {
          label ''
          customWorkspace "${JOB_NAME}/workspace"
          }
          }
              
              options { timestamps () }
              stages {
                  stage('Build') {
                   environment {
          BUSY_HOME = "${BUSYDIR}"
          BUSY_CMD = "${BUSYDIR}\\myBuildSystem.cmd"
          CVS_CREDENTIALS = credentials('BuildUser')
          }
                   matrix {
                   axes {
                   axis {
                   name 'PLATFORM'
                   values 'win32vc9'
                   }
                   axis {
                   name 'MODULE'
                   values 'repo1/module1', 'repo2/module2'
                   }
                   axis {
                   name 'VARIANT'
                   values 'debug'
                   }
                   }
                   stages {
                   stage( 'Checkout' ) {
          environment {
          BUSY_VARIANT = "${VARIANT}"
          CVS_REPOSITORY = MODULE.substring( 0, MODULE.indexOf('/') )
          CVS_PATH = MODULE.substring( MODULE.indexOf('/') + 1 , MODULE.length() )
          CVS_CREDENTIALS = credentials('BuildUser')
          }
          steps {
          checkout changelog: true, poll: true, scm: [$class: 'CVSSCM', canUseUpdate: true, checkoutCurrentTimestamp: false
                           , cleanOnFailedUpdate: false, disableCvsQuiet: false, forceCleanCopy: false, legacy: false, pruneEmptyDirectories: true
                               , repositories: [[compressionLevel: -1, cvsRoot: ":pserver:${CVS_CREDENTIALS_USR}@MYCVS/${CVS_REPOSITORY}", excludedRegions: [[pattern: '']]
                               , password: "${CVS_CREDENTIALS_PSW}", passwordRequired: true, repositoryItems: [[location: [$class: 'HeadRepositoryLocation']
                               , modules: [[localName: "${CVS_REPOSITORY}/${CVS_PATH}", remoteName: "${CVS_PATH}"]]]]]], skipChangeLog: false]
                               }
                   }
                   stage( 'Build' ) {
          environment {
          BUSY_VARIANT = "${VARIANT}"
          CVS_REPOSITORY = MODULE.substring( 0, MODULE.indexOf('/') )
          CVS_PATH = MODULE.substring( MODULE.indexOf('/') + 1 , MODULE.length() )
          }
          steps {
                       bat """

          pushd "${MODULE}"
          call %BUSY_CMD% BUSY_ROOT:%WORKSPACE% BUSY_PLATFORM:${PLATFORM} r -e default
          popd"""
          recordIssues enabledForFailure: true, sourceCodeEncoding: 'ISO-8859-1',
                           healthy: 1,
                               tools: [ msBuild( id: "${MODULE}_${PLATFORM}_${VARIANT}" ) ]
                               }
                   } stage( 'Test' ) {
          environment {
          BUSY_VARIANT = "${VARIANT}"
          CVS_REPOSITORY = MODULE.substring( 0, MODULE.indexOf('/') )
          CVS_PATH = MODULE.substring( MODULE.indexOf('/') + 1 , MODULE.length() )
          }
          steps {
                       bat """

          pushd "${MODULE}"
          call %BUSY_CMD% BUSY_ROOT:%WORKSPACE% BUSY_PLATFORM:${PLATFORM} r -e run-test
          popd"""
          }
                   }
                   }
                   }
                  }
              }
              post {
                  always {
                      script {
                          def mailbody = '${SCRIPT, template="groovy_html.template"}'
                          def mailsubject = 'Jenkins Build ' + currentBuild.fullDisplayName + ' finished: ' + currentBuild.currentResult
                          emailext attachLog: false, body: mailbody, recipientProviders: [culprits(), brokenTestsSuspects(), brokenBuildSuspects(), upstreamDevelopers()], subject: mailsubject
                      }
                  }
              }
          }

          {code}
          New: I am currently trying to set up a matrix build and whenever I have an axis with more than one values I run into a StackOverFlowException.

          This is my Pipeline (declarative):

          Comments:
           * I am not sure if customWorkspace will do what I want, that's currently only a try. Does anybody happen to have an idea how to use external-workspace-plugin from declarative pipelines?
           * the pipeline is edited for removing internal information, thus there might be unexpetced syntax issues
           * My feeling is there is a connection with another step used here like credentials or customworkspace because I can remember I've seen arunning pipeline in the past only with temporary workspaces on every build stage so missing all the checked out code. I'm trying to reproduce this and deliver that information later.

          {code:java}
          #!groovy
          pipeline {
              agent
              {
               node {
          label ''
          customWorkspace "${JOB_NAME}/workspace"
          }
          }
              
              options { timestamps () }
              stages {
                  stage('Build') {
                   environment {
          BUSY_HOME = "${BUSYDIR}"
          BUSY_CMD = "${BUSYDIR}\\myBuildSystem.cmd"
          CVS_CREDENTIALS = credentials('BuildUser')
          }
                   matrix {
                   axes {
                   axis {
                   name 'PLATFORM'
                   values 'win32vc9'
                   }
                   axis {
                   name 'MODULE'
                   values 'repo1/module1', 'repo2/module1'
                   }
                   axis {
                   name 'VARIANT'
                   values 'debug'
                   }
                   }
                   stages {
                   stage( 'Checkout' ) {
          environment {
          BUSY_VARIANT = "${VARIANT}"
          CVS_REPOSITORY = MODULE.substring( 0, MODULE.indexOf('/') )
          CVS_PATH = MODULE.substring( MODULE.indexOf('/') + 1 , MODULE.length() )
          CVS_CREDENTIALS = credentials('BuildUser')
          }
          steps {
          checkout changelog: true, poll: true, scm: [$class: 'CVSSCM', canUseUpdate: true, checkoutCurrentTimestamp: false
                           , cleanOnFailedUpdate: false, disableCvsQuiet: false, forceCleanCopy: false, legacy: false, pruneEmptyDirectories: true
                               , repositories: [[compressionLevel: -1, cvsRoot: ":pserver:${CVS_CREDENTIALS_USR}@MYCVS/${CVS_REPOSITORY}", excludedRegions: [[pattern: '']]
                               , password: "${CVS_CREDENTIALS_PSW}", passwordRequired: true, repositoryItems: [[location: [$class: 'HeadRepositoryLocation']
                               , modules: [[localName: "${CVS_REPOSITORY}/${CVS_PATH}", remoteName: "${CVS_PATH}"]]]]]], skipChangeLog: false]
                               }
                   }
                   stage( 'Build' ) {
          environment {
          BUSY_VARIANT = "${VARIANT}"
          CVS_REPOSITORY = MODULE.substring( 0, MODULE.indexOf('/') )
          CVS_PATH = MODULE.substring( MODULE.indexOf('/') + 1 , MODULE.length() )
          }
          steps {
                       bat """

          pushd "${MODULE}"
          call %BUSY_CMD% BUSY_ROOT:%WORKSPACE% BUSY_PLATFORM:${PLATFORM} r -e default
          popd"""
          recordIssues enabledForFailure: true, sourceCodeEncoding: 'ISO-8859-1',
                           healthy: 1,
                               tools: [ msBuild( id: "${MODULE}_${PLATFORM}_${VARIANT}" ) ]
                               }
                   } stage( 'Test' ) {
          environment {
          BUSY_VARIANT = "${VARIANT}"
          CVS_REPOSITORY = MODULE.substring( 0, MODULE.indexOf('/') )
          CVS_PATH = MODULE.substring( MODULE.indexOf('/') + 1 , MODULE.length() )
          }
          steps {
                       bat """

          pushd "${MODULE}"
          call %BUSY_CMD% BUSY_ROOT:%WORKSPACE% BUSY_PLATFORM:${PLATFORM} r -e run-test
          popd"""
          }
                   }
                   }
                   }
                  }
              }
              post {
                  always {
                      script {
                          def mailbody = '${SCRIPT, template="groovy_html.template"}'
                          def mailsubject = 'Jenkins Build ' + currentBuild.fullDisplayName + ' finished: ' + currentBuild.currentResult
                          emailext attachLog: false, body: mailbody, recipientProviders: [culprits(), brokenTestsSuspects(), brokenBuildSuspects(), upstreamDevelopers()], subject: mailsubject
                      }
                  }
              }
          }

          {code}
          Jesse Glick made changes -
          Component/s New: pipeline-model-definition-plugin [ 21706 ]
          Component/s Original: matrix-project-plugin [ 18765 ]
          Component/s Original: pipeline [ 21692 ]
          Jesse Glick made changes -
          Assignee Original: Kohsuke Kawaguchi [ kohsuke ]

            Unassigned Unassigned
            chrisfetz Christoph Fetzer
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated: