Skip to content

[JENKINS-49707] Auto retry for elastic agents after channel closure #559

Description

@jenkins-infra-bot

While my pipeline was running, the node that was executing logic terminated. I see this at the bottom of my console output:

Cannot contact ip-172-31-242-8.us-west-2.compute.internal: java.io.IOException: remote file operation failed: /ebs/jenkins/workspace/common-pipelines-nodeploy at hudson.remoting.Channel@​48503f20:ip-172-31-242-8.us-west-2.compute.internal: hudson.remoting.ChannelClosedException: Channel "unknown": Remote call on ip-172-31-242-8.us-west-2.compute.internal failed. The channel is closing down or has closed down

There's a spinning arrow below it.

I have a cron script that uses the Jenkins master CLI to remove nodes which have stopped responding. When I examine this node's page in my Jenkins website, it looks like the node is still running that job and i see an orange label that says "Feb 22, 2018 5:16:02 PM Node is being removed".

I'm wondering what would be a better way to say "If the channel closes down, retry the work on another node with the same label?

Things seem stuck. Please advise.


Originally reported by piratejohnny, imported from: Auto retry for elastic agents after channel closure
  • assignee: jglick
  • status: Resolved
  • priority: Critical
  • component(s): workflow-durable-task-step-plugin
  • resolution: Fixed
  • resolved: 2022-10-17T15:11:50+00:00
  • votes: 37
  • watchers: 54
  • imported: 20251212-090250
Raw content of original issue

While my pipeline was running, the node that was executing logic terminated. I see this at the bottom of my console output:

Cannot contact ip-172-31-242-8.us-west-2.compute.internal: java.io.IOException: remote file operation failed: /ebs/jenkins/workspace/common-pipelines-nodeploy at hudson.remoting.Channel@48503f20:ip-172-31-242-8.us-west-2.compute.internal: hudson.remoting.ChannelClosedException: Channel "unknown": Remote call on ip-172-31-242-8.us-west-2.compute.internal failed. The channel is closing down or has closed down

There's a spinning arrow below it.

I have a cron script that uses the Jenkins master CLI to remove nodes which have stopped responding. When I examine this node's page in my Jenkins website, it looks like the node is still running that job and i see an orange label that says "Feb 22, 2018 5:16:02 PM Node is being removed".

I'm wondering what would be a better way to say "If the channel closes down, retry the work on another node with the same label?

Things seem stuck. Please advise.

19 attachments

Activity

  1. jenkins-infra-bot commented on Feb 23, 2018

    @jenkins-infra-bot
    Author
    oleg_nenashev:
    • Original comment link
    • Raw content of original comment:

      Not sure what is the request here. You get a system message from Remoting, it's not related to Pipeline or Jobs at all in general. If you want to implement retry features or document the suggestions, IMHO it is on the Pipeline side

    Not sure what is the request here. You get a system message from Remoting, it's not related to Pipeline or Jobs at all in general. If you want to implement retry features or document the suggestions, IMHO it is on the Pipeline side

  2. jenkins-infra-bot commented on Feb 23, 2018

    @jenkins-infra-bot
    Author
    piratejohnny:
    • Original comment link
    • Raw content of original comment:

      oleg_nenashev I'm not sure how to handle this situation. The problem I need to overcome is that my pipeline hangs with the error message I have screenshotted above. I would much prefer that it errors out and fails. Unfortunately, the pipeline keeps running indefinately.

      Can this instead be configured to throw a catchable exception?

    oleg_nenashev I'm not sure how to handle this situation. The problem I need to overcome is that my pipeline hangs with the error message I have screenshotted above. I would much prefer that it errors out and fails. Unfortunately, the pipeline keeps running indefinately.

    Can this instead be configured to throw a catchable exception?

  3. jenkins-infra-bot commented on Feb 27, 2018

    @jenkins-infra-bot
    Author
    piratejohnny:
    • Original comment link
    • Raw content of original comment:

      oleg_nenashev Should this be redesignated a remoting bug? I'm not sure how to unblock my pipelines that are hanging from this issue.

    oleg_nenashev Should this be redesignated a remoting bug? I'm not sure how to unblock my pipelines that are hanging from this issue.

  4. jenkins-infra-bot commented on Feb 27, 2018

    @jenkins-infra-bot
    Author
    piratejohnny:
    • Original comment link
    • Raw content of original comment:

      i just changed the JIRA "component" field for this to "remoting".

    i just changed the JIRA "component" field for this to "remoting".

  5. jenkins-infra-bot commented on Feb 27, 2018

    @jenkins-infra-bot
    Author
    oleg_nenashev:

    Please provide the following info:

    You can find some pointers here: https://speakerdeck.com/onenashev/day-of-jenkins-2017-dealing-with-agent-connectivity-issues?slide=51

  6. jenkins-infra-bot commented on Mar 15, 2018

    @jenkins-infra-bot
    Author
    iamshital:
    • Original comment link
    • Raw content of original comment:

      I would like to increase the Priority of this issue to "Major" since this issue is affecting a lot of users.

    I would like to increase the Priority of this issue to "Major" since this issue is affecting a lot of users.

  7. jenkins-infra-bot commented on Mar 30, 2018

    @jenkins-infra-bot
    Author
    slaughter550:
    • Original comment link
    • Raw content of original comment:

      We have also been greatly effected by this issue. A resolution would be very nice

    We have also been greatly effected by this issue. A resolution would be very nice

  8. jenkins-infra-bot commented on Jun 13, 2018

    @jenkins-infra-bot
    Author
    edupo:
    • Original comment link
    • Raw content of original comment:

      We are receiving this message sporadically in cloud nodes in Azure managed by Jenkins.

    We are receiving this message sporadically in cloud nodes in Azure managed by Jenkins.

  9. jenkins-infra-bot commented on Jun 29, 2018

    @jenkins-infra-bot
    Author
    fnaum:

    Hi, 

    We are losing at a team to TeamCity mostly for this remoting issue

    Here are the logs requested, the disconnection happened at 10:21 am (agent devbuild9)

    JENKINS-49707">jenkins_agent_devbuild9_remoting_logs.zip

    JENKINS-49707">jenkins_agents_Thread_dump.html

    JENKINS-49707">jenkins_Agent_devbuild9_System_Information.html

    JENKINS-49707">jenkins_support_2018-06-29_01.14.18.zip

    I will appreciate any pointer, to where I can start looking for more information. Let me know if you need more logs. 

    This is happening several times daily so I can provide more logs if needed

     

  10. jenkins-infra-bot commented on Jun 29, 2018

    @jenkins-infra-bot
    Author
    oleg_nenashev:
    • Original comment link
    • Raw content of original comment:

      At least we have some data for diagnostics now

    At least we have some data for diagnostics now

  11. jenkins-infra-bot commented on Jul 4, 2018

    @jenkins-infra-bot
    Author
    fnaum:
    • Original comment link
    • Raw content of original comment:

      This is a fresher issue, with fewer things going on, this time the agent that got disconnected is called grub

      Job console output shows (jobConsoleOutput.txt) show at 17:27:54    

      hudson.remoting.ChannelClosedException: Channel "unknown": Remote call on grub failed. The channel is closing down or has closed down  
        at hudson.remoting.Channel.call(Channel.java:948) 
        at hudson.FilePath.act(FilePath.java:1089) 
        at hudson.FilePath.act(FilePath.java:1078)  
         .....  
      17:27:55 ERROR: Issue with creating launcher for agent grub. The agent has not been fully initialized yet

           jenkins master log at that time (jenkins.log) shows the following lines:  

      Jul 04, 2018 5:27:54 PM hudson.remoting.SynchronousCommandTransport$ReaderThread run
      SEVERE: I/O error in channel grub
      java.io.IOException: Unexpected termination of the channel
      at hudson.remoting.SynchronousCommandTransport$ReaderThread.run(SynchronousCommandTransport.java:77)
      Caused by: java.io.EOFException
      at java.io.ObjectInputStream$PeekInputStream.readFully(ObjectInputStream.java:2328)
      at java.io.ObjectInputStream$BlockDataInputStream.readShort(ObjectInputStream.java:2797)
      at java.io.ObjectInputStream.readStreamHeader(ObjectInputStream.java:802)
              ... [trimmed stacktrace]
      

      Jul 04, 2018 5:27:55 PM hudson.model.Slave reportLauncherCreateError
      WARNING: Issue with creating launcher for agent grub. The agent has not been fully initialized yetProbably there is a race condition with Agent reconnection or disconnection, check other log entries
      java.lang.IllegalStateException: No remoting channel to the agent OR it has not been fully initialized yet
      at hudson.model.Slave.reportLauncherCreateError(Slave.java:524)
      at hudson.model.Slave.createLauncher(Slave.java:496)
              ... [trimmed stacktrace]
       
      Jul 04, 2018 5:27:55 PM hudson.model.Slave reportLauncherCreateError
      WARNING: Issue with creating launcher for agent grub. The agent has not been fully initialized yetProbably there is a race condition with Agent reconnection or disconnection, check other log entries
      java.lang.IllegalStateException: No remoting channel to the agent OR it has not been fully initialized yet
      at hudson.model.Slave.reportLauncherCreateError(Slave.java:524)
      at hudson.model.Slave.createLauncher(Slave.java:496)
              ... [trimmed stacktrace]
       
      Jul 04, 2018 5:27:55 PM com.squareup.okhttp.internal.Platform$JdkWithJettyBootPlatform getSelectedProtocol
      INFO: ALPN callback dropped: SPDY and HTTP/2 are disabled. Is alpn-boot on the boot class path?
      Jul 04, 2018 5:27:55 PM org.jenkinsci.plugins.workflow.job.WorkflowRun finish
      INFO: rndtest_vortexLibrary/master #289 completed: ABORTED
        

        The agent remoting log  that shows the error is the file created at 5:08 pm  (remoting.log.2 inside grub.remoting.logs.zip)    

      at hudson.remoting.SynchronousCommandTransport$ReaderThread.run(SynchronousCommandTransport.java:77)
      Caused by: java.io.EOFException
      at java.io.ObjectInputStream$PeekInputStream.readFully(ObjectInputStream.java:2675)
      at java.io.ObjectInputStream$BlockDataInputStream.readShort(ObjectInputStream.java:3150)
      at java.io.ObjectInputStream.readStreamHeader(ObjectInputStream.java:859)
      at java.io.ObjectInputStream.<init>(ObjectInputStream.java:355)
      at hudson.remoting.ObjectInputStreamEx.<init>(ObjectInputStreamEx.java:48)
      at hudson.remoting.AbstractSynchronousByteArrayCommandTransport.read(AbstractSynchronousByteArrayCommandTransport.java:36)
      at hudson.remoting.SynchronousCommandTransport$ReaderThread.run(SynchronousCommandTransport.java:63)
      

       

       


        but it does not have a timestamp in the message. it would be handy to have one. because I can not work out if the agent or Jenkins master initiated the disconnection.   I've also included 

      • The full support log (support_2018-07-04_07.35.22.zip)
      • The logs under ${JENKINS_HOME}/logs/slaves/grub (slaveLogInMaster.grub.zip)
      • Agent system Information that I grub just minutes after seeing the disconnection.     - System Information (grubSystemInformation.html)     - Heap Dump (JavaMelodyGrubHeapDump_4_07_18.pdf)     - threads (JavaMelodyNodeGrubThreads_4_07_18.pdf)     - (MonitoringJavaelodyOnNodes.html)  A screenshot (*NetworkAndMachineStats.png) of the stats of the master (jenkinssecure1) and the agent (grub)  showing the network activity, memory and CPU history. Hardly anything going on both machines.                     

    This is a fresher issue, with fewer things going on, this time the agent that got disconnected is called grub

    Job console output shows (jobConsoleOutput.txt) show at 17:27:54
     
     

    hudson.remoting.ChannelClosedException: Channel "unknown": Remote call on grub failed. The channel is closing down or has closed down  
      at hudson.remoting.Channel.call(Channel.java:948) 
      at hudson.FilePath.act(FilePath.java:1089) 
      at hudson.FilePath.act(FilePath.java:1078)  
       .....  
    17:27:55 ERROR: Issue with creating launcher for agent grub. The agent has not been fully initialized yet

     
     
     jenkins master log at that time (jenkins.log) shows the following lines:
     

    Jul 04, 2018 5:27:54 PM hudson.remoting.SynchronousCommandTransport$ReaderThread run
    SEVERE: I/O error in channel grub
    java.io.IOException: Unexpected termination of the channel
    at hudson.remoting.SynchronousCommandTransport$ReaderThread.run(SynchronousCommandTransport.java:77)
    Caused by: java.io.EOFException
    at java.io.ObjectInputStream$PeekInputStream.readFully(ObjectInputStream.java:2328)
    at java.io.ObjectInputStream$BlockDataInputStream.readShort(ObjectInputStream.java:2797)
    at java.io.ObjectInputStream.readStreamHeader(ObjectInputStream.java:802)
            ... [trimmed stacktrace]
    
    Jul 04, 2018 5:27:55 PM hudson.model.Slave reportLauncherCreateError
    WARNING: Issue with creating launcher for agent grub. The agent has not been fully initialized yetProbably there is a race condition with Agent reconnection or disconnection, check other log entries
    java.lang.IllegalStateException: No remoting channel to the agent OR it has not been fully initialized yet
    at hudson.model.Slave.reportLauncherCreateError(Slave.java:524)
    at hudson.model.Slave.createLauncher(Slave.java:496)
            ... [trimmed stacktrace]
     
    Jul 04, 2018 5:27:55 PM hudson.model.Slave reportLauncherCreateError
    WARNING: Issue with creating launcher for agent grub. The agent has not been fully initialized yetProbably there is a race condition with Agent reconnection or disconnection, check other log entries
    java.lang.IllegalStateException: No remoting channel to the agent OR it has not been fully initialized yet
    at hudson.model.Slave.reportLauncherCreateError(Slave.java:524)
    at hudson.model.Slave.createLauncher(Slave.java:496)
            ... [trimmed stacktrace]
     
    Jul 04, 2018 5:27:55 PM com.squareup.okhttp.internal.Platform$JdkWithJettyBootPlatform getSelectedProtocol
    INFO: ALPN callback dropped: SPDY and HTTP/2 are disabled. Is alpn-boot on the boot class path?
    Jul 04, 2018 5:27:55 PM org.jenkinsci.plugins.workflow.job.WorkflowRun finish
    INFO: rndtest_vortexLibrary/master #289 completed: ABORTED
      

     
    The agent remoting log  that shows the error is the file created at 5:08 pm  (remoting.log.2 inside grub.remoting.logs.zip)
     
     

    at hudson.remoting.SynchronousCommandTransport$ReaderThread.run(SynchronousCommandTransport.java:77)
    Caused by: java.io.EOFException
    at java.io.ObjectInputStream$PeekInputStream.readFully(ObjectInputStream.java:2675)
    at java.io.ObjectInputStream$BlockDataInputStream.readShort(ObjectInputStream.java:3150)
    at java.io.ObjectInputStream.readStreamHeader(ObjectInputStream.java:859)
    at java.io.ObjectInputStream.(ObjectInputStream.java:355)
    at hudson.remoting.ObjectInputStreamEx.(ObjectInputStreamEx.java:48)
    at hudson.remoting.AbstractSynchronousByteArrayCommandTransport.read(AbstractSynchronousByteArrayCommandTransport.java:36)
    at hudson.remoting.SynchronousCommandTransport$ReaderThread.run(SynchronousCommandTransport.java:63)
    
     

     


     
    but it does not have a timestamp in the message. it would be handy to have one. because I can not work out if the agent or Jenkins master initiated the disconnection.
     
    I've also included 

    • The full support log (support_2018-07-04_07.35.22.zip)
    • The logs under ${JENKINS_HOME}/logs/slaves/grub (slaveLogInMaster.grub.zip)
    • Agent system Information that I grub just minutes after seeing the disconnection.
          - System Information (grubSystemInformation.html)
          - Heap Dump (JavaMelodyGrubHeapDump_4_07_18.pdf)
          - threads (JavaMelodyNodeGrubThreads_4_07_18.pdf)
          - (MonitoringJavaelodyOnNodes.html)
       A screenshot (*NetworkAndMachineStats.png) of the stats of the master (jenkinssecure1) and the agent (grub)  showing the network activity, memory and CPU history. Hardly anything going on both machines. 
       
       
       
       
       
       
       
       
       
       
  12. jenkins-infra-bot commented on Jul 4, 2018

    @jenkins-infra-bot
    Author
    fnaum:

    Here are the files:

    JENKINS-49707">jobConsoleOutput.txt JENKINS-49707">grub.remoting.logs.zip JENKINS-49707">JavaMelodyGrubHeapDump_4_07_18.pdf JENKINS-49707">JavaMelodyNodeGrubThreads_4_07_18.pdf JENKINS-49707">MonitoringJavaelodyOnNodes.html JENKINS-49707">grubSystemInformation.html JENKINS-49707">Thread dump [Jenkins].html JENKINS-49707">support_2018-07-04_07.35.22.zip JENKINS-49707">slaveLogInMaster.grub.zip JENKINS-49707">jenkins.log

  13. jenkins-infra-bot commented on Jul 23, 2018

    @jenkins-infra-bot
    Author
    tom_ghyselinck:
    • Original comment link
    • Raw content of original comment:

      Hi oleg_nenashev,

      Do you have any update on this?

      We have seen similar issues: The Jenkins Pipeline hangs when the node becomes unreachable at some point in time.

      It would be great to see this fixed. This issue sometimes blocks many jobs in the queue of our CI.

      In this case it was an intermittent networking issue:

      19:35:55 [Sat Jul 14 17:35:54 2018] Waiting for impl_1 to finish...
      19:37:32 /opt/Xilinx/Vivado/2018.1/bin/loader: line 194:  4860 Killed                  "$RDI_PROG" "$@"
      19:37:32 Makefile:423: recipe for target '../../work/projects/dev1/dev1.sdk/dev1.hdf' failed
      19:37:32 make: *** [../../work/projects/dev1/dev1.sdk/dev1.hdf] Error 137
      19:37:32 make: *** Waiting for unfinished jobs....
      19:38:06 /opt/Xilinx/Vivado/2018.1/bin/loader: line 194:  4859 Killed                  "$RDI_PROG" "$@"
      19:38:06 Makefile:423: recipe for target '../../work/projects/dev0/dev0.sdk/dev0.hdf' failed
      19:38:06 make: *** [../../work/projects/dev0/dev0.sdk/dev0.hdf] Error 137
      19:39:59 Cannot contact ubuntu-16-04-amd64-2: java.io.IOException: remote file operation failed: /var/jenkins/ubuntu-16-04-amd64/workspace/nts-fpga_branches_1.x-bwreq-YHXXBDM77DWWMJ4IUYUNRNT2YKWDIASW4VY4YNK2ULEAULWQGGJA/build/fpga-projects/build at hudson.remoting.Channel@cf0f3fa:ubuntu-16-04-amd64-2: hudson.remoting.ChannelClosedException: Channel "unknown": Remote call on ubuntu-16-04-amd64-2 failed. The channel is closing down or has closed down
      19:40:30 /opt/Xilinx/Vivado/2018.1/bin/loader: line 194:  4861 Killed                  "$RDI_PROG" "$@"
      19:40:30 Makefile:423: recipe for target '../../work/projects/dev2/dev2.sdk/dev2.hdf' failed
      19:40:30 make: *** [../../work/projects/dev2/dev2.sdk/dev2.hdf] Error 137
      

      finally, we aborted the build:

      Aborted by me
      09:41:29 Sending interrupt signal to process
      09:41:39 After 10s process did not stop
      

      Please note that in the post steps, we see the errors occur but the build no longer hangs here:

      Error when executing always post condition:
      java.io.IOException: remote file operation failed: /var/jenkins/ubuntu-16-04-amd64/workspace/nts-fpga_branches_1.x-bwreq-YHXXBDM77DWWMJ4IUYUNRNT2YKWDIASW4VY4YNK2ULEAULWQGGJA/packages at hudson.remoting.Channel@cf0f3fa:ubuntu-16-04-amd64-2: hudson.remoting.ChannelClosedException: Channel "unknown": Remote call on ubuntu-16-04-amd64-2 failed. The channel is closing down or has closed down
      	at hudson.FilePath.act(FilePath.java:1043)
      	at hudson.FilePath.act(FilePath.java:1025)
      	at hudson.FilePath.mkdirs(FilePath.java:1213)
      	at org.jenkinsci.plugins.workflow.steps.CoreStep$Execution.run(CoreStep.java:79)
      	at org.jenkinsci.plugins.workflow.steps.CoreStep$Execution.run(CoreStep.java:67)
      	at org.jenkinsci.plugins.workflow.steps.SynchronousNonBlockingStepExecution$1$1.call(SynchronousNonBlockingStepExecution.java:50)
      	at hudson.security.ACL.impersonate(ACL.java:290)
      	at org.jenkinsci.plugins.workflow.steps.SynchronousNonBlockingStepExecution$1.run(SynchronousNonBlockingStepExecution.java:47)
      	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)
      Caused by: hudson.remoting.ChannelClosedException: Channel "unknown": Remote call on ubuntu-16-04-amd64-2 failed. The channel is closing down or has closed down
      	at hudson.remoting.Channel.call(Channel.java:948)
      	at hudson.FilePath.act(FilePath.java:1036)
      	... 12 more
      Caused by: java.io.IOException: Unexpected termination of the channel
      	at hudson.remoting.SynchronousCommandTransport$ReaderThread.run(SynchronousCommandTransport.java:77)
      Caused by: java.io.EOFException
      	at java.io.ObjectInputStream$PeekInputStream.readFully(ObjectInputStream.java:2679)
      	at java.io.ObjectInputStream$BlockDataInputStream.readShort(ObjectInputStream.java:3154)
      	at java.io.ObjectInputStream.readStreamHeader(ObjectInputStream.java:862)
      	at java.io.ObjectInputStream.<init>(ObjectInputStream.java:358)
      	at hudson.remoting.ObjectInputStreamEx.<init>(ObjectInputStreamEx.java:48)
      	at hudson.remoting.AbstractSynchronousByteArrayCommandTransport.read(AbstractSynchronousByteArrayCommandTransport.java:36)
      	at hudson.remoting.SynchronousCommandTransport$ReaderThread.run(SynchronousCommandTransport.java:63)
      

      [Pipeline] cleanWs
      Error when executing cleanup post condition:
      java.io.IOException: remote file operation failed: /var/jenkins/ubuntu-16-04-amd64/workspace/nts-fpga_branches_1.x-bwreq-YHXXBDM77DWWMJ4IUYUNRNT2YKWDIASW4VY4YNK2ULEAULWQGGJA at hudson.remoting.Channel@cf0f3fa:ubuntu-16-04-amd64-2: hudson.remoting.ChannelClosedException: Channel "unknown": Remote call on ubuntu-16-04-amd64-2 failed. The channel is closing down or has closed down
      at hudson.FilePath.act(FilePath.java:1043)
      at hudson.FilePath.act(FilePath.java:1025)
      at hudson.FilePath.mkdirs(FilePath.java:1213)
      at org.jenkinsci.plugins.workflow.steps.CoreStep$Execution.run(CoreStep.java:79)
      at org.jenkinsci.plugins.workflow.steps.CoreStep$Execution.run(CoreStep.java:67)
      at org.jenkinsci.plugins.workflow.steps.SynchronousNonBlockingStepExecution$1$1.call(SynchronousNonBlockingStepExecution.java:50)
      at hudson.security.ACL.impersonate(ACL.java:290)
      at org.jenkinsci.plugins.workflow.steps.SynchronousNonBlockingStepExecution$1.run(SynchronousNonBlockingStepExecution.java:47)
      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)
      Caused by: hudson.remoting.ChannelClosedException: Channel "unknown": Remote call on ubuntu-16-04-amd64-2 failed. The channel is closing down or has closed down
      at hudson.remoting.Channel.call(Channel.java:948)
      at hudson.FilePath.act(FilePath.java:1036)
      ... 12 more
      Caused by: java.io.IOException: Unexpected termination of the channel
      at hudson.remoting.SynchronousCommandTransport$ReaderThread.run(SynchronousCommandTransport.java:77)
      Caused by: java.io.EOFException
      at java.io.ObjectInputStream$PeekInputStream.readFully(ObjectInputStream.java:2679)
      at java.io.ObjectInputStream$BlockDataInputStream.readShort(ObjectInputStream.java:3154)
      at java.io.ObjectInputStream.readStreamHeader(ObjectInputStream.java:862)
      at java.io.ObjectInputStream.<init>(ObjectInputStream.java:358)
      at hudson.remoting.ObjectInputStreamEx.<init>(ObjectInputStreamEx.java:48)
      at hudson.remoting.AbstractSynchronousByteArrayCommandTransport.read(AbstractSynchronousByteArrayCommandTransport.java:36)
      at hudson.remoting.SynchronousCommandTransport$ReaderThread.run(SynchronousCommandTransport.java:63)

      I hope this somewhat helps.

      With best regards, Tom.

    Hi oleg_nenashev,

    Do you have any update on this?

    We have seen similar issues: The Jenkins Pipeline hangs when the node becomes unreachable at some point in time.

    It would be great to see this fixed. This issue sometimes blocks many jobs in the queue of our CI.

    In this case it was an intermittent networking issue:

    19:35:55 [Sat Jul 14 17:35:54 2018] Waiting for impl_1 to finish...
    19:37:32 /opt/Xilinx/Vivado/2018.1/bin/loader: line 194:  4860 Killed  "$RDI_PROG" "$@"
    19:37:32 Makefile:423: recipe for target '../../work/projects/dev1/dev1.sdk/dev1.hdf' failed
    19:37:32 make: *** [../../work/projects/dev1/dev1.sdk/dev1.hdf] Error 137
    19:37:32 make: *** Waiting for unfinished jobs....
    19:38:06 /opt/Xilinx/Vivado/2018.1/bin/loader: line 194:  4859 Killed  "$RDI_PROG" "$@"
    19:38:06 Makefile:423: recipe for target '../../work/projects/dev0/dev0.sdk/dev0.hdf' failed
    19:38:06 make: *** [../../work/projects/dev0/dev0.sdk/dev0.hdf] Error 137
    19:39:59 Cannot contact ubuntu-16-04-amd64-2: java.io.IOException: remote file operation failed: /var/jenkins/ubuntu-16-04-amd64/workspace/nts-fpga_branches_1.x-bwreq-YHXXBDM77DWWMJ4IUYUNRNT2YKWDIASW4VY4YNK2ULEAULWQGGJA/build/fpga-projects/build at hudson.remoting.Channel@​cf0f3fa:ubuntu-16-04-amd64-2: hudson.remoting.ChannelClosedException: Channel "unknown": Remote call on ubuntu-16-04-amd64-2 failed. The channel is closing down or has closed down
    19:40:30 /opt/Xilinx/Vivado/2018.1/bin/loader: line 194:  4861 Killed  "$RDI_PROG" "$@"
    19:40:30 Makefile:423: recipe for target '../../work/projects/dev2/dev2.sdk/dev2.hdf' failed
    19:40:30 make: *** [../../work/projects/dev2/dev2.sdk/dev2.hdf] Error 137
    
    

    finally, we aborted the build:

    Aborted by me
    09:41:29 Sending interrupt signal to process
    09:41:39 After 10s process did not stop
    
    

    Please note that in the post steps, we see the errors occur but the build no longer hangs here:

    Error when executing always post condition:
    java.io.IOException: remote file operation failed: /var/jenkins/ubuntu-16-04-amd64/workspace/nts-fpga_branches_1.x-bwreq-YHXXBDM77DWWMJ4IUYUNRNT2YKWDIASW4VY4YNK2ULEAULWQGGJA/packages at hudson.remoting.Channel@​cf0f3fa:ubuntu-16-04-amd64-2: hudson.remoting.ChannelClosedException: Channel "unknown": Remote call on ubuntu-16-04-amd64-2 failed. The channel is closing down or has closed down
    	at hudson.FilePath.act(FilePath.java:1043)
    	at hudson.FilePath.act(FilePath.java:1025)
    	at hudson.FilePath.mkdirs(FilePath.java:1213)
    	at org.jenkinsci.plugins.workflow.steps.CoreStep$Execution.run(CoreStep.java:79)
    	at org.jenkinsci.plugins.workflow.steps.CoreStep$Execution.run(CoreStep.java:67)
    	at org.jenkinsci.plugins.workflow.steps.SynchronousNonBlockingStepExecution$1$1.call(SynchronousNonBlockingStepExecution.java:50)
    	at hudson.security.ACL.impersonate(ACL.java:290)
    	at org.jenkinsci.plugins.workflow.steps.SynchronousNonBlockingStepExecution$1.run(SynchronousNonBlockingStepExecution.java:47)
    	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)
    Caused by: hudson.remoting.ChannelClosedException: Channel "unknown": Remote call on ubuntu-16-04-amd64-2 failed. The channel is closing down or has closed down
    	at hudson.remoting.Channel.call(Channel.java:948)
    	at hudson.FilePath.act(FilePath.java:1036)
    	... 12 more
    Caused by: java.io.IOException: Unexpected termination of the channel
    	at hudson.remoting.SynchronousCommandTransport$ReaderThread.run(SynchronousCommandTransport.java:77)
    Caused by: java.io.EOFException
    	at java.io.ObjectInputStream$PeekInputStream.readFully(ObjectInputStream.java:2679)
    	at java.io.ObjectInputStream$BlockDataInputStream.readShort(ObjectInputStream.java:3154)
    	at java.io.ObjectInputStream.readStreamHeader(ObjectInputStream.java:862)
    	at java.io.ObjectInputStream.<init>(ObjectInputStream.java:358)
    	at hudson.remoting.ObjectInputStreamEx.<init>(ObjectInputStreamEx.java:48)
    	at hudson.remoting.AbstractSynchronousByteArrayCommandTransport.read(AbstractSynchronousByteArrayCommandTransport.java:36)
    	at hudson.remoting.SynchronousCommandTransport$ReaderThread.run(SynchronousCommandTransport.java:63)
    
    [Pipeline] cleanWs
    Error when executing cleanup post condition:
    java.io.IOException: remote file operation failed: /var/jenkins/ubuntu-16-04-amd64/workspace/nts-fpga_branches_1.x-bwreq-YHXXBDM77DWWMJ4IUYUNRNT2YKWDIASW4VY4YNK2ULEAULWQGGJA at hudson.remoting.Channel@​cf0f3fa:ubuntu-16-04-amd64-2: hudson.remoting.ChannelClosedException: Channel "unknown": Remote call on ubuntu-16-04-amd64-2 failed. The channel is closing down or has closed down
    	at hudson.FilePath.act(FilePath.java:1043)
    	at hudson.FilePath.act(FilePath.java:1025)
    	at hudson.FilePath.mkdirs(FilePath.java:1213)
    	at org.jenkinsci.plugins.workflow.steps.CoreStep$Execution.run(CoreStep.java:79)
    	at org.jenkinsci.plugins.workflow.steps.CoreStep$Execution.run(CoreStep.java:67)
    	at org.jenkinsci.plugins.workflow.steps.SynchronousNonBlockingStepExecution$1$1.call(SynchronousNonBlockingStepExecution.java:50)
    	at hudson.security.ACL.impersonate(ACL.java:290)
    	at org.jenkinsci.plugins.workflow.steps.SynchronousNonBlockingStepExecution$1.run(SynchronousNonBlockingStepExecution.java:47)
    	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)
    Caused by: hudson.remoting.ChannelClosedException: Channel "unknown": Remote call on ubuntu-16-04-amd64-2 failed. The channel is closing down or has closed down
    	at hudson.remoting.Channel.call(Channel.java:948)
    	at hudson.FilePath.act(FilePath.java:1036)
    	... 12 more
    Caused by: java.io.IOException: Unexpected termination of the channel
    	at hudson.remoting.SynchronousCommandTransport$ReaderThread.run(SynchronousCommandTransport.java:77)
    Caused by: java.io.EOFException
    	at java.io.ObjectInputStream$PeekInputStream.readFully(ObjectInputStream.java:2679)
    	at java.io.ObjectInputStream$BlockDataInputStream.readShort(ObjectInputStream.java:3154)
    	at java.io.ObjectInputStream.readStreamHeader(ObjectInputStream.java:862)
    	at java.io.ObjectInputStream.<init>(ObjectInputStream.java:358)
    	at hudson.remoting.ObjectInputStreamEx.<init>(ObjectInputStreamEx.java:48)
    	at hudson.remoting.AbstractSynchronousByteArrayCommandTransport.read(AbstractSynchronousByteArrayCommandTransport.java:36)
    	at hudson.remoting.SynchronousCommandTransport$ReaderThread.run(SynchronousCommandTransport.java:63)
    
    

    I hope this somewhat helps.

    With best regards,
    Tom.

  14. jenkins-infra-bot commented on Jul 23, 2018

    @jenkins-infra-bot
    Author
    oleg_nenashev:
    • Original comment link
    • Raw content of original comment:

      tom_ghyselinck nope, I don't. I have requested info which is needed to diagnose the issue, but I have never reviewed it. I will unlikely have time for that in short-term, busy with other stuff in the community. jthompson is the current Remoting default assignee, so I will assign the issue to him.

       

    tom_ghyselinck nope, I don't. I have requested info which is needed to diagnose the issue, but I have never reviewed it. I will unlikely have time for that in short-term, busy with other stuff in the community. jthompson is the current Remoting default assignee, so I will assign the issue to him.

     

  15. 28 remaining items

  16. jenkins-infra-bot commented on Aug 16, 2019

    @jenkins-infra-bot
    Author
    piratejohnny:
    • Original comment link
    • Raw content of original comment:

      jglick Just wanted to thank you and everybody else who's been working on jenkins and to confirm that the work over on https://issues.jenkins-ci.org/browse/JENKINS-36013 appears to have handled this case in a much better way. I consider the current behavior to be a major step in the right direction for Jenkins. Here's what I noticed:

      Last night, our Jenkins worker pool did its normal scheduled nightly scale down and one of the pipelines got disrupted. The message I see in my affected pipeline's console log is: Agent ip-172-31-235-152.us-west-2.compute.internal was deleted; cancelling node body The above mentioned hostname is the one that Jenkins selected at at the top of my declarative pipeline as a result of my call for a 'universal' machine (universal is how we label all of our workers):  pipeline

      { agent \{ label 'universal' }

      ... This particular declarative pipeline tries to "sh" to the console at the end inside a post{} section and clean up after itself, but since the node was lost, the next error that also appears in the Jenkins console log is: org.jenkinsci.plugins.workflow.steps.MissingContextVariableException: Required context class hudson.FilePath is missing This error was the result of the following code: post { always { sh """|#!/bin/bash

      set -x
      docker ps -a -q xargs --no-run-if-empty docker rm -f true
      """.stripMargin() ... Let me just point out that the recent Jenkins advancements are fantastic. Before JENKINS-36013, this pipeline would have just been stuck with no error messages. I'm so happy with this progress you have no idea.

      Now if there's any way to get this to actually retry the step it was on such that the pipeline can actually tolerate losing the node, we would have the best of all worlds. At my company, the fact that a node is deleted during a scaledown is a confusing irrelevant problem for one of my developers to grapple with. The job of my developers (the folks writing Jenkins pipelines) is to write idempotent pipeline steps and my job is make sure all of the developer's steps trigger and the pipeline concludes with a high amount of durability.

      Keep up the great work you are all doing. This is great.

    jglick Just wanted to thank you and everybody else who's been working on jenkins and to confirm that the work over on https://issues.jenkins-ci.org/browse/JENKINS-36013 appears to have handled this case in a much better way. I consider the current behavior to be a major step in the right direction for Jenkins. Here's what I noticed:

    Last night, our Jenkins worker pool did its normal scheduled nightly scale down and one of the pipelines got disrupted. The message I see in my affected pipeline's console log is:
    Agent ip-172-31-235-152.us-west-2.compute.internal was deleted; cancelling node body
    The above mentioned hostname is the one that Jenkins selected at at the top of my declarative pipeline as a result of my call for a 'universal' machine (universal is how we label all of our workers): 
    pipeline

    { agent \{ label 'universal' }

    ...
    This particular declarative pipeline tries to "sh" to the console at the end inside a post{} section and clean up after itself, but since the node was lost, the next error that also appears in the Jenkins console log is:
    org.jenkinsci.plugins.workflow.steps.MissingContextVariableException: Required context class hudson.FilePath is missing
    This error was the result of the following code:
    post {
    always {
    sh """|#!/bin/bash

    set -x
    docker ps -a -q xargs --no-run-if-empty docker rm -f true
    """.stripMargin()
    ...
    Let me just point out that the recent Jenkins advancements are fantastic. Before JENKINS-36013">JENKINS-36013, this pipeline would have just been stuck with no error messages. I'm so happy with this progress you have no idea.

    Now if there's any way to get this to actually retry the step it was on such that the pipeline can actually tolerate losing the node, we would have the best of all worlds. At my company, the fact that a node is deleted during a scaledown is a confusing irrelevant problem for one of my developers to grapple with. The job of my developers (the folks writing Jenkins pipelines) is to write idempotent pipeline steps and my job is make sure all of the developer's steps trigger and the pipeline concludes with a high amount of durability.

    Keep up the great work you are all doing. This is great.

  17. jenkins-infra-bot commented on Aug 16, 2019

    @jenkins-infra-bot
    Author
    jglick:
    • Original comment link
    • Raw content of original comment:

      The MissingContextVariableException is tracked by JENKINS-58900. That is just a bad error message, though; the point is that the node is gone.

      if there's any way to get this to actually retry the step it was on such that the pipeline can actually tolerate losing the node

      Well that is the primary subject of this RFE, my “subcase #1” above. Pending a supported feature, you might be able to hack something up in a trusted Scripted library like

      while (true) {
        try {
          node('spotty') {
            sh '…'
          }
          break
        } catch (x) {
          if (x instanceof org.jenkinsci.plugins.workflow.steps.FlowInterruptedException &&
              x.causes*.getClass().contains(org.jenkinsci.plugins.workflow.support.steps.ExecutorStepExecution.RemovedNodeCause)) {
            continue
          } else {
            throw x
          }
        }
      }
      

    The MissingContextVariableException is tracked by JENKINS-58900">JENKINS-58900. That is just a bad error message, though; the point is that the node is gone.

    if there's any way to get this to actually retry the step it was on such that the pipeline can actually tolerate losing the node

    Well that is the primary subject of this RFE, my “subcase #1” above. Pending a supported feature, you might be able to hack something up in a trusted Scripted library like

    while (true) {
      try {
        node('spotty') {
          sh '…'
        }
        break
      } catch (x) {
        if (x instanceof org.jenkinsci.plugins.workflow.steps.FlowInterruptedException &&
    x.causes*.getClass().contains(org.jenkinsci.plugins.workflow.support.steps.ExecutorStepExecution.RemovedNodeCause)) {
          continue
        } else {
          throw x
        }
      }
    }
    
  18. jenkins-infra-bot commented on Nov 19, 2019

    @jenkins-infra-bot
    Author
    oxygenxo:
    • Original comment link
    • Raw content of original comment:

      We use kubernetes plugin with our bare-metal kubernetes cluster and the problem is that pipeline can run indefinitely  if agent inside pod were killed/underlying node was restarted. Is there any option to tweak such behavior, e.g. some timeout settings (except explicit timeout step)?

    We use kubernetes plugin with our bare-metal kubernetes cluster and the problem is that pipeline can run indefinitely  if agent inside pod were killed/underlying node was restarted. Is there any option to tweak such behavior, e.g. some timeout settings (except explicit timeout step)?

  19. jenkins-infra-bot commented on Nov 19, 2019

    @jenkins-infra-bot
    Author
    jglick:
    • Original comment link
    • Raw content of original comment:

      oxygenxo that should have already been fixed—see linked PRs.

    oxygenxo that should have already been fixed—see linked PRs.

  20. jenkins-infra-bot commented on Nov 15, 2021

    @jenkins-infra-bot
    Author
    jglick:

    A very limited variant of this concept (likely not compatible with Pipeline) is implemented in the EC2 Fleet plugin: https://github.com/jenkinsci/ec2-fleet-plugin/blob/2d4ed2bd0b05b1b3778ec7508923e21db0f9eb7b/src/main/java/com/amazon/jenkins/ec2fleet/EC2FleetAutoResubmitComputerLauncher.java#L87-L108

  21. jenkins-infra-bot commented on Dec 12, 2025

    @jenkins-infra-bot
    Author

    [Original depends_on from Jira: JENKINS-30383]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions