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

StackOverflowError When Resuming Build After Restart


      On a Windows system, I am getting a StackOverflowError when safeRestart is used during the input step of this pipeline.

      pipeline {
          agent none
          environment {
              submitters = 'charles'
          stages {
              stage('Stage1') {
                  agent any
                  steps {
                      echo 'Stage1'
              stage('Stage2') {
                  agent any
                  steps {
                      echo 'Stage2'
              stage('Stage3') {
                  agent any
                  steps {
                      echo 'Stage3'
              stage('Input') {
                  agent none
                  options {
                      timeout time: 15, unit: 'MINUTES'
                  steps {
                      input message: 'Select Proceed to continue.', submitter: "${submitters}"

      Here is a portion of the console log. The full console log is attached.

      [Pipeline] {
      [Pipeline] input
      Select Proceed to continue.
      Proceed or Abort
      Resuming build at Tue Sep 17 13:50:18 EDT 2019 after Jenkins restart
      [Pipeline] End of Pipeline
      	at java.lang.Class.forName0(Native Method)
      	at java.lang.Class.forName(Unknown Source)
      	at org.jboss.marshalling.AbstractClassResolver.loadClass(AbstractClassResolver.java:123)
      	at org.jboss.marshalling.AbstractClassResolver.resolveClass(AbstractClassResolver.java:104)
      	at org.jboss.marshalling.river.RiverUnmarshaller.doReadClassDescriptor(RiverUnmarshaller.java:998)
      Caused: java.io.IOException: Failed to load build state
      	at org.jenkinsci.plugins.workflow.cps.CpsFlowExecution$3.onSuccess(CpsFlowExecution.java:855)
      	at org.jenkinsci.plugins.workflow.cps.CpsFlowExecution$3.onSuccess(CpsFlowExecution.java:853)
      	at org.jenkinsci.plugins.workflow.cps.CpsFlowExecution$4$1.run(CpsFlowExecution.java:907)
      	at org.jenkinsci.plugins.workflow.cps.CpsVmExecutorService$1.run(CpsVmExecutorService.java:37)

      While experimenting with this I found four changes that made it stop failing. Apply any of the four by themselves and the pipeline will resume without an error. The fourth one seems odd that it would have an effect on the issue.

      • Change input stage to "agent any".
      • Comment out timeout option.
      • Comment out environment section and hardcode submitters value.
      • Comment out one of the three numbered stages.

      This error does not occur on the jenkins/jenkins:lts Docker image.

      The "Pipeline Default Speed/Durability Level" is set to "None: use pipeline default (MAX_SURVIVABILITY)".

      The pipeline is running on the master (Windows) system with no slaves defined.

            Unassigned Unassigned
            charleswb Charles Bozarth
            1 Vote for this issue
            4 Start watching this issue