Build fails with 'cannot find current thread' error

Issue

Builds sometimes fail with the error:

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)

Environment

Resolution

This is a bug that was reported here: [JENKINS-56890] IOException: “cannot find current thread” - Jenkins JIRA
It affects environments with Jenkins versions above 2.164 and Pipeline: Groovy (workflow-cps) plugin below version 2.69

The solution is to upgrade the Pipeline: Groovy (workflow-cps) plugin to version 2.69 or higher

If you are a CloudBees customer, you may need to temporarily disable the CloudBees Assurance Program (CAP) in order to find the update as explained here: Plugins missing from Update Center after installing CloudBees Jenkins v2.x – CloudBees Support
If you would like to stay CAP compliant, please upgrade your CloudBees Jenkins instance to version 2.176.2.3 or higher as the updated plugin is included in these versions of CAP.

Have more questions?

0 Comments

Please sign in to leave a comment.