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

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

    XMLWordPrintable

    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

            Hide
            oleg_nenashev Oleg Nenashev added a comment -

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

            Show
            oleg_nenashev Oleg Nenashev added a comment - The fix has been released in Windows Agent Installer 1.9.2 and then integrated towards Jenkins 2.90
            Hide
            scm_issue_link 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)

            Show
            scm_issue_link 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)
            Hide
            vadivel 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)

            Show
            vadivel 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)
            Hide
            oleg_nenashev Oleg Nenashev added a comment -

            Vadivel Natarajanwith 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

            Show
            oleg_nenashev Oleg Nenashev added a comment - Vadivel Natarajan 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
            Hide
            oleg_nenashev Oleg Nenashev added a comment -

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

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

              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: