Tests sometimes generate errors over campus Wi-Fi that are most likely due to either lag or network security policies. The tests pass when run on team members' home connections and pass when run individually, but opening 20+ SFTP connections to the same server in a short time span, on campus Wi-Fi, tends to cause issues. The root causes appears to be a race condition in paramiko or pysftp. Example output is below. Any E
in the tests that corresponds to a Paramiko exception of the form
is an issue of this kind.
[dylan@localhost git]$ pytest
========================================== test session starts ==========================================
platform linux -- Python 3.7.2, pytest-4.2.0, py-1.7.0, pluggy-0.8.1
rootdir: /home/dylan/Dropbox/Computer Science/Classes/CS 510 - Agile Software Development/git, inifile:
collected 21 items
tests/integration/test_basic_skeleton.py .E [ 9%]
tests/integration/test_close.py EE [ 19%]
tests/integration/test_list_local_files.py .. [ 28%]
tests/integration/test_login.py .. [ 38%]
tests/integration/test_put_file_onto_remote_server.py .. [ 47%]
tests/unit/test_close.py . [ 52%]
tests/unit/test_input_handler.py ... [ 66%]
tests/unit/test_list_files_local.py . [ 71%]
tests/unit/test_login.py .. [ 80%]
tests/unit/test_put_file_onto_remote_server.py .. [ 90%]
tests/unit/test_sftp_fixture.py .. [100%]
================================================ ERRORS =================================================
__________________________________ ERROR at setup of test_end_of_file ___________________________________
self = <paramiko.Transport at 0x258caa20 (unconnected)>
def _check_banner(self):
# this is slow, but we only have to do it once
for i in range(100):
# give them 15 seconds for the first line, then just 2 seconds
# each additional line. (some sites have very high latency.)
if i == 0:
timeout = self.banner_timeout
else:
timeout = 2
try:
> buf = self.packetizer.readline(timeout)
/usr/lib/python3.7/site-packages/paramiko/transport.py:2138:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <paramiko.packet.Packetizer object at 0x7f862472c828>, timeout = 15
def readline(self, timeout):
"""
Read a line from the socket. We assume no data is pending after the
line, so it's okay to attempt large reads.
"""
buf = self.__remainder
while linefeed_byte not in buf:
> buf += self._read_timeout(timeout)
/usr/lib/python3.7/site-packages/paramiko/packet.py:367:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <paramiko.packet.Packetizer object at 0x7f862472c828>, timeout = 15
def _read_timeout(self, timeout):
start = time.time()
while True:
try:
x = self.__socket.recv(128)
if len(x) == 0:
raise EOFError()
break
except socket.timeout:
pass
except EnvironmentError as e:
if first_arg(e) == errno.EINTR:
pass
else:
raise
if self.__closed:
raise EOFError()
now = time.time()
if now - start >= timeout:
> raise socket.timeout()
E socket.timeout
/usr/lib/python3.7/site-packages/paramiko/packet.py:576: timeout
During handling of the above exception, another exception occurred:
@pytest.fixture(scope="function")
def sftp():
"""This fixture provides a pysftp.Connection object that's shared
across the entire tests package. If there's a problem connecting,
it will raise an exception that will terminate testing."""
return pysftp.Connection(
host=HOSTNAME,
username=USERNAME,
> password=PASSWORD
)
tests/conftest.py:14:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
/usr/local/lib/python3.7/site-packages/pysftp/__init__.py:143: in __init__
self._transport.connect(**self._tconnect)
/usr/lib/python3.7/site-packages/paramiko/transport.py:1218: in connect
self.start_client()
/usr/lib/python3.7/site-packages/paramiko/transport.py:587: in start_client
raise e
/usr/lib/python3.7/site-packages/paramiko/transport.py:1966: in run
self._check_banner()
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <paramiko.Transport at 0x258caa20 (unconnected)>
def _check_banner(self):
# this is slow, but we only have to do it once
for i in range(100):
# give them 15 seconds for the first line, then just 2 seconds
# each additional line. (some sites have very high latency.)
if i == 0:
timeout = self.banner_timeout
else:
timeout = 2
try:
buf = self.packetizer.readline(timeout)
except ProxyCommandFailure:
raise
except Exception as e:
raise SSHException(
> "Error reading SSH protocol banner" + str(e)
)
E paramiko.ssh_exception.SSHException: Error reading SSH protocol banner
/usr/lib/python3.7/site-packages/paramiko/transport.py:2143: SSHException
------------------------------------------ Captured log setup -------------------------------------------
transport.py 1746 ERROR Exception: Error reading SSH protocol banner
transport.py 1744 ERROR Traceback (most recent call last):
transport.py 1744 ERROR File "/usr/lib/python3.7/site-packages/paramiko/transport.py", line 2138, in _check_banner
transport.py 1744 ERROR buf = self.packetizer.readline(timeout)
transport.py 1744 ERROR File "/usr/lib/python3.7/site-packages/paramiko/packet.py", line 367, in readline
transport.py 1744 ERROR buf += self._read_timeout(timeout)
transport.py 1744 ERROR File "/usr/lib/python3.7/site-packages/paramiko/packet.py", line 576, in _read_timeout
transport.py 1744 ERROR raise socket.timeout()
transport.py 1744 ERROR socket.timeout
transport.py 1744 ERROR
transport.py 1744 ERROR During handling of the above exception, another exception occurred:
transport.py 1744 ERROR
transport.py 1744 ERROR Traceback (most recent call last):
transport.py 1744 ERROR File "/usr/lib/python3.7/site-packages/paramiko/transport.py", line 1966, in run
transport.py 1744 ERROR self._check_banner()
transport.py 1744 ERROR File "/usr/lib/python3.7/site-packages/paramiko/transport.py", line 2143, in _check_banner
transport.py 1744 ERROR "Error reading SSH protocol banner" + str(e)
transport.py 1744 ERROR paramiko.ssh_exception.SSHException: Error reading SSH protocol banner
transport.py 1744 ERROR
______________________ ERROR at setup of test_close_commands_invoke_close_function ______________________
self = <paramiko.Transport at 0x23485390 (unconnected)>
def _check_banner(self):
# this is slow, but we only have to do it once
for i in range(100):
# give them 15 seconds for the first line, then just 2 seconds
# each additional line. (some sites have very high latency.)
if i == 0:
timeout = self.banner_timeout
else:
timeout = 2
try:
> buf = self.packetizer.readline(timeout)
/usr/lib/python3.7/site-packages/paramiko/transport.py:2138:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <paramiko.packet.Packetizer object at 0x7f862358b630>, timeout = 15
def readline(self, timeout):
"""
Read a line from the socket. We assume no data is pending after the
line, so it's okay to attempt large reads.
"""
buf = self.__remainder
while linefeed_byte not in buf:
> buf += self._read_timeout(timeout)
/usr/lib/python3.7/site-packages/paramiko/packet.py:367:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <paramiko.packet.Packetizer object at 0x7f862358b630>, timeout = 15
def _read_timeout(self, timeout):
start = time.time()
while True:
try:
x = self.__socket.recv(128)
if len(x) == 0:
raise EOFError()
break
except socket.timeout:
pass
except EnvironmentError as e:
if first_arg(e) == errno.EINTR:
pass
else:
raise
if self.__closed:
raise EOFError()
now = time.time()
if now - start >= timeout:
> raise socket.timeout()
E socket.timeout
/usr/lib/python3.7/site-packages/paramiko/packet.py:576: timeout
During handling of the above exception, another exception occurred:
@pytest.fixture(scope="function")
def sftp():
"""This fixture provides a pysftp.Connection object that's shared
across the entire tests package. If there's a problem connecting,
it will raise an exception that will terminate testing."""
return pysftp.Connection(
host=HOSTNAME,
username=USERNAME,
> password=PASSWORD
)
tests/conftest.py:14:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
/usr/local/lib/python3.7/site-packages/pysftp/__init__.py:143: in __init__
self._transport.connect(**self._tconnect)
/usr/lib/python3.7/site-packages/paramiko/transport.py:1218: in connect
self.start_client()
/usr/lib/python3.7/site-packages/paramiko/transport.py:587: in start_client
raise e
/usr/lib/python3.7/site-packages/paramiko/transport.py:1966: in run
self._check_banner()
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <paramiko.Transport at 0x23485390 (unconnected)>
def _check_banner(self):
# this is slow, but we only have to do it once
for i in range(100):
# give them 15 seconds for the first line, then just 2 seconds
# each additional line. (some sites have very high latency.)
if i == 0:
timeout = self.banner_timeout
else:
timeout = 2
try:
buf = self.packetizer.readline(timeout)
except ProxyCommandFailure:
raise
except Exception as e:
raise SSHException(
> "Error reading SSH protocol banner" + str(e)
)
E paramiko.ssh_exception.SSHException: Error reading SSH protocol banner
/usr/lib/python3.7/site-packages/paramiko/transport.py:2143: SSHException
------------------------------------------ Captured log setup -------------------------------------------
transport.py 1746 ERROR Exception: Error reading SSH protocol banner
transport.py 1744 ERROR Traceback (most recent call last):
transport.py 1744 ERROR File "/usr/lib/python3.7/site-packages/paramiko/transport.py", line 2138, in _check_banner
transport.py 1744 ERROR buf = self.packetizer.readline(timeout)
transport.py 1744 ERROR File "/usr/lib/python3.7/site-packages/paramiko/packet.py", line 367, in readline
transport.py 1744 ERROR buf += self._read_timeout(timeout)
transport.py 1744 ERROR File "/usr/lib/python3.7/site-packages/paramiko/packet.py", line 576, in _read_timeout
transport.py 1744 ERROR raise socket.timeout()
transport.py 1744 ERROR socket.timeout
transport.py 1744 ERROR
transport.py 1744 ERROR During handling of the above exception, another exception occurred:
transport.py 1744 ERROR
transport.py 1744 ERROR Traceback (most recent call last):
transport.py 1744 ERROR File "/usr/lib/python3.7/site-packages/paramiko/transport.py", line 1966, in run
transport.py 1744 ERROR self._check_banner()
transport.py 1744 ERROR File "/usr/lib/python3.7/site-packages/paramiko/transport.py", line 2143, in _check_banner
transport.py 1744 ERROR "Error reading SSH protocol banner" + str(e)
transport.py 1744 ERROR paramiko.ssh_exception.SSHException: Error reading SSH protocol banner
transport.py 1744 ERROR
_________________ ERROR at setup of test_invalid_commands_do_not_invoke_close_function __________________
self = <paramiko.Transport at 0x233a6eb8 (unconnected)>
def _check_banner(self):
# this is slow, but we only have to do it once
for i in range(100):
# give them 15 seconds for the first line, then just 2 seconds
# each additional line. (some sites have very high latency.)
if i == 0:
timeout = self.banner_timeout
else:
timeout = 2
try:
> buf = self.packetizer.readline(timeout)
/usr/lib/python3.7/site-packages/paramiko/transport.py:2138:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <paramiko.packet.Packetizer object at 0x7f86233a6278>, timeout = 15
def readline(self, timeout):
"""
Read a line from the socket. We assume no data is pending after the
line, so it's okay to attempt large reads.
"""
buf = self.__remainder
while linefeed_byte not in buf:
> buf += self._read_timeout(timeout)
/usr/lib/python3.7/site-packages/paramiko/packet.py:367:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <paramiko.packet.Packetizer object at 0x7f86233a6278>, timeout = 15
def _read_timeout(self, timeout):
start = time.time()
while True:
try:
x = self.__socket.recv(128)
if len(x) == 0:
raise EOFError()
break
except socket.timeout:
pass
except EnvironmentError as e:
if first_arg(e) == errno.EINTR:
pass
else:
raise
if self.__closed:
raise EOFError()
now = time.time()
if now - start >= timeout:
> raise socket.timeout()
E socket.timeout
/usr/lib/python3.7/site-packages/paramiko/packet.py:576: timeout
During handling of the above exception, another exception occurred:
@pytest.fixture(scope="function")
def sftp():
"""This fixture provides a pysftp.Connection object that's shared
across the entire tests package. If there's a problem connecting,
it will raise an exception that will terminate testing.""" [dylan@localhost git]$ pytest
========================================== test session starts ==========================================
platform linux -- Python 3.7.2, pytest-4.2.0, py-1.7.0, pluggy-0.8.1
rootdir: /home/dylan/Dropbox/Computer Science/Classes/CS 510 - Agile Software Development/git, inifile:
collected 21 items
tests/integration/test_basic_skeleton.py .E [ 9%]
tests/integration/test_close.py EE [ 19%]
tests/integration/test_list_local_files.py .. [ 28%]
tests/integration/test_login.py .. [ 38%]
tests/integration/test_put_file_onto_remote_server.py .. [ 47%]
tests/unit/test_close.py . [ 52%]
tests/unit/test_input_handler.py ... [ 66%]
tests/unit/test_list_files_local.py . [ 71%]
tests/unit/test_login.py .. [ 80%]
tests/unit/test_put_file_onto_remote_server.py .. [ 90%]
tests/unit/test_sftp_fixture.py .. [100%]
================================================ ERRORS =================================================
__________________________________ ERROR at setup of test_end_of_file ___________________________________
self = <paramiko.Transport at 0x258caa20 (unconnected)>
def _check_banner(self):
# this is slow, but we only have to do it once
for i in range(100):
# give them 15 seconds for the first line, then just 2 seconds
# each additional line. (some sites have very high latency.)
if i == 0:
timeout = self.banner_timeout
else:
timeout = 2
try:
> buf = self.packetizer.readline(timeout)
/usr/lib/python3.7/site-packages/paramiko/transport.py:2138:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <paramiko.packet.Packetizer object at 0x7f862472c828>, timeout = 15
def readline(self, timeout):
"""
Read a line from the socket. We assume no data is pending after the
line, so it's okay to attempt large reads.
"""
buf = self.__remainder
while linefeed_byte not in buf:
> buf += self._read_timeout(timeout)
/usr/lib/python3.7/site-packages/paramiko/packet.py:367:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <paramiko.packet.Packetizer object at 0x7f862472c828>, timeout = 15
def _read_timeout(self, timeout):
start = time.time()
while True:
try:
x = self.__socket.recv(128)
if len(x) == 0:
raise EOFError()
break
except socket.timeout:
pass
except EnvironmentError as e:
if first_arg(e) == errno.EINTR:
pass
else:
raise
if self.__closed:
raise EOFError()
now = time.time()
if now - start >= timeout:
> raise socket.timeout()
E socket.timeout
/usr/lib/python3.7/site-packages/paramiko/packet.py:576: timeout
During handling of the above exception, another exception occurred:
@pytest.fixture(scope="function")
def sftp():
"""This fixture provides a pysftp.Connection object that's shared
across the entire tests package. If there's a problem connecting,
it will raise an exception that will terminate testing."""
return pysftp.Connection(
host=HOSTNAME,
username=USERNAME,
> password=PASSWORD
)
tests/conftest.py:14:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
/usr/local/lib/python3.7/site-packages/pysftp/__init__.py:143: in __init__
self._transport.connect(**self._tconnect)
/usr/lib/python3.7/site-packages/paramiko/transport.py:1218: in connect
self.start_client()
/usr/lib/python3.7/site-packages/paramiko/transport.py:587: in start_client
raise e
/usr/lib/python3.7/site-packages/paramiko/transport.py:1966: in run
self._check_banner()
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <paramiko.Transport at 0x258caa20 (unconnected)>
def _check_banner(self):
# this is slow, but we only have to do it once
for i in range(100):
# give them 15 seconds for the first line, then just 2 seconds
# each additional line. (some sites have very high latency.)
if i == 0:
timeout = self.banner_timeout
else:
timeout = 2
try:
buf = self.packetizer.readline(timeout)
except ProxyCommandFailure:
raise
except Exception as e:
raise SSHException(
> "Error reading SSH protocol banner" + str(e)
)
E paramiko.ssh_exception.SSHException: Error reading SSH protocol banner
/usr/lib/python3.7/site-packages/paramiko/transport.py:2143: SSHException
------------------------------------------ Captured log setup -------------------------------------------
transport.py 1746 ERROR Exception: Error reading SSH protocol banner
transport.py 1744 ERROR Traceback (most recent call last):
transport.py 1744 ERROR File "/usr/lib/python3.7/site-packages/paramiko/transport.py", line 2138, in _check_banner
transport.py 1744 ERROR buf = self.packetizer.readline(timeout)
transport.py 1744 ERROR File "/usr/lib/python3.7/site-packages/paramiko/packet.py", line 367, in readline
transport.py 1744 ERROR buf += self._read_timeout(timeout)
transport.py 1744 ERROR File "/usr/lib/python3.7/site-packages/paramiko/packet.py", line 576, in _read_timeout
transport.py 1744 ERROR raise socket.timeout()
transport.py 1744 ERROR socket.timeout
transport.py 1744 ERROR
transport.py 1744 ERROR During handling of the above exception, another exception occurred:
transport.py 1744 ERROR
transport.py 1744 ERROR Traceback (most recent call last):
transport.py 1744 ERROR File "/usr/lib/python3.7/site-packages/paramiko/transport.py", line 1966, in run
transport.py 1744 ERROR self._check_banner()
transport.py 1744 ERROR File "/usr/lib/python3.7/site-packages/paramiko/transport.py", line 2143, in _check_banner
transport.py 1744 ERROR "Error reading SSH protocol banner" + str(e)
transport.py 1744 ERROR paramiko.ssh_exception.SSHException: Error reading SSH protocol banner
transport.py 1744 ERROR
______________________ ERROR at setup of test_close_commands_invoke_close_function ______________________
self = <paramiko.Transport at 0x23485390 (unconnected)>
def _check_banner(self):
# this is slow, but we only have to do it once
for i in range(100):
# give them 15 seconds for the first line, then just 2 seconds
# each additional line. (some sites have very high latency.)
if i == 0:
timeout = self.banner_timeout
else:
timeout = 2
try:
> buf = self.packetizer.readline(timeout)
/usr/lib/python3.7/site-packages/paramiko/transport.py:2138:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <paramiko.packet.Packetizer object at 0x7f862358b630>, timeout = 15
def readline(self, timeout):
"""
Read a line from the socket. We assume no data is pending after the
line, so it's okay to attempt large reads.
"""
buf = self.__remainder
while linefeed_byte not in buf:
> buf += self._read_timeout(timeout)
/usr/lib/python3.7/site-packages/paramiko/packet.py:367:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <paramiko.packet.Packetizer object at 0x7f862358b630>, timeout = 15
def _read_timeout(self, timeout):
start = time.time()
while True:
try:
x = self.__socket.recv(128)
if len(x) == 0:
raise EOFError()
break
except socket.timeout:
pass
except EnvironmentError as e:
if first_arg(e) == errno.EINTR:
pass
else:
raise
if self.__closed:
raise EOFError()
now = time.time()
if now - start >= timeout:
> raise socket.timeout()
E socket.timeout
/usr/lib/python3.7/site-packages/paramiko/packet.py:576: timeout
During handling of the above exception, another exception occurred:
@pytest.fixture(scope="function")
def sftp():
"""This fixture provides a pysftp.Connection object that's shared
across the entire tests package. If there's a problem connecting,
it will raise an exception that will terminate testing."""
return pysftp.Connection(
host=HOSTNAME,
username=USERNAME,
> password=PASSWORD
)
tests/conftest.py:14:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
/usr/local/lib/python3.7/site-packages/pysftp/__init__.py:143: in __init__
self._transport.connect(**self._tconnect)
/usr/lib/python3.7/site-packages/paramiko/transport.py:1218: in connect
self.start_client()
/usr/lib/python3.7/site-packages/paramiko/transport.py:587: in start_client
raise e
/usr/lib/python3.7/site-packages/paramiko/transport.py:1966: in run
self._check_banner()
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <paramiko.Transport at 0x23485390 (unconnected)>
def _check_banner(self):
# this is slow, but we only have to do it once
for i in range(100):
# give them 15 seconds for the first line, then just 2 seconds
# each additional line. (some sites have very high latency.)
if i == 0:
timeout = self.banner_timeout
else:
timeout = 2
try:
buf = self.packetizer.readline(timeout)
except ProxyCommandFailure:
raise
except Exception as e:
raise SSHException(
> "Error reading SSH protocol banner" + str(e)
)
E paramiko.ssh_exception.SSHException: Error reading SSH protocol banner
/usr/lib/python3.7/site-packages/paramiko/transport.py:2143: SSHException
------------------------------------------ Captured log setup -------------------------------------------
transport.py 1746 ERROR Exception: Error reading SSH protocol banner
transport.py 1744 ERROR Traceback (most recent call last):
transport.py 1744 ERROR File "/usr/lib/python3.7/site-packages/paramiko/transport.py", line 2138, in _check_banner
transport.py 1744 ERROR buf = self.packetizer.readline(timeout)
transport.py 1744 ERROR File "/usr/lib/python3.7/site-packages/paramiko/packet.py", line 367, in readline
transport.py 1744 ERROR buf += self._read_timeout(timeout)
transport.py 1744 ERROR File "/usr/lib/python3.7/site-packages/paramiko/packet.py", line 576, in _read_timeout
transport.py 1744 ERROR raise socket.timeout()
transport.py 1744 ERROR socket.timeout
transport.py 1744 ERROR
transport.py 1744 ERROR During handling of the above exception, another exception occurred:
transport.py 1744 ERROR
transport.py 1744 ERROR Traceback (most recent call last):
transport.py 1744 ERROR File "/usr/lib/python3.7/site-packages/paramiko/transport.py", line 1966, in run
transport.py 1744 ERROR self._check_banner()
transport.py 1744 ERROR File "/usr/lib/python3.7/site-packages/paramiko/transport.py", line 2143, in _check_banner
transport.py 1744 ERROR "Error reading SSH protocol banner" + str(e)
transport.py 1744 ERROR paramiko.ssh_exception.SSHException: Error reading SSH protocol banner
transport.py 1744 ERROR
_________________ ERROR at setup of test_invalid_commands_do_not_invoke_close_function __________________
self = <paramiko.Transport at 0x233a6eb8 (unconnected)>
def _check_banner(self):
# this is slow, but we only have to do it once
for i in range(100):
# give them 15 seconds for the first line, then just 2 seconds
# each additional line. (some sites have very high latency.)
if i == 0:
timeout = self.banner_timeout
else:
timeout = 2
try:
> buf = self.packetizer.readline(timeout)
/usr/lib/python3.7/site-packages/paramiko/transport.py:2138:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <paramiko.packet.Packetizer object at 0x7f86233a6278>, timeout = 15
def readline(self, timeout):
"""
Read a line from the socket. We assume no data is pending after the
line, so it's okay to attempt large reads.
"""
buf = self.__remainder
while linefeed_byte not in buf:
> buf += self._read_timeout(timeout)
/usr/lib/python3.7/site-packages/paramiko/packet.py:367:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <paramiko.packet.Packetizer object at 0x7f86233a6278>, timeout = 15
def _read_timeout(self, timeout):
start = time.time()
while True:
try:
x = self.__socket.recv(128)
if len(x) == 0:
raise EOFError()
break
except socket.timeout:
pass
except EnvironmentError as e:
if first_arg(e) == errno.EINTR:
pass
else:
raise
if self.__closed:
raise EOFError()
now = time.time()
if now - start >= timeout:
> raise socket.timeout()
E socket.timeout
/usr/lib/python3.7/site-packages/paramiko/packet.py:576: timeout
During handling of the above exception, another exception occurred:
@pytest.fixture(scope="function")
def sftp():
"""This fixture provides a pysftp.Connection object that's shared
across the entire tests package. If there's a problem connecting,
it will raise an exception that will terminate testing."""
return pysftp.Connection(
host=HOSTNAME,
username=USERNAME,
> password=PASSWORD
)
tests/conftest.py:14:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
/usr/local/lib/python3.7/site-packages/pysftp/__init__.py:143: in __init__
self._transport.connect(**self._tconnect)
/usr/lib/python3.7/site-packages/paramiko/transport.py:1218: in connect
self.start_client()
/usr/lib/python3.7/site-packages/paramiko/transport.py:587: in start_client
raise e
/usr/lib/python3.7/site-packages/paramiko/transport.py:1966: in run
self._check_banner()
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <paramiko.Transport at 0x233a6eb8 (unconnected)>
def _check_banner(self):
# this is slow, but we only have to do it once
for i in range(100):
# give them 15 seconds for the first line, then just 2 seconds
# each additional line. (some sites have very high latency.)
if i == 0:
timeout = self.banner_timeout
else:
timeout = 2
try:
buf = self.packetizer.readline(timeout)
except ProxyCommandFailure:
raise
except Exception as e:
raise SSHException(
> "Error reading SSH protocol banner" + str(e)
)
E paramiko.ssh_exception.SSHException: Error reading SSH protocol banner
/usr/lib/python3.7/site-packages/paramiko/transport.py:2143: SSHException
------------------------------------------ Captured log setup -------------------------------------------
transport.py 1746 ERROR Exception: Error reading SSH protocol banner
transport.py 1744 ERROR Traceback (most recent call last):
transport.py 1744 ERROR File "/usr/lib/python3.7/site-packages/paramiko/transport.py", line 2138, in _check_banner
transport.py 1744 ERROR buf = self.packetizer.readline(timeout)
transport.py 1744 ERROR File "/usr/lib/python3.7/site-packages/paramiko/packet.py", line 367, in readline
transport.py 1744 ERROR buf += self._read_timeout(timeout)
transport.py 1744 ERROR File "/usr/lib/python3.7/site-packages/paramiko/packet.py", line 576, in _read_timeout
transport.py 1744 ERROR raise socket.timeout()
transport.py 1744 ERROR socket.timeout
transport.py 1744 ERROR
transport.py 1744 ERROR During handling of the above exception, another exception occurred:
transport.py 1744 ERROR
transport.py 1744 ERROR Traceback (most recent call last):
transport.py 1744 ERROR File "/usr/lib/python3.7/site-packages/paramiko/transport.py", line 1966, in run
transport.py 1744 ERROR self._check_banner()
transport.py 1744 ERROR File "/usr/lib/python3.7/site-packages/paramiko/transport.py", line 2143, in _check_banner
transport.py 1744 ERROR "Error reading SSH protocol banner" + str(e)
transport.py 1744 ERROR paramiko.ssh_exception.SSHException: Error reading SSH protocol banner
transport.py 1744 ERROR
================================== 18 passed, 3 error in 64.55 seconds ==================================
[dylan@localhost git]$
return pysftp.Connection(
host=HOSTNAME,
username=USERNAME,
> password=PASSWORD
)
tests/conftest.py:14:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
/usr/local/lib/python3.7/site-packages/pysftp/__init__.py:143: in __init__
self._transport.connect(**self._tconnect)
/usr/lib/python3.7/site-packages/paramiko/transport.py:1218: in connect
self.start_client()
/usr/lib/python3.7/site-packages/paramiko/transport.py:587: in start_client
raise e
/usr/lib/python3.7/site-packages/paramiko/transport.py:1966: in run
self._check_banner()
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <paramiko.Transport at 0x233a6eb8 (unconnected)>
def _check_banner(self):
# this is slow, but we only have to do it once
for i in range(100):
# give them 15 seconds for the first line, then just 2 seconds
# each additional line. (some sites have very high latency.)
if i == 0:
timeout = self.banner_timeout
else:
timeout = 2
try:
buf = self.packetizer.readline(timeout)
except ProxyCommandFailure:
raise
except Exception as e:
raise SSHException(
> "Error reading SSH protocol banner" + str(e)
)
E paramiko.ssh_exception.SSHException: Error reading SSH protocol banner
/usr/lib/python3.7/site-packages/paramiko/transport.py:2143: SSHException
------------------------------------------ Captured log setup -------------------------------------------
transport.py 1746 ERROR Exception: Error reading SSH protocol banner
transport.py 1744 ERROR Traceback (most recent call last):
transport.py 1744 ERROR File "/usr/lib/python3.7/site-packages/paramiko/transport.py", line 2138, in _check_banner
transport.py 1744 ERROR buf = self.packetizer.readline(timeout)
transport.py 1744 ERROR File "/usr/lib/python3.7/site-packages/paramiko/packet.py", line 367, in readline
transport.py 1744 ERROR buf += self._read_timeout(timeout)
transport.py 1744 ERROR File "/usr/lib/python3.7/site-packages/paramiko/packet.py", line 576, in _read_timeout
transport.py 1744 ERROR raise socket.timeout()
transport.py 1744 ERROR socket.timeout
transport.py 1744 ERROR
transport.py 1744 ERROR During handling of the above exception, another exception occurred:
transport.py 1744 ERROR
transport.py 1744 ERROR Traceback (most recent call last):
transport.py 1744 ERROR File "/usr/lib/python3.7/site-packages/paramiko/transport.py", line 1966, in run
transport.py 1744 ERROR self._check_banner()
transport.py 1744 ERROR File "/usr/lib/python3.7/site-packages/paramiko/transport.py", line 2143, in _check_banner
transport.py 1744 ERROR "Error reading SSH protocol banner" + str(e)
transport.py 1744 ERROR paramiko.ssh_exception.SSHException: Error reading SSH protocol banner
transport.py 1744 ERROR
================================== 18 passed, 3 error in 64.55 seconds ==================================
[dylan@localhost git]$