Catch and report Paramiko Errors

Issue #6 closed
Jesse Almanrode repo owner created an issue

The following traceback should have been caught by sshreader and returned as the error for the ServerJob:

ERROR:paramiko.transport:Exception: Error reading SSH protocol banner[Errno 54] Connection reset by peer
ERROR:paramiko.transport:Traceback (most recent call last):
ERROR:paramiko.transport:  File "/Users/jalman001c/.virtualenvs/freezing-dubstep3/lib/python3.5/site-packages/paramiko/transport.py", line 1854, in _check_banner
ERROR:paramiko.transport:    buf = self.packetizer.readline(timeout)
ERROR:paramiko.transport:  File "/Users/jalman001c/.virtualenvs/freezing-dubstep3/lib/python3.5/site-packages/paramiko/packet.py", line 326, in readline
ERROR:paramiko.transport:    buf += self._read_timeout(timeout)
ERROR:paramiko.transport:  File "/Users/jalman001c/.virtualenvs/freezing-dubstep3/lib/python3.5/site-packages/paramiko/packet.py", line 480, in _read_timeout
ERROR:paramiko.transport:    x = self.__socket.recv(128)
ERROR:paramiko.transport:ConnectionResetError: [Errno 54] Connection reset by peer
ERROR:paramiko.transport:
ERROR:paramiko.transport:During handling of the above exception, another exception occurred:
ERROR:paramiko.transport:
ERROR:paramiko.transport:Traceback (most recent call last):
ERROR:paramiko.transport:  File "/Users/jalman001c/.virtualenvs/freezing-dubstep3/lib/python3.5/site-packages/paramiko/transport.py", line 1710, in run
ERROR:paramiko.transport:    self._check_banner()
ERROR:paramiko.transport:  File "/Users/jalman001c/.virtualenvs/freezing-dubstep3/lib/python3.5/site-packages/paramiko/transport.py", line 1858, in _check_banner
ERROR:paramiko.transport:    raise SSHException('Error reading SSH protocol banner' + str(e))
ERROR:paramiko.transport:paramiko.ssh_exception.SSHException: Error reading SSH protocol banner[Errno 54] Connection reset by peer
ERROR:paramiko.transport:

results in:

host-01: Unable to establish ssh connection

Similar output from pdsh:

host-01: ssh_exchange_identification: read: Connection reset by peer

Comments (4)

  1. Jesse Almanrode reporter

    Silencing paramiko logging to better handle pre-connection errors that occur when openSSH cannot complete handshake. Exceptions are still passed but log entries are silenced.

    Closes issue #6

    → <<cset 3d4a893be624>>

  2. Log in to comment