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

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

      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
      

       

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

          Oleg Nenashev added a comment -

          Nope, I missed the notification in GitHub. Will take a look.

          Usually we mark issues as resolved only when they are merged.

           

          Oleg Nenashev added a comment - Nope, I missed the notification in GitHub. Will take a look. Usually we mark issues as resolved only when they are merged.  

          Elton Alves added a comment -

          oleg_nenashev oh.. im sorry, i will pay attention next time. 

          Elton Alves added a comment - oleg_nenashev oh.. im sorry, i will pay attention next time. 

          Code changed in jenkins
          User: Elton Alves
          Path:
          src/main/java/org/jenkinsci/modules/windows_slave_installer/SlaveExeUpdater.java
          http://jenkins-ci.org/commit/windows-slave-installer-module/cf7c888a4440acc17096f74e4bc18bb679525a54
          Log:
          [FIX JENKINS-47015] Windows Agent Installer should not try to update … (#17)

          • [FIX JENKINS-47015] Windows Agent Installer should not try to update jenkins-slave.exe on Unix agents
          • [FIX JENKINS-47015] Windows Agent Installer should not try to update jenkins-slave.exe on Unix agents
          • [FIX JENKINS-47015] Windows Agent Installer should not try to update jenkins-slave.exe on Unix agents
          • Update SlaveExeUpdater.java
          • [FIX JENKINS-47015] Windows Agent Installer should not try to update jenkins-slave.exe on Unix agents
          • Update SlaveExeUpdater.java
          • Checking unix slave agent

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

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: Elton Alves Path: src/main/java/org/jenkinsci/modules/windows_slave_installer/SlaveExeUpdater.java http://jenkins-ci.org/commit/windows-slave-installer-module/cf7c888a4440acc17096f74e4bc18bb679525a54 Log: [FIX JENKINS-47015] Windows Agent Installer should not try to update … (#17) [FIX JENKINS-47015] Windows Agent Installer should not try to update jenkins-slave.exe on Unix agents [FIX JENKINS-47015] Windows Agent Installer should not try to update jenkins-slave.exe on Unix agents [FIX JENKINS-47015] Windows Agent Installer should not try to update jenkins-slave.exe on Unix agents Update SlaveExeUpdater.java [FIX JENKINS-47015] Windows Agent Installer should not try to update jenkins-slave.exe on Unix agents Update SlaveExeUpdater.java Checking unix slave agent Windows Agent Installer should not try to update jenkins-slave.exe on Unix agents JENKINS-47015 - Fix typo

          Code changed in jenkins
          User: Oleg Nenashev
          Path:
          war/pom.xml
          http://jenkins-ci.org/commit/jenkins/3f43b4c3adb285cc3539638f2ff099c0b81f969b
          Log:
          JENKINS-47015 - Update Windows Slave Installer module to 1.9.2

          It picks new release with one bugfix / performance improvement. Changelog: https://github.com/jenkinsci/windows-slave-installer-module/blob/master/CHANGELOG.md#192

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: Oleg Nenashev Path: war/pom.xml http://jenkins-ci.org/commit/jenkins/3f43b4c3adb285cc3539638f2ff099c0b81f969b Log: JENKINS-47015 - Update Windows Slave Installer module to 1.9.2 It picks new release with one bugfix / performance improvement. Changelog: https://github.com/jenkinsci/windows-slave-installer-module/blob/master/CHANGELOG.md#192

          Code changed in jenkins
          User: Oleg Nenashev
          Path:
          war/pom.xml
          http://jenkins-ci.org/commit/jenkins/d27949cddc077d673b7b647737024a383e2ca063
          Log:
          Merge pull request #3130 from oleg-nenashev/windows-slave-installer/1.9.2

          JENKINS-47015 - Update Windows Slave Installer module to 1.9.2

          Compare: https://github.com/jenkinsci/jenkins/compare/397b4fae8e73...d27949cddc07

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: Oleg Nenashev Path: war/pom.xml http://jenkins-ci.org/commit/jenkins/d27949cddc077d673b7b647737024a383e2ca063 Log: Merge pull request #3130 from oleg-nenashev/windows-slave-installer/1.9.2 JENKINS-47015 - Update Windows Slave Installer module to 1.9.2 Compare: https://github.com/jenkinsci/jenkins/compare/397b4fae8e73...d27949cddc07

          Oleg Nenashev added a comment -

          The fix has been released in Windows Agent Installer 1.9.2 and then integrated towards Jenkins 2.90

          Oleg Nenashev added a comment - The fix has been released in Windows Agent Installer 1.9.2 and then integrated towards Jenkins 2.90

          Code changed in jenkins
          User: Oleg Nenashev
          Path:
          war/pom.xml
          http://jenkins-ci.org/commit/jenkins/c624f66dc40828ed69424da68c263bcd02327318
          Log:
          JENKINS-47015 - Update Windows Slave Installer module to 1.9.2

          It picks new release with one bugfix / performance improvement. Changelog: https://github.com/jenkinsci/windows-slave-installer-module/blob/master/CHANGELOG.md#192

          (cherry picked from commit 3f43b4c3adb285cc3539638f2ff099c0b81f969b)

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: Oleg Nenashev Path: war/pom.xml http://jenkins-ci.org/commit/jenkins/c624f66dc40828ed69424da68c263bcd02327318 Log: JENKINS-47015 - Update Windows Slave Installer module to 1.9.2 It picks new release with one bugfix / performance improvement. Changelog: https://github.com/jenkinsci/windows-slave-installer-module/blob/master/CHANGELOG.md#192 (cherry picked from commit 3f43b4c3adb285cc3539638f2ff099c0b81f969b)

          Vadivel Natarajan added a comment - - edited

          Hi oleg_nenashev,

           We upgraded Jenkins v2.90 version. Still we are facing channels closed exception.Can you  please check and update reason?

          Environment:

          Jenkins server: Linux machine

          Slave :Windows slave. Windows 10 OS. 

          Error Details

          Connection was broken: java.nio.channels.ClosedChannelException

                        at org.jenkinsci.remoting.protocol.impl.ChannelApplicationLayer.onReadClosed(ChannelApplicationLayer.java:208)

                        at org.jenkinsci.remoting.protocol.ApplicationLayer.onRecvClosed(ApplicationLayer.java:222)

                        at org.jenkinsci.remoting.protocol.ProtocolStack$Ptr.onRecvClosed(ProtocolStack.java:832)

                        at org.jenkinsci.remoting.protocol.FilterLayer.onRecvClosed(FilterLayer.java:287)

                        at org.jenkinsci.remoting.protocol.impl.SSLEngineFilterLayer.onRecvClosed(SSLEngineFilterLayer.java:181)

                        at org.jenkinsci.remoting.protocol.impl.SSLEngineFilterLayer.switchToNoSecure(SSLEngineFilterLayer.java:283)

                        at org.jenkinsci.remoting.protocol.impl.SSLEngineFilterLayer.processWrite(SSLEngineFilterLayer.java:503)

                        at org.jenkinsci.remoting.protocol.impl.SSLEngineFilterLayer.processQueuedWrites(SSLEngineFilterLayer.java:248)

                        at org.jenkinsci.remoting.protocol.impl.SSLEngineFilterLayer.doSend(SSLEngineFilterLayer.java:200)

                        at org.jenkinsci.remoting.protocol.impl.SSLEngineFilterLayer.doCloseSend(SSLEngineFilterLayer.java:213)

                        at org.jenkinsci.remoting.protocol.ProtocolStack$Ptr.doCloseSend(ProtocolStack.java:800)

                        at org.jenkinsci.remoting.protocol.ApplicationLayer.doCloseWrite(ApplicationLayer.java:173)

                        at org.jenkinsci.remoting.protocol.impl.ChannelApplicationLayer$ByteBufferCommandTransport.closeWrite(ChannelApplicationLayer.java:311)

                        at hudson.remoting.Channel.close(Channel.java:1405)

                        at hudson.remoting.Channel.close(Channel.java:1358)

                        at hudson.slaves.SlaveComputer.closeChannel(SlaveComputer.java:737)

                        at hudson.slaves.SlaveComputer.access$800(SlaveComputer.java:96)

                        at hudson.slaves.SlaveComputer$3.run(SlaveComputer.java:655)

                        at jenkins.util.ContextResettingExecutorService$1.run(ContextResettingExecutorService.java:28)

                        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:1142)

                        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)

                        at java.lang.Thread.run(Thread.java:748)

          Vadivel Natarajan added a comment - - edited Hi oleg_nenashev ,  We upgraded Jenkins v2.90 version. Still we are facing channels closed exception.Can you  please check and update reason? Environment: Jenkins server: Linux machine Slave :Windows slave. Windows 10 OS.  Error Details Connection was broken: java.nio.channels. ClosedChannelException               at org.jenkinsci.remoting.protocol.impl.ChannelApplicationLayer.onReadClosed(ChannelApplicationLayer.java:208)               at org.jenkinsci.remoting.protocol.ApplicationLayer.onRecvClosed(ApplicationLayer.java:222)               at org.jenkinsci.remoting.protocol.ProtocolStack$Ptr.onRecvClosed(ProtocolStack.java:832)               at org.jenkinsci.remoting.protocol.FilterLayer.onRecvClosed(FilterLayer.java:287)               at org.jenkinsci.remoting.protocol.impl.SSLEngineFilterLayer.onRecvClosed(SSLEngineFilterLayer.java:181)               at org.jenkinsci.remoting.protocol.impl.SSLEngineFilterLayer.switchToNoSecure(SSLEngineFilterLayer.java:283)               at org.jenkinsci.remoting.protocol.impl.SSLEngineFilterLayer.processWrite(SSLEngineFilterLayer.java:503)               at org.jenkinsci.remoting.protocol.impl.SSLEngineFilterLayer.processQueuedWrites(SSLEngineFilterLayer.java:248)               at org.jenkinsci.remoting.protocol.impl.SSLEngineFilterLayer.doSend(SSLEngineFilterLayer.java:200)               at org.jenkinsci.remoting.protocol.impl.SSLEngineFilterLayer.doCloseSend(SSLEngineFilterLayer.java:213)               at org.jenkinsci.remoting.protocol.ProtocolStack$Ptr.doCloseSend(ProtocolStack.java:800)               at org.jenkinsci.remoting.protocol.ApplicationLayer.doCloseWrite(ApplicationLayer.java:173)               at org.jenkinsci.remoting.protocol.impl.ChannelApplicationLayer$ByteBufferCommandTransport.closeWrite(ChannelApplicationLayer.java:311)               at hudson.remoting.Channel.close(Channel.java:1405)               at hudson.remoting.Channel.close(Channel.java:1358)               at hudson.slaves.SlaveComputer.closeChannel(SlaveComputer.java:737)               at hudson.slaves.SlaveComputer.access$800(SlaveComputer.java:96)               at hudson.slaves.SlaveComputer$3.run(SlaveComputer.java:655)               at jenkins.util.ContextResettingExecutorService$1.run(ContextResettingExecutorService.java:28)               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:1142)               at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)               at java.lang.Thread.run(Thread.java:748)

          Oleg Nenashev added a comment -

          vadivelwith the current stacktrace I cannot say anything. Please create a new JIRA ticket and provide master and agent logs there + info about Remoting version on the agent

          Oleg Nenashev added a comment - vadivel with the current stacktrace I cannot say anything. Please create a new JIRA ticket and provide master and agent logs there + info about Remoting version on the agent

          Oleg Nenashev added a comment -

          vadivel whatever you experience is unlikely unrelated to this ticket. please follow the guidelines above

          Oleg Nenashev added a comment - vadivel whatever you experience is unlikely unrelated to this ticket. please follow the guidelines above

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

              Created:
              Updated:
              Resolved: