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

java.io.IOException: Unexpected termination of the channel

    XMLWordPrintable

Details

    • Bug
    • Status: Resolved (View Workflow)
    • Minor
    • Resolution: Cannot Reproduce
    • remoting, ssh-slaves-plugin

    Description

      We are seeing slaves being displayed as offline with an Unexpected termination of channel IO exception. The slaves are actually running as seen in our AWS Management Console but the connection between jenkins master and the slave is broken. This behavior is fairly recent starting with maybe 1.584.

      Attachments

        Issue Links

          Activity

            Which SSH Slaves Plugin version do you use? Did you add the `-workDir AGENT_WORK_DIR` parameter to your suffix command configuration to grab the logs?

            https://github.com/jenkinsci/remoting/blob/master/docs/workDir.md

            ifernandezcalvo Ivan Fernandez Calvo added a comment - Which SSH Slaves Plugin version do you use? Did you add the `-workDir AGENT_WORK_DIR` parameter to your suffix command configuration to grab the logs? https://github.com/jenkinsci/remoting/blob/master/docs/workDir.md

            Also I have restarted Jenkins instance then agent which is configured on windows with JNLP got offline and its not coming online, its showing below error.

            Aug 29, 2018 1:43:04 PM hudson.remoting.jnlp.Main$CuiListener status
            INFO: Locating server among http://x.x.x.x:x/jenkins/
            Aug 29, 2018 1:43:04 PM org.jenkinsci.remoting.engine.JnlpAgentEndpointResolver resolve
            INFO: Remoting server accepts the following protocols: [JNLP4-connect, Ping]
            Aug 29, 2018 1:43:04 PM hudson.remoting.jnlp.Main$CuiListener status
            INFO: Agent discovery successful
              Agent address: x.x.x.x
              Agent port:    37091
              Identity:      51:a8:0d:a8:18:dd:db:d8:ea:18:b7:98:da:76:b2:ae
            Aug 29, 2018 1:43:04 PM hudson.remoting.jnlp.Main$CuiListener status
            INFO: Handshaking
            Aug 29, 2018 1:43:04 PM hudson.remoting.jnlp.Main$CuiListener status
            INFO: Connecting to x.x.x.x:37091
            Aug 29, 2018 1:43:35 PM hudson.remoting.jnlp.Main$CuiListener status
            INFO: Connecting to x.x.x.x:37091 (retrying:2)
            java.io.IOException: Failed to connect to x.x.x.x:37091
             at org.jenkinsci.remoting.engine.JnlpAgentEndpoint.open(JnlpAgentEndpoint.java:242)
             at hudson.remoting.Engine.connect(Engine.java:686)
             at hudson.remoting.Engine.innerRun(Engine.java:547)
             at hudson.remoting.Engine.run(Engine.java:469)
            Caused by: java.net.ConnectException: Connection timed out: connect
             at sun.nio.ch.Net.connect0(Native Method)
             at sun.nio.ch.Net.connect(Unknown Source)
             at sun.nio.ch.Net.connect(Unknown Source)
             at sun.nio.ch.SocketChannelImpl.connect(Unknown Source)
             at java.nio.channels.SocketChannel.open(Unknown Source)
             at org.jenkinsci.remoting.engine.JnlpAgentEndpoint.open(JnlpAgentEndpoint.java:203)
             ... 3 more

             

            Could you please help me out please?

            just replaced master IP with x.x.x.x.

            shrapm shraddha Magar added a comment - Also I have restarted Jenkins instance then agent which is configured on windows with JNLP got offline and its not coming online, its showing below error. Aug 29, 2018 1:43:04 PM hudson.remoting.jnlp.Main$CuiListener status INFO: Locating server among http://x.x.x.x:x/jenkins/ Aug 29, 2018 1:43:04 PM org.jenkinsci.remoting.engine.JnlpAgentEndpointResolver resolve INFO: Remoting server accepts the following protocols: [JNLP4-connect, Ping] Aug 29, 2018 1:43:04 PM hudson.remoting.jnlp.Main$CuiListener status INFO: Agent discovery successful   Agent address: x.x.x.x   Agent port:    37091   Identity:      51:a8:0d:a8:18:dd:db:d8:ea:18:b7:98:da:76:b2:ae Aug 29, 2018 1:43:04 PM hudson.remoting.jnlp.Main$CuiListener status INFO: Handshaking Aug 29, 2018 1:43:04 PM hudson.remoting.jnlp.Main$CuiListener status INFO: Connecting to x.x.x.x:37091 Aug 29, 2018 1:43:35 PM hudson.remoting.jnlp.Main$CuiListener status INFO: Connecting to x.x.x.x:37091 (retrying:2) java.io.IOException: Failed to connect to x.x.x.x:37091  at org.jenkinsci.remoting.engine.JnlpAgentEndpoint.open(JnlpAgentEndpoint.java:242)  at hudson.remoting.Engine.connect(Engine.java:686)  at hudson.remoting.Engine.innerRun(Engine.java:547)  at hudson.remoting.Engine.run(Engine.java:469) Caused by: java.net.ConnectException: Connection timed out: connect  at sun.nio.ch.Net.connect0(Native Method)  at sun.nio.ch.Net.connect(Unknown Source)  at sun.nio.ch.Net.connect(Unknown Source)  at sun.nio.ch.SocketChannelImpl.connect(Unknown Source)  at java.nio.channels.SocketChannel.open(Unknown Source)  at org.jenkinsci.remoting.engine.JnlpAgentEndpoint.open(JnlpAgentEndpoint.java:203)  ... 3 more   Could you please help me out please? just replaced master IP with x.x.x.x.

            This Windows Agent is a JNLP Agent, so your issue is not related to SSH Slaves plugin.

            It seems a network/configuration issue, not a bug, ask on the google user groups see https://wiki.jenkins.io/display/JENKINS/How+to+report+an+issue

            ifernandezcalvo Ivan Fernandez Calvo added a comment - This Windows Agent is a JNLP Agent, so your issue is not related to SSH Slaves plugin. It seems a network/configuration issue, not a bug, ask on the google user groups see https://wiki.jenkins.io/display/JENKINS/How+to+report+an+issue

            yes. this agent is configured through JNLP.

            and other issue is for AIX machine. we have agents configured on both AIX and Windows. we are using ssh slave plugin 1.26.

            shrapm shraddha Magar added a comment - yes. this agent is configured through JNLP. and other issue is for AIX machine. we have agents configured on both AIX and Windows. we are using ssh slave plugin 1.26.

            I'm posting here because this was the most prominent result in google and I wanna share my solution in case it also helps somebody else.

            The last lines in our jenkins node log on the master instance were:

            Sep 23, 2022 10:56:28 AM null
            INFO: Launching Jenkins agent via plugin SSH: java -jar /tmp/agent.jar
            Sep 23, 2022 10:56:28 AM null
            WARNING: Error:  Exception: java.io.EOFException: unexpected stream termination

            Running the command `java -jar /tmp/agent.jar` on the node revealed that the used java version could not run the new jar - which was probably introduced by some jenkins und plugin update.

            Upgrading the node host from OpenJDK 8 to 11 fixed the problem for us.

            spiegelm Michael Spiegel added a comment - I'm posting here because this was the most prominent result in google and I wanna share my solution in case it also helps somebody else. The last lines in our jenkins node log on the master instance were: Sep 23, 2022 10:56:28 AM null INFO: Launching Jenkins agent via plugin SSH: java -jar /tmp/agent.jar Sep 23, 2022 10:56:28 AM null WARNING: Error:  Exception: java.io.EOFException: unexpected stream termination Running the command `java -jar /tmp/agent.jar` on the node revealed that the used java version could not run the new jar - which was probably introduced by some jenkins und plugin update. Upgrading the node host from OpenJDK 8 to 11 fixed the problem for us.

            People

              ifernandezcalvo Ivan Fernandez Calvo
              balsamiqluis2 Luis Arias
              Votes:
              17 Vote for this issue
              Watchers:
              28 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: