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

IOException: "cannot find current thread"

XMLWordPrintable

    • workflow-cps 2.69

      Our server has intermittently been raising an exception which fails builds: 

      java.io.IOException: cannot find current thread
      at org.jenkinsci.plugins.workflow.cps.CpsStepContext.doGet(CpsStepContext.java:300)
      at org.jenkinsci.plugins.workflow.cps.CpsBodySubContext.doGet(CpsBodySubContext.java:88)
      at org.jenkinsci.plugins.workflow.support.DefaultStepContext.get(DefaultStepContext.java:67)
      at org.jenkinsci.plugins.credentialsbinding.impl.BindingStep$Callback.finished(BindingStep.java:254)
      at org.jenkinsci.plugins.credentialsbinding.impl.BindingStep$Execution2$Callback2.finished(BindingStep.java:162)
      at org.jenkinsci.plugins.workflow.steps.GeneralNonBlockingStepExecution$TailCall.lambda$onSuccess$0(GeneralNonBlockingStepExecution.java:140)
      at org.jenkinsci.plugins.workflow.steps.GeneralNonBlockingStepExecution.lambda$run$0(GeneralNonBlockingStepExecution.java:77)
      at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
      at java.util.concurrent.FutureTask.run(FutureTask.java:266)
      at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
      at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
      at java.lang.Thread.run(Thread.java:748)
      Finished: FAILURE

      It happens across different projects, and we can't find any commonality between them that might explain how we're ending up in this state. The error is not repeatable – kicking off the build again usually results in a successful build.

      Jenkins ver. 2.164.1

      (Relevant?) plugin versions:
      Pipeline Multibranch: 2.20
      Pipeline: Groovy 2.63

      I found the line that is throwing the exception in the source code, which seems straightforward, but I don't know why that value is sometimes null.

      I'm happy to provide more information to help diagnose this problem if you need something more.

        1. image-2023-11-08-00-38-27-386.png
          image-2023-11-08-00-38-27-386.png
          18 kB
        2. installedPlugins.txt
          44 kB
        3. log.txt
          4 kB
        4. pipeline_viyou
          2 kB
        5. pipeline.txt
          3 kB

            Unassigned Unassigned
            fcodyc Cody Casterline
            Votes:
            20 Vote for this issue
            Watchers:
            39 Start watching this issue

              Created:
              Updated:
              Resolved: