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

Cannot contact agent-1: java.io.IOException: cannot find current thread

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Critical Critical
    • workflow-cps-plugin

      We have upgraded to the jenkins version 2.479.1 and the mentioned plugin versions at 20th November 2024.
      Since last Xmas we are facing (or did we just recognize it a month later?) that our pipeline runs are failing after successful build in the deploy to cloud foundry stage. An exemplary log follows:

      [2025-01-03T07:06:25.296Z] info  cloudFoundryDeploy - Staging application "cp-not-db"...
      [2025-01-03T07:07:21.477Z] info  cloudFoundryDeploy - Executing task "deploy" on application "cp-not-db"...
      [2025-01-03T07:07:21.477Z] Cannot contact agent-1: java.io.IOException: cannot find current thread 

      I have rated the priority to critical, because we are not able to get a complete successful run.

        1. plugin_versions.txt
          6 kB
        2. plugins.txt
          6 kB
        3. run-jenkins.sh
          1 kB

          [JENKINS-75085] Cannot contact agent-1: java.io.IOException: cannot find current thread

          Philippe added a comment - - edited

          Issue reopened. We are still facing this issue. See the initially posted version of Jenkins and plugins.

          We have two nodes connected to our Jenkins. Jenkins is running inside a docker container as well do the SSH agents.

          If we only have node-1 online everything is working fine. If we bring back node-2 online, then we are facing above error with following exception:

          java.io.IOException: cannot find current thread
          	at PluginClassLoader for workflow-cps//org.jenkinsci.plugins.workflow.cps.CpsStepContext.doGet(CpsStepContext.java:295)
          	at PluginClassLoader for workflow-support//org.jenkinsci.plugins.workflow.support.DefaultStepContext.get(DefaultStepContext.java:75)
          	at PluginClassLoader for workflow-durable-task-step//org.jenkinsci.plugins.workflow.steps.durable_task.DurableTaskStep$Execution.launcher(DurableTaskStep.java:491)
          	at PluginClassLoader for workflow-durable-task-step//org.jenkinsci.plugins.workflow.steps.durable_task.DurableTaskStep$Execution.check(DurableTaskStep.java:608)
          	at PluginClassLoader for workflow-durable-task-step//org.jenkinsci.plugins.workflow.steps.durable_task.DurableTaskStep$Execution.run(DurableTaskStep.java:556)
          	at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:539)
          	at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
          	at java.base/java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:304)
          	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136)
          	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)
          	at java.base/java.lang.Thread.run(Thread.java:833) 

          Philippe added a comment - - edited Issue reopened. We are still facing this issue. See the initially posted version of Jenkins and plugins. We have two nodes connected to our Jenkins. Jenkins is running inside a docker container as well do the SSH agents. If we only have node-1 online everything is working fine. If we bring back node-2 online, then we are facing above error with following exception: java.io.IOException: cannot find current thread at PluginClassLoader for workflow-cps //org.jenkinsci.plugins.workflow.cps.CpsStepContext.doGet(CpsStepContext.java:295) at PluginClassLoader for workflow-support //org.jenkinsci.plugins.workflow.support.DefaultStepContext.get(DefaultStepContext.java:75) at PluginClassLoader for workflow-durable-task-step //org.jenkinsci.plugins.workflow.steps.durable_task.DurableTaskStep$Execution.launcher(DurableTaskStep.java:491) at PluginClassLoader for workflow-durable-task-step //org.jenkinsci.plugins.workflow.steps.durable_task.DurableTaskStep$Execution.check(DurableTaskStep.java:608) at PluginClassLoader for workflow-durable-task-step //org.jenkinsci.plugins.workflow.steps.durable_task.DurableTaskStep$Execution.run(DurableTaskStep.java:556) at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:539) at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264) at java.base/java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:304) at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136) at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635) at java.base/java.lang. Thread .run( Thread .java:833)

          Andrea added a comment - - edited

          Hello, 
          it's a couple of days that one of our node give a very similar error within 10 minutes from the start of any Job.

          Cannot contact main-node: java.io.IOException: cannot find current thread
          

          The problem start happening after we did a plugin update (there was a few).
          plugin_versions.txt
          The issue can happens in very different scenarios: when cloning a repo with git, when running a bash script, a python script: we don't see any relationship between the operation run and the issue.

          This node runs on the same machine as the Jenkins instance and it's an Ubuntu 22.04.

          Another node running on another machine on Ubuntu 20.04 doesn't have the issue.

          Jenkins version is 2.479.3 but was happening also with 2.479.2.
          We have recreated the node from scratch but it's still happening.

          Andrea added a comment - - edited Hello,  it's a couple of days that one of our node give a very similar error within 10 minutes from the start of any Job. Cannot contact main-node: java.io.IOException: cannot find current thread The problem start happening after we did a plugin update (there was a few). plugin_versions.txt The issue can happens in very different scenarios: when cloning a repo with git, when running a bash script, a python script: we don't see any relationship between the operation run and the issue. This node runs on the same machine as the Jenkins instance and it's an Ubuntu 22.04. Another node running on another machine on Ubuntu 20.04 doesn't have the issue. Jenkins version is 2.479.3 but was happening also with 2.479.2. We have recreated the node from scratch but it's still happening.

          Markus added a comment -

          Hi andrea_albano,

          thank you for adding this. This exactly matches our observations on this issue.

          Markus added a comment - Hi andrea_albano , thank you for adding this. This exactly matches our observations on this issue.

          Philippe added a comment -

          Good point. Jenkins master and the nodes are running SLES 15 SP2. OS Patch level for the nodes should be the same. Each of them running on an own machine inside a docker container.

          markewaite Issue was reopened yesterday.

          Philippe added a comment - Good point. Jenkins master and the nodes are running SLES 15 SP2. OS Patch level for the nodes should be the same. Each of them running on an own machine inside a docker container. markewaite Issue was reopened yesterday.

          David added a comment -

          I'm currently facing the same scenario with same Jenkins version 2.479.1. Jenkins together with plugins was also upgraded in November 2024. Running on Windows Server 2022, pipeline running on built-in node.

          Cannot contact : java.io.IOException: cannot find current threadAgent was removed
          org.jenkinsci.plugins.workflow.actions.ErrorAction$ErrorId: 422deb70-d017-4614-85b1-69ce267df93c
          Finished: ABORTED

          David added a comment - I'm currently facing the same scenario with same Jenkins version 2.479.1. Jenkins together with plugins was also upgraded in November 2024. Running on Windows Server 2022, pipeline running on built-in node. Cannot contact : java.io.IOException: cannot find current threadAgent was removed org.jenkinsci.plugins.workflow.actions.ErrorAction$ErrorId: 422deb70-d017-4614-85b1-69ce267df93c Finished: ABORTED

          Andrea added a comment -

          A little update: today we have tried to enable the built-in node and it is working.

          The built-in node runs on the same machine as the node that has the issue, so we are a little more confused.

          Andrea added a comment - A little update: today we have tried to enable the built-in node and it is working. The built-in node runs on the same machine as the node that has the issue, so we are a little more confused.

          David added a comment -

          Little update here also: After restarting the host, the pipeline executed successfully 2 times (it is scheduled).

          David added a comment - Little update here also: After restarting the host, the pipeline executed successfully 2 times (it is scheduled).

          Philippe added a comment -

          Update from our end, too: After restarting Jenkins master instance everything seems to be running smoothly again. But we still have no clue where or this error was appearing...

          Philippe added a comment - Update from our end, too: After restarting Jenkins master instance everything seems to be running smoothly again. But we still have no clue where or this error was appearing...

          David added a comment -

          This error appeared again after a month, restarting the Jenkins instance solved the issue once again.

          David added a comment - This error appeared again after a month, restarting the Jenkins instance solved the issue once again.

          Vladimir added a comment - - edited

          We found a really strange workaround for that, but maybe it will help someone

          Jenkins 2.496, latest plugins.

          In our Jenkins it only appeared on one agent - "***-win-10" to be precisely. We recreated VM with agent, Jenkins node on Jenkins, upgraded plugins and jenkins itself but nothing helped.

          But somehow recreating Jenkins agent node for the same server as "***-win-11" somehow fixed the problem.

          Vladimir added a comment - - edited We found a really strange workaround for that, but maybe it will help someone Jenkins 2.496, latest plugins. In our Jenkins it only appeared on one agent - "***-win-10" to be precisely. We recreated VM with agent, Jenkins node on Jenkins, upgraded plugins and jenkins itself but nothing helped. But somehow recreating Jenkins agent node for the same server as "***-win-11" somehow fixed the problem.

            Unassigned Unassigned
            markus_lanz Markus
            Votes:
            1 Vote for this issue
            Watchers:
            7 Start watching this issue

              Created:
              Updated: