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

Windows Agent Installer should not try to update jenkins-slave.exe on Unix agents

    Details

    • Similar Issues:

      Description

      SlaveExeUpdater logic does not check whether the agent is a Unix one before submitting the delayed EXE file update task when the agent connects. Ideally the listener should check whether the channel is connected to Unix machine and exit if yes (there is a flag for it)

      Code: https://github.com/jenkinsci/windows-slave-installer-module/blob/master/src/main/java/org/jenkinsci/modules/windows_slave_installer/SlaveExeUpdater.java

      It was reported in JENKINS-47011:

       

      JNLP agent connected from ****.com/.*..*
      Remoting version: 3.12
      This is a Unix agent
      ERROR: Connection terminated
      java.nio.channels.ClosedChannelException
       at org.jenkinsci.remoting.protocol.NetworkLayer.onRecvClosed(NetworkLayer.java:154)
       at org.jenkinsci.remoting.protocol.impl.NIONetworkLayer.ready(NIONetworkLayer.java:142)
       at org.jenkinsci.remoting.protocol.IOHub$OnReady.run(IOHub.java:721)
       at jenkins.util.ContextResettingExecutorService$1.run(ContextResettingExecutorService.java:28)
       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)
      ERROR: Failed to install restarter
      java.nio.channels.ClosedChannelException
       at org.jenkinsci.remoting.protocol.NetworkLayer.onRecvClosed(NetworkLayer.java:154)
       at org.jenkinsci.remoting.protocol.impl.NIONetworkLayer.ready(NIONetworkLayer.java:142)
       at org.jenkinsci.remoting.protocol.IOHub$OnReady.run(IOHub.java:721)
       at jenkins.util.ContextResettingExecutorService$1.run(ContextResettingExecutorService.java:28)
      Caused: hudson.remoting.ChannelClosedException: Remote call on JNLP4-connect connection from ****.com/.*..*:44882 failed. The channel is closing down or has closed down
       at hudson.remoting.Channel.call(Channel.java:897)
       at jenkins.slaves.restarter.JnlpSlaveRestarterInstaller.install(JnlpSlaveRestarterInstaller.java:53)
       at jenkins.slaves.restarter.JnlpSlaveRestarterInstaller.access$000(JnlpSlaveRestarterInstaller.java:34)
       at jenkins.slaves.restarter.JnlpSlaveRestarterInstaller$1.call(JnlpSlaveRestarterInstaller.java:40)
       at jenkins.slaves.restarter.JnlpSlaveRestarterInstaller$1.call(JnlpSlaveRestarterInstaller.java:37)
       at jenkins.util.ContextResettingExecutorService$2.call(ContextResettingExecutorService.java:46)
       at java.util.concurrent.FutureTask.run(FutureTask.java:266)
       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)
      Agent successfully connected and online
      ERROR: Failed to update jenkins-slave.exe
      java.io.IOException: remote file operation failed: /media/data/jenkins/jenkins-slave.exe at hudson.remoting.Channel@7607078e:JNLP4-connect connection from ****.com/.*..:44882: hudson.remoting.ChannelClosedException: Remote call on JNLP4-connect connection from *****.com/.*..*:44882 failed. The channel is closing down or has closed down
       at hudson.FilePath.act(FilePath.java:994)
       at hudson.FilePath.act(FilePath.java:976)
       at hudson.FilePath.exists(FilePath.java:1441)
       at org.jenkinsci.modules.windows_slave_installer.SlaveExeUpdater$1.call(SlaveExeUpdater.java:62)
       at org.jenkinsci.modules.windows_slave_installer.SlaveExeUpdater$1.call(SlaveExeUpdater.java:53)
       at jenkins.util.ContextResettingExecutorService$2.call(ContextResettingExecutorService.java:46)
       at java.util.concurrent.FutureTask.run(FutureTask.java:266)
       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.remoting.ChannelClosedException: Remote call on JNLP4-connect connection from ****.com/.*..*:44882 failed. The channel is closing down or has closed down
       at hudson.remoting.Channel.call(Channel.java:897)
       at hudson.FilePath.act(FilePath.java:987)
       ... 9 more
      Caused by: java.nio.channels.ClosedChannelException
       at org.jenkinsci.remoting.protocol.NetworkLayer.onRecvClosed(NetworkLayer.java:154)
       at org.jenkinsci.remoting.protocol.impl.NIONetworkLayer.ready(NIONetworkLayer.java:142)
       at org.jenkinsci.remoting.protocol.IOHub$OnReady.run(IOHub.java:721)
       at jenkins.util.ContextResettingExecutorService$1.run(ContextResettingExecutorService.java:28)
       ... 3 more
      

       

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                tonho Elton Alves
                Reporter:
                oleg_nenashev Oleg Nenashev
              • Votes:
                0 Vote for this issue
                Watchers:
                4 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: