java.lang.IllegalStateException: Already completed

Jenkins JIRA | Jesse Glick | 2 years ago
tip
Your exception is missing from the Samebug knowledge base.
Here are the best solutions we found on the Internet.
Click on the to mark the helpful solution and get rewards for you help.
  1. 0

    {code:none} ... jenkins.util.ErrorLoggingScheduledThreadPoolExecutor afterExecute WARNING: failure in task not wrapped in SafeTimerTask java.lang.IllegalStateException: Already completed at org.jenkinsci.plugins.workflow.cps.CpsStepContext.onFailure(CpsStepContext.java:310) at org.jenkinsci.plugins.workflow.steps.durable_task.DurableTaskStep$Execution.check(DurableTaskStep.java:201) at org.jenkinsci.plugins.workflow.steps.durable_task.DurableTaskStep$Execution.run(DurableTaskStep.java:155) at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) at java.util.concurrent.FutureTask.run(FutureTask.java:266) at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:180) at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:293) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) at java.lang.Thread.run(Thread.java:745) Caused by: hudson.AbortException: script returned exit code 143 ... 9 more {code} Probably this is a logic error in {{DurableTaskStep.Execution.stop}}: it should cancel any pending task, or at least set {{recurrencePeriod}} to 0 and have {{run}} exit early in that case. At any rate, the mistake seems harmless and {{CpsStepContext}} is overreacting. Better to log the ISE at {{FINE}} and ignore the call to {{onFailure}} (or {{onSuccess}}).

    Jenkins JIRA | 2 years ago | Jesse Glick
    java.lang.IllegalStateException: Already completed
  2. 0

    {code:none} ... jenkins.util.ErrorLoggingScheduledThreadPoolExecutor afterExecute WARNING: failure in task not wrapped in SafeTimerTask java.lang.IllegalStateException: Already completed at org.jenkinsci.plugins.workflow.cps.CpsStepContext.onFailure(CpsStepContext.java:310) at org.jenkinsci.plugins.workflow.steps.durable_task.DurableTaskStep$Execution.check(DurableTaskStep.java:201) at org.jenkinsci.plugins.workflow.steps.durable_task.DurableTaskStep$Execution.run(DurableTaskStep.java:155) at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) at java.util.concurrent.FutureTask.run(FutureTask.java:266) at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:180) at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:293) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) at java.lang.Thread.run(Thread.java:745) Caused by: hudson.AbortException: script returned exit code 143 ... 9 more {code} Probably this is a logic error in {{DurableTaskStep.Execution.stop}}: it should cancel any pending task, or at least set {{recurrencePeriod}} to 0 and have {{run}} exit early in that case. At any rate, the mistake seems harmless and {{CpsStepContext}} is overreacting. Better to log the ISE at {{FINE}} and ignore the call to {{onFailure}} (or {{onSuccess}}).

    Jenkins JIRA | 2 years ago | Jesse Glick
    java.lang.IllegalStateException: Already completed

    Root Cause Analysis

    1. hudson.AbortException

      script returned exit code 143

      at org.jenkinsci.plugins.workflow.steps.durable_task.DurableTaskStep$Execution.check()
    2. org.jenkinsci.plugins
      DurableTaskStep$Execution.run
      1. org.jenkinsci.plugins.workflow.steps.durable_task.DurableTaskStep$Execution.check(DurableTaskStep.java:201)
      2. org.jenkinsci.plugins.workflow.steps.durable_task.DurableTaskStep$Execution.run(DurableTaskStep.java:155)
      2 frames
    3. Java RT
      Thread.run
      1. java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
      2. java.util.concurrent.FutureTask.run(FutureTask.java:266)
      3. java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:180)
      4. java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:293)
      5. java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
      6. java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
      7. java.lang.Thread.run(Thread.java:745)
      7 frames