2013-02-21 164 views
5

我想使用paramiko sftp複製大文件(〜650mb)文件。我能夠複製小文件,但當我嘗試複製大文件時,我看到以下錯誤。我能夠通過使用sftp直接從終端複製文件。paramiko sftp服務器連接丟失

Traceback (most recent call last): 
    File "/usr/lib/python2.7/threading.py", line 551, in __bootstrap_inner 
    self.run() 
    File "/usr/lib/python2.7/threading.py", line 504, in run 
    self.__target(*self.__args, **self.__kwargs) 
    File "/usr/lib/python2.7/dist-packages/paramiko/sftp_file.py", line 453, in _prefetch_thread 
    self.sftp._async_request(self, CMD_READ, self.handle, long(offset), int(length)) 
    File "/usr/lib/python2.7/dist-packages/paramiko/sftp_client.py", line 656, in _async_request 
    self._send_packet(t, str(msg)) 
    File "/usr/lib/python2.7/dist-packages/paramiko/sftp.py", line 172, in _send_packet 
    self._write_all(out) 
    File "/usr/lib/python2.7/dist-packages/paramiko/sftp.py", line 136, in _write_all 
    n = self.sock.send(out) 
    File "/usr/lib/python2.7/dist-packages/paramiko/channel.py", line 701, in send 
    self.transport._send_user_message(m) 
    File "/usr/lib/python2.7/dist-packages/paramiko/transport.py", line 1426, in _send_user_message 
    self._send_message(data) 
    File "/usr/lib/python2.7/dist-packages/paramiko/transport.py", line 1406, in _send_message 
    self.packetizer.send_message(data) 
    File "/usr/lib/python2.7/dist-packages/paramiko/packet.py", line 310, in send_message 
    self.write_all(out) 
    File "/usr/lib/python2.7/dist-packages/paramiko/packet.py", line 260, in write_all 
    raise EOFError() 
EOFError 

Traceback (most recent call last): 
    File "./extract.py", line 107, in <module> 
    main() 
    File "./extract.py", line 81, in main 
    getFiles() 
    File "./extract.py", line 58, in getFiles 
    'ABC.zip') 
    File "/usr/lib/python2.7/dist-packages/paramiko/sftp_client.py", line 614, in get 
    data = fr.read(32768) 
    File "/usr/lib/python2.7/dist-packages/paramiko/file.py", line 153, in read 
    new_data = self._read(read_size) 
    File "/usr/lib/python2.7/dist-packages/paramiko/sftp_file.py", line 152, in _read 
    data = self._read_prefetch(size) 
    File "/usr/lib/python2.7/dist-packages/paramiko/sftp_file.py", line 132, in _read_prefetch 
    self.sftp._read_response() 
    File "/usr/lib/python2.7/dist-packages/paramiko/sftp_client.py", line 668, in _read_response 
    raise SSHException('Server connection dropped: %s' % (str(e),)) 
paramiko.SSHException: Server connection dropped: 

此外,只有在閱讀了一定數量的字節後纔會拋出。我介紹裏面sftp_client.py print語句,這是輸出(字節)

reading bytes data_size: 11 
reading bytes data_size: 28 
reading bytes data_size: 28 
reading bytes data_size: 32776 
reading bytes data_size: 32776 
reading bytes data_size: 32776 
reading bytes data_size: 32776 
reading bytes data_size: 32776 
reading bytes data_size: 32776 
reading bytes data_size: 32776 

爲什麼連接在文件中被丟棄這是我不清楚。有關如何處理這個問題的任何建議?

謝謝!

+0

你有什麼發展嗎?我正在解決同樣的問題。 – Etienne 2013-03-22 16:20:29

+0

@Etienne我仍在等待,我不知道任何其他解決方案 – user868643 2013-03-23 07:58:52

+0

昨天我在這裏提交了一個錯誤報告:https://github.com/paramiko/paramiko/issues/151 – Etienne 2013-03-23 17:15:12

回答

相關問題