You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi,
I ran into an issue trying to open a file from a remote SFTP to local, a short version of the code is:
transport = paramiko.Transport((hostname, int(port)))
(...) Config stuff
transport.connect(**transport_config)
sftp = paramiko.SFTPClient.from_transport(transport)
with sftp.open(remote_file_path, 'r') as remote_file:
shutil.copyfileobj(remote_file, open(local_file_path, 'w'))
This code used to work well for a time, but is failing for a few days. My guess is that the remote file is getting bigger that's why it failed but not sure why. (note that it's only 263mb)
Here is the stack trace, i don't have enough information on what is going on ?
File "/var/www/service-sftp-fetcher/releases/20180612155411/alk_service_exchange/model/fetcher.py", line 82, in fetch
with sftp.open(remote_file_path, 'r') as remote_file:
File "/var/www/service-sftp-fetcher/shared/env/local/lib/python2.7/site-packages/paramiko-2.4.1-py2.7.egg/paramiko/sftp_client.py", line 341, in open
t, msg = self._request(CMD_OPEN, filename, imode, attrblock)
File "/var/www/service-sftp-fetcher/shared/env/local/lib/python2.7/site-packages/paramiko-2.4.1-py2.7.egg/paramiko/sftp_client.py", line 780, in _request
return self._read_response(num)
File "/var/www/service-sftp-fetcher/shared/env/local/lib/python2.7/site-packages/paramiko-2.4.1-py2.7.egg/paramiko/sftp_client.py", line 832, in _read_response
self._convert_status(msg)
File "/var/www/service-sftp-fetcher/shared/env/local/lib/python2.7/site-packages/paramiko-2.4.1-py2.7.egg/paramiko/sftp_client.py", line 865, in _convert_status
raise IOError(text)
IOError: Failure
Note: I'm using this open + copyfileobj as a fallback for a failed
Hi,
I ran into an issue trying to open a file from a remote SFTP to local, a short version of the code is:
This code used to work well for a time, but is failing for a few days. My guess is that the remote file is getting bigger that's why it failed but not sure why. (note that it's only 263mb)
Here is the stack trace, i don't have enough information on what is going on ?
Note: I'm using this open + copyfileobj as a fallback for a failed
cf: #926
I'm using: paramiko-2.4.1 with python 2.7
Thank for your support and for the lib 👍
The text was updated successfully, but these errors were encountered: