Uploaded image for project: 'MINA SSHD'
  1. MINA SSHD
  2. SSHD-795

IOException (Broken pipe) on a socket local forwarding channel causes SSH client-server connection down

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 1.7.0
    • 2.0.0
    • None

    Description

      Hi,

      I have a problem with local port forwarding mechanism implemented in Apache SSHD.

      In my company we successfully use Apache SSHD library for secure local socket forwarding protocols.

      When on a local port forwarding channel an IOException (Broken pipe) happen for some reason (network, etc...), the SSH client server is being disconnected abruptly.

      I'm not convinced this is the right behavior. I think it is not necessary to bring down SSH client server connection because this is not a protocol violation, but a socket problem related to forwarded remote server connection.

      Please, can you comment about this issue ?

      Follow an excerpt of the traces :

      2018-01-23 10:30:10,017 DEBUG [sshd-SshServer[1786f9d5]-nio2-thread-2       ] [Nio2Session.handleWriteCycleFailure] handleWriteCycleFailure(Nio2Session[local=/192.168.180.70:38957, remote=/192.168.10.31:36228]) failed (IOException) to write 32768 bytes: Broken pipe
      2018-01-23 10:30:10,017 DEBUG [sshd-SshServer[1786f9d5]-nio2-thread-3       ] [Window.waitForSpace] waitForSpace(Window[server/remote](TcpipServerChannel[id=662, recipient=11]-ServerSessionImpl[circessh@/192.168.190.2:14840])) available: 1146880
      2018-01-23 10:30:10,017 DEBUG [sshd-SshServer[1786f9d5]-nio2-thread-2       ] [TcpipServerChannel.handleWriteDataFailure] handleWriteDataFailure(TcpipServerChannel[id=662, recipient=11]-ServerSessionImpl[circessh@/192.168.190.2:14840])[SSH_MSG_CHANNEL_DATA] failed (IOException) to write len=32768: Broken pipe
      2018-01-23 10:30:10,018 WARN  [sshd-SshServer[1786f9d5]-nio2-thread-2       ] [AbstractSession.exceptionCaught] exceptionCaught(ServerSessionImpl[circessh@/192.168.190.2:14840])[state=Opened] IOException: Broken pipe
      2018-01-23 10:30:10,018 DEBUG [sshd-SshServer[1786f9d5]-nio2-thread-3       ] [Window.waitAndConsume] waitAndConsume(Window[server/remote](TcpipServerChannel[id=662, recipient=11]-ServerSessionImpl[circessh@/192.168.190.2:14840])) - requested=32768, available=1146880
      2018-01-23 10:30:10,018 DEBUG [sshd-SshServer[1786f9d5]-nio2-thread-2       ] [AbstractSession.exceptionCaught] exceptionCaught(ServerSessionImpl[circessh@/192.168.190.2:14840])[state=Opened] details
      java.io.IOException: Broken pipe
              at sun.nio.ch.FileDispatcherImpl.write0(Native Method)
              at sun.nio.ch.SocketDispatcher.write(SocketDispatcher.java:47)
              at sun.nio.ch.IOUtil.writeFromNativeBuffer(IOUtil.java:93)
              at sun.nio.ch.IOUtil.write(IOUtil.java:65)
              at sun.nio.ch.UnixAsynchronousSocketChannelImpl.finishWrite(UnixAsynchronousSocketChannelImpl.java:582)
              at sun.nio.ch.UnixAsynchronousSocketChannelImpl.finish(UnixAsynchronousSocketChannelImpl.java:195)
              at sun.nio.ch.UnixAsynchronousSocketChannelImpl.onEvent(UnixAsynchronousSocketChannelImpl.java:213)
              at sun.nio.ch.EPollPort$EventHandlerTask.run(EPollPort.java:293)
              at java.lang.Thread.run(Thread.java:745)
      2018-01-23 10:30:10,023 DEBUG [sshd-SshServer[1786f9d5]-nio2-thread-1       ] [Nio2Session.writePacket] writePacket(Nio2Session[local=/192.168.180.70:45470, remote=/192.168.10.31:22]) Writing 24780 bytes
      2018-01-23 10:30:10,025 DEBUG [sshd-SshServer[1786f9d5]-nio2-thread-2       ] [SessionTimeoutListener.sessionException] sessionException(ServerSessionImpl[circessh@/192.168.190.2:14840]) IOException: Broken pipe

       

      Attachments

        1. apache-sshd.trace.zip
          810 kB
          Roberto Deandrea
        2. brokenpipe.trace
          3 kB
          Roberto Deandrea

        Activity

          People

            lgoldstein Lyor Goldstein
            roberto.deandrea Roberto Deandrea
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: