Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RSM 0.10.2 with paramiko 1.15.2 connecting to GlobalScape SFTP server fails #22

Open
nrejac opened this issue Mar 30, 2015 · 2 comments

Comments

@nrejac
Copy link
Contributor

nrejac commented Mar 30, 2015

When connecting to a GlobalScape SFTP server, placing a file in anywhere other than the home directory generates an error (identifying information removed):

1242.30885506 paramiko.transport - INFO: Authentication (password) successful!
Connected as username@server:22
  1256.58583641 paramiko.transport - DEBUG: [chan 0] Max packet in: 32768 bytes
  1258.14795494 paramiko.transport - DEBUG: [chan 0] Max packet out: 35840 bytes
  1258.24284554 paramiko.transport - DEBUG: Secsh channel 0 opened.
  1262.00985909 paramiko.transport - DEBUG: [chan 0] Sesch channel 0 request ok
  1263.46182823 paramiko.transport.sftp - INFO: [chan 0] Opened sftp connection (server version 3)
  1263.57293129 paramiko.transport.sftp - DEBUG: [chan 0] stat('/directory')
  1272.77302742 paramiko.transport.sftp - DEBUG: [chan 0] stat('/directory')
  1281.30197525 paramiko.transport.sftp - DEBUG: [chan 0] normalize('/directory')
  1285.41898727 paramiko.transport.sftp - DEBUG: [chan 0] open('/directory//input_3_0.csv', 'wb')
  1286.94605827 paramiko.transport.sftp - INFO: [chan 0] sftp session closed.
  1287.09197044 paramiko.transport - DEBUG: [chan 0] EOF sent (0)
  1288.36894035 paramiko.transport - DEBUG: EOF in transport thread
  1290.94290733 root - ERROR: There was an error sending file input_3_0.csv to server: [Errno 2] File not found
  1291.03398323 root - ERROR: Please check the credentials/remotepath/localpath/Server URI
  1291.17083549 root - INFO: Message body: There was an error sending file input_3_0.csv to server: [Errno 2] File not found

Research shows this is a known problem with paramiko when the server does not support

df -hi
like GlobalScape:

http://stackoverflow.com/questions/11198364/paramiko-get-raises-ioerror-no-such-file-if-server-doesnt-support-df-hi?lq=1

@nrejac
Copy link
Contributor Author

nrejac commented Mar 30, 2015

Additional console output below demonstrating that changing to a directory and attempting to list it fails. Only the home directory can be listed. Note that the following operation succeeds when performed in the console using the standard SFTP command.

Identifying information removed:

Python 2.7.6 (default, Sep  9 2014, 15:04:36) 
[GCC 4.2.1 Compatible Apple LLVM 6.0 (clang-600.0.39)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import pysftp
>>> with pysftp.Connection('server', username="username", password="password") as sftp:
...     with sftp.cd('directory'):
...             sftp.chdir('directory')
...             sftp.listdir()
... 
Traceback (most recent call last):
  File "", line 3, in 
  File "build/bdist.macosx-10.10-intel/egg/pysftp.py", line 510, in chdir
  File "build/bdist.macosx-10.10-intel/egg/paramiko/sftp_client.py", line 580, in chdir
  File "build/bdist.macosx-10.10-intel/egg/paramiko/sftp_client.py", line 413, in stat
  File "build/bdist.macosx-10.10-intel/egg/paramiko/sftp_client.py", line 729, in _request
  File "build/bdist.macosx-10.10-intel/egg/paramiko/sftp_client.py", line 776, in _read_response
  File "build/bdist.macosx-10.10-intel/egg/paramiko/sftp_client.py", line 802, in _convert_status
IOError: [Errno 2] File not found
>>> with pysftp.Connection('server', username="username", password="password") as sftp:
...     sftp.listdir()
... 
[u'.ssh', u'directory']
>>> 

@nrejac
Copy link
Contributor Author

nrejac commented Mar 30, 2015

Recommend fix at this time is to combine GSM with a shell script that moves the file to appropriate location.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant