• Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Major Major
    • pipeline
    • None

      I started a workflow which began with a node step which was waiting for an executor slot, then restarted Jenkins. After restart the flow failed:

      Started by user anonymous
      Running: Allocate node : Start
      Still waiting to schedule task
      Waiting for next available executor on evarga-jenkins-slave
      Resuming build
      Resuming build
      Running: Allocate node : End
      Running: End of Workflow
      com.google.inject.ConfigurationException: Guice configuration errors:
      
      1) Could not find a suitable constructor in org.jenkinsci.plugins.workflow.support.steps.ExecutorStep. Classes must have either one (and only one) constructor annotated with @Inject or a zero-argument constructor that is not private.
        at org.jenkinsci.plugins.workflow.support.steps.ExecutorStep.class(ExecutorStep.java:63)
        while locating org.jenkinsci.plugins.workflow.support.steps.ExecutorStep
          for field at org.jenkinsci.plugins.workflow.support.steps.ExecutorStepExecution.step(ExecutorStepExecution.java:57)
        while locating org.jenkinsci.plugins.workflow.support.steps.ExecutorStepExecution
      
      1 error
      	at com.google.inject.internal.InjectorImpl.getMembersInjector(InjectorImpl.java:985)
      	at com.google.inject.internal.InjectorImpl.getMembersInjector(InjectorImpl.java:990)
      	at com.google.inject.internal.InjectorImpl.injectMembers(InjectorImpl.java:976)
      	at org.jenkinsci.plugins.workflow.steps.AbstractStepExecutionImpl.inject(AbstractStepExecutionImpl.java:35)
      	at org.jenkinsci.plugins.workflow.steps.AbstractStepExecutionImpl.onResume(AbstractStepExecutionImpl.java:30)
      	at org.jenkinsci.plugins.workflow.flow.FlowExecutionList$ItemListenerImpl$1.onSuccess(FlowExecutionList.java:171)
      	at org.jenkinsci.plugins.workflow.flow.FlowExecutionList$ItemListenerImpl$1.onSuccess(FlowExecutionList.java:167)
      	at com.google.common.util.concurrent.Futures$6.run(Futures.java:975)
      	at com.google.common.util.concurrent.MoreExecutors$SameThreadExecutorService.execute(MoreExecutors.java:253)
      	at com.google.common.util.concurrent.ExecutionList$RunnableExecutorPair.execute(ExecutionList.java:149)
      	at com.google.common.util.concurrent.ExecutionList.add(ExecutionList.java:105)
      	at com.google.common.util.concurrent.AbstractFuture.addListener(AbstractFuture.java:155)
      	at com.google.common.util.concurrent.Futures.addCallback(Futures.java:985)
      	at com.google.common.util.concurrent.Futures.addCallback(Futures.java:915)
      	at org.jenkinsci.plugins.workflow.flow.FlowExecutionList$ItemListenerImpl.onLoaded(FlowExecutionList.java:167)
      	at jenkins.model.Jenkins.<init>(Jenkins.java:862)
      	at hudson.model.Hudson.<init>(Hudson.java:83)
      	at hudson.model.Hudson.<init>(Hudson.java:79)
      	at hudson.WebAppMain$3.run(WebAppMain.java:225)
      Finished: FAILURE
      

      Presumably

      @Inject private transient ExecutorStep step;
      

      should say

      @Inject(optional=true) private transient ExecutorStep step;
      

      though I wonder why this does not always break when restarting flows in the middle of node; perhaps the call to newBodyInvoker after the node has been allocated somehow prevents the problem?

          [JENKINS-26513] Deserialization error of ExecutorStepExecution

          I have reproduced this using local linux slaves.

          Having the following DSL

          node('linux') {
          echo "Now on slave"
          def x=0
          for ( i in 0..1000 )

          { echo "I'm waiting: $i" sleep 1000 x += i }

          }

          And restarting Jenkins Master causes the error to occur repeatedly.

          Nigel Harniman added a comment - I have reproduced this using local linux slaves. Having the following DSL node('linux') { echo "Now on slave" def x=0 for ( i in 0..1000 ) { echo "I'm waiting: $i" sleep 1000 x += i } } And restarting Jenkins Master causes the error to occur repeatedly.

          Jesse Glick added a comment -

          The test case probably works because JENKINS-26120 is not implemented, and so the flow is in the middle of a CPS VM thread.

          Jesse Glick added a comment - The test case probably works because JENKINS-26120 is not implemented, and so the flow is in the middle of a CPS VM thread.

          Jesse Glick added a comment -

          I think I figured out the reason this does not always break: due to JENKINS-26163, onResume is only called if the body is not yet running, so only if we are waiting for a slave at the time of restart does Jenkins even attempt to reinject the step, which then failed.

          Jesse Glick added a comment - I think I figured out the reason this does not always break: due to JENKINS-26163 , onResume is only called if the body is not yet running, so only if we are waiting for a slave at the time of restart does Jenkins even attempt to reinject the step , which then failed.

          Code changed in jenkins
          User: Jesse Glick
          Path:
          CHANGES.md
          aggregator/src/test/java/org/jenkinsci/plugins/workflow/WorkflowTest.java
          support/src/main/java/org/jenkinsci/plugins/workflow/support/steps/ExecutorStepExecution.java
          http://jenkins-ci.org/commit/workflow-plugin/aac402a592ed8c1e2b6cc4f04a0055c910954a21
          Log:
          [FIXED JENKINS-26513] Deserialization error in ExecutorStepExecution.

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: Jesse Glick Path: CHANGES.md aggregator/src/test/java/org/jenkinsci/plugins/workflow/WorkflowTest.java support/src/main/java/org/jenkinsci/plugins/workflow/support/steps/ExecutorStepExecution.java http://jenkins-ci.org/commit/workflow-plugin/aac402a592ed8c1e2b6cc4f04a0055c910954a21 Log: [FIXED JENKINS-26513] Deserialization error in ExecutorStepExecution.

          Code changed in jenkins
          User: Jesse Glick
          Path:
          CHANGES.md
          aggregator/src/test/java/org/jenkinsci/plugins/workflow/WorkflowTest.java
          support/src/main/java/org/jenkinsci/plugins/workflow/support/steps/ExecutorStepExecution.java
          http://jenkins-ci.org/commit/workflow-plugin/8fe11e081785d6b2a901edcd9792942aa909064b
          Log:
          Merge pull request #62 from jglick/ExecutorStepExecution-deser-JENKINS-26513

          JENKINS-26513 Deserialization error in ExecutorStepExecution

          Compare: https://github.com/jenkinsci/workflow-plugin/compare/e850c8c6c97c...8fe11e081785

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: Jesse Glick Path: CHANGES.md aggregator/src/test/java/org/jenkinsci/plugins/workflow/WorkflowTest.java support/src/main/java/org/jenkinsci/plugins/workflow/support/steps/ExecutorStepExecution.java http://jenkins-ci.org/commit/workflow-plugin/8fe11e081785d6b2a901edcd9792942aa909064b Log: Merge pull request #62 from jglick/ExecutorStepExecution-deser- JENKINS-26513 JENKINS-26513 Deserialization error in ExecutorStepExecution Compare: https://github.com/jenkinsci/workflow-plugin/compare/e850c8c6c97c...8fe11e081785

          Code changed in jenkins
          User: Jesse Glick
          Path:
          aggregator/src/test/java/org/jenkinsci/plugins/workflow/WorkflowTest.java
          http://jenkins-ci.org/commit/workflow-cps-plugin/15c15520c8b2b10dea8c6de20ba027b20f7d90ec
          Log:
          [FIXED JENKINS-26513] Deserialization error in ExecutorStepExecution.
          Originally-Committed-As: aac402a592ed8c1e2b6cc4f04a0055c910954a21

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: Jesse Glick Path: aggregator/src/test/java/org/jenkinsci/plugins/workflow/WorkflowTest.java http://jenkins-ci.org/commit/workflow-cps-plugin/15c15520c8b2b10dea8c6de20ba027b20f7d90ec Log: [FIXED JENKINS-26513] Deserialization error in ExecutorStepExecution. Originally-Committed-As: aac402a592ed8c1e2b6cc4f04a0055c910954a21

          Code changed in jenkins
          User: Jesse Glick
          Path:
          aggregator/src/test/java/org/jenkinsci/plugins/workflow/WorkflowTest.java
          http://jenkins-ci.org/commit/workflow-cps-plugin/66fcf949131bb8c797a7152f6d84b023de154b1f
          Log:
          Merge pull request #62 from jglick/ExecutorStepExecution-deser-JENKINS-26513

          JENKINS-26513 Deserialization error in ExecutorStepExecution
          Originally-Committed-As: 8fe11e081785d6b2a901edcd9792942aa909064b

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: Jesse Glick Path: aggregator/src/test/java/org/jenkinsci/plugins/workflow/WorkflowTest.java http://jenkins-ci.org/commit/workflow-cps-plugin/66fcf949131bb8c797a7152f6d84b023de154b1f Log: Merge pull request #62 from jglick/ExecutorStepExecution-deser- JENKINS-26513 JENKINS-26513 Deserialization error in ExecutorStepExecution Originally-Committed-As: 8fe11e081785d6b2a901edcd9792942aa909064b

            jglick Jesse Glick
            jglick Jesse Glick
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: