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

CpsStepContext IllegalStateException logged at end of pipeline job

    • Icon: Bug Bug
    • Resolution: Cannot Reproduce
    • Icon: Minor Minor
    • pipeline
    • None
    • Jenkins 1.651.3 (see attached support bundle for more information)

      One of my pipeline jobs based on Jenkins 1.651.3 and current versions of all other plugins is logging a stack trace into syslog for 3 of the most recent builds of that job (34, 35, and 36).

      Build 34 failed with the message "ERROR: script returned exit code 1"

      Build 35 failed with the message "ERROR: script returned exit code 1"

      Build 36 failed with two messages, "Exception: null" and "Finished: ABORTED"

      The stack trace was:

      WARNING: already completed CpsStepContext[33]:Owner[git-plugin-multi-pipeline/3.0.0-beta/34:git-plugin-multi-pipeline/3.0.0-beta #34]
      java.lang.IllegalStateException
              at org.jenkinsci.plugins.workflow.cps.CpsStepContext.onSuccess(CpsStepContext.java:335)
              at org.jenkinsci.plugins.workflow.cps.CpsBodySubContext.onSuccess(CpsBodySubContext.java:68)
              at org.jenkinsci.plugins.workflow.steps.BodyExecutionCallback$TailCall.onSuccess(BodyExecutionCallback.java:115)
              at org.jenkinsci.plugins.workflow.cps.CpsBodyExecution$SuccessAdapter.receive(CpsBodyExecution.java:303)
              at com.cloudbees.groovy.cps.Outcome.resumeFrom(Outcome.java:73)
              at com.cloudbees.groovy.cps.Continuable.run0(Continuable.java:146)
              at org.jenkinsci.plugins.workflow.cps.SandboxContinuable.access$001(SandboxContinuable.java:18)
              at org.jenkinsci.plugins.workflow.cps.SandboxContinuable$1.call(SandboxContinuable.java:32)
              at org.jenkinsci.plugins.workflow.cps.SandboxContinuable$1.call(SandboxContinuable.java:29)
              at org.jenkinsci.plugins.scriptsecurity.sandbox.groovy.GroovySandbox.runInSandbox(GroovySandbox.java:108)
              at org.jenkinsci.plugins.workflow.cps.SandboxContinuable.run0(SandboxContinuable.java:29)
              at org.jenkinsci.plugins.workflow.cps.CpsThread.runNextChunk(CpsThread.java:164)
              at org.jenkinsci.plugins.workflow.cps.CpsThreadGroup.run(CpsThreadGroup.java:276)
              at org.jenkinsci.plugins.workflow.cps.CpsThreadGroup.access$000(CpsThreadGroup.java:78)
              at org.jenkinsci.plugins.workflow.cps.CpsThreadGroup$2.call(CpsThreadGroup.java:185)
              at org.jenkinsci.plugins.workflow.cps.CpsThreadGroup$2.call(CpsThreadGroup.java:183)
              at org.jenkinsci.plugins.workflow.cps.CpsVmExecutorService$2.call(CpsVmExecutorService.java:47)
              at java.util.concurrent.FutureTask.run(FutureTask.java:262)
              at hudson.remoting.SingleLaneExecutorService$1.run(SingleLaneExecutorService.java:112)
              at jenkins.util.ContextResettingExecutorService$1.run(ContextResettingExecutorService.java:28)
              at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
              at java.util.concurrent.FutureTask.run(FutureTask.java:262)
              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:745)
      

      The stack trace for build 36 added some additional text:

      Caused by: hudson.AbortException: script returned exit code 1
              at org.jenkinsci.plugins.workflow.steps.durable_task.DurableTaskStep$Execution.check(DurableTaskStep.java:202)
              at org.jenkinsci.plugins.workflow.steps.durable_task.DurableTaskStep$Execution.run(DurableTaskStep.java:154)
              at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
              at java.util.concurrent.FutureTask.run(FutureTask.java:262)
              at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:178)
              at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:292)
              ... 3 more
      

          [JENKINS-36401] CpsStepContext IllegalStateException logged at end of pipeline job

          Andrew Bayer added a comment -

          Have you seen this since opening the JIRA?

          Andrew Bayer added a comment - Have you seen this since opening the JIRA?

          Mark Waite added a comment -

           I haven't seen this in a very long time.  Should have closed it earler.

          Mark Waite added a comment -  I haven't seen this in a very long time.  Should have closed it earler.

          Just got this message in our system log today, running jenkins 2.121.2. This message appeared together with hanging pipeline jobs.
          Don't think this is resolved.

          Joerg Schwaerzler added a comment - Just got this message in our system log today, running jenkins 2.121.2. This message appeared together with hanging pipeline jobs. Don't think this is resolved.

          Mark Waite added a comment -

          macdrega can you provide steps that will duplicate the problem? I've not seen this in over a year.

          Mark Waite added a comment - macdrega can you provide steps that will duplicate the problem? I've not seen this in over a year.

          Unfortunately it's hard to reproduce. In fact it appears from time to time (every week or so) that some random Pipeline job hangs for no obvious reason, not waiting for anything. This time I checked the Jenkins log and found this error message which was matching one of the hanging jobs (found two so far). Not sure how to force this behavior.

          Joerg Schwaerzler added a comment - Unfortunately it's hard to reproduce. In fact it appears from time to time (every week or so) that some random Pipeline job hangs for no obvious reason, not waiting for anything. This time I checked the Jenkins log and found this error message which was matching one of the hanging jobs (found two so far). Not sure how to force this behavior.

          Highly likely related to JENKINS-64412

          Reinhold Füreder added a comment - Highly likely related to JENKINS-64412

            jglick Jesse Glick
            markewaite Mark Waite
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: