Python:Paramiko-服务器连接断开

时间:2019-02-15 03:58:42

标签: python ssh connection sftp paramiko

我遇到以下错误(如下所示),其中SFTP连接由于某种原因被中途切断。我碰到另一篇文章,并提出了一些建议,例如增加窗口大小和数据包大小,但似乎并没有解决该问题。另外,我尝试从SFTP站点下载的文件不是特别大。只有800 kB。看起来错误似乎是由listdir_attr引起的,我用它来获取最新文件。

Traceback (most recent call last):
  File "\\ccl\apps\KDB\uatw\code\plib\venvs\shortlocator\lib\site-packages\paramiko\sftp_client.py", line 843, in _read_response
    t, data = self._read_packet()
  File "\\ccl\apps\KDB\uatw\code\plib\venvs\shortlocator\lib\site-packages\paramiko\sftp.py", line 201, in _read_packet
    x = self._read_all(4)
  File "\\ccl\apps\KDB\uatw\code\plib\venvs\shortlocator\lib\site-packages\paramiko\sftp.py", line 188, in _read_all
    raise EOFError()
EOFError

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "\\ccl\apps\KDB\uatw\code\products\Q\ShortLocator2\ShortLocator.py", line 246, in runShortLocator
    self.runResponseProcess(kdbconn, SFTPconn)
  File "\\ccl\apps\KDB\uatw\code\products\Q\ShortLocator2\ShortLocator.py", line 160, in runResponseProcess
    manualResponseListFiles = SFTPconn.listFiles(self.manualConfirmsPath)
  File "\\ccl\apps\KDB\uatw\code\products\Q\ShortLocator2\SFTPConnect.py", line 39, in listFiles
    for fileattr in self.sftp.listdir_attr(confirms_path):
  File "\\ccl\apps\KDB\uatw\code\plib\venvs\shortlocator\lib\site-packages\paramiko\sftp_client.py", line 246, in listdir_attr
    t, msg = self._request(CMD_READDIR, handle)
  File "\\ccl\apps\KDB\uatw\code\plib\venvs\shortlocator\lib\site-packages\paramiko\sftp_client.py", line 813, in _request
    return self._read_response(num)
  File "\\ccl\apps\KDB\uatw\code\plib\venvs\shortlocator\lib\site-packages\paramiko\sftp_client.py", line 845, in _read_response
    raise SSHException("Server connection dropped: {}".format(e))
paramiko.ssh_exception.SSHException: Server connection dropped:

0 个答案:

没有答案