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

            oleg_nenashev Oleg Nenashev created issue -
            oleg_nenashev Oleg Nenashev made changes -
            Field Original Value New Value
            Link This issue is related to JENKINS-47011 [ JENKINS-47011 ]
            oleg_nenashev Oleg Nenashev made changes -
            Assignee Oleg Nenashev [ oleg_nenashev ]
            Hide
            oleg_nenashev Oleg Nenashev added a comment -

            This logic uses Remoting threadPool without a specific reason for that. So I will add it to the scope of JENKINS-27514

            Show
            oleg_nenashev Oleg Nenashev added a comment - This logic uses Remoting threadPool without a specific reason for that. So I will add it to the scope of JENKINS-27514
            oleg_nenashev Oleg Nenashev made changes -
            Epic Link JENKINS-27514 [ 161316 ]
            tonho Elton Alves made changes -
            Assignee Elton Alves [ tonho ]
            tonho Elton Alves made changes -
            Status Open [ 1 ] In Progress [ 3 ]
            tonho Elton Alves made changes -
            Status In Progress [ 3 ] Open [ 1 ]
            tonho Elton Alves made changes -
            Resolution Fixed [ 1 ]
            Status Open [ 1 ] Resolved [ 5 ]
            Hide
            oleg_nenashev Oleg Nenashev added a comment -

            Elton Alves why do you think that it's fixed?

            Show
            oleg_nenashev Oleg Nenashev added a comment - Elton Alves why do you think that it's fixed?
            Hide
            tonho Elton Alves added a comment - - edited

            Oleg Nenashev did u check the pr? do i did something wrong?

            Show
            tonho Elton Alves added a comment - - edited Oleg Nenashev  did u check the pr? do i did something wrong?
            oleg_nenashev Oleg Nenashev made changes -
            Status Resolved [ 5 ] In Review [ 10005 ]
            oleg_nenashev Oleg Nenashev made changes -
            Remote Link This issue links to "https://github.com/jenkinsci/windows-slave-installer-module/pull/17 (Web Link)" [ 17846 ]
            Hide
            oleg_nenashev 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.

             

            Show
            oleg_nenashev 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.  
            Hide
            tonho Elton Alves added a comment -

            Oleg Nenashev oh.. im sorry, i will pay attention next time. 

            Show
            tonho Elton Alves added a comment - Oleg Nenashev oh.. im sorry, i will pay attention next time. 
            Hide
            scm_issue_link 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

            Show
            scm_issue_link 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
            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/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

            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/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
            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/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

            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/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
            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
            oleg_nenashev Oleg Nenashev made changes -
            Status In Review [ 10005 ] Resolved [ 5 ]
            oleg_nenashev Oleg Nenashev made changes -
            Labels linux newbie-friendly windows linux lts-candidate newbie-friendly windows
            olivergondza Oliver Gondža made changes -
            Labels linux lts-candidate newbie-friendly windows 2.89.1-fixed linux newbie-friendly windows
            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
            vadivel Vadivel Natarajan made changes -
            Resolution Fixed [ 1 ]
            Status Resolved [ 5 ] Reopened [ 4 ]
            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
            oleg_nenashev Oleg Nenashev made changes -
            Resolution Fixed [ 1 ]
            Status Reopened [ 4 ] Resolved [ 5 ]

              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: