0 votes
by (120 points)

I am getting unexpectable exception when connecting to sftp server and getting list of files from target directory

I know the server doesn't like SSH_FXP_STAT check for target directory, but do we have a walkaround here? probably some flag should be used?

2019-12-05 13:23:48.621 INFO Sftp(7)[28] Info: Connecting to *********:22 using Sftp.
2019-12-05 13:23:48.621 INFO Sftp(7)[28] Info: Assembly: Rebex.Sftp 2017 R5 for .NET 2.0-3.5
2019-12-05 13:23:49.465 INFO Sftp(7)[28] SSH: Negotiation started.
2019-12-05 13:23:49.636 INFO Sftp(7)[28] SSH: Negotiation finished.
2019-12-05 13:23:49.636 INFO Sftp(7)[28] Info: Server: SSH-2.0-DataPowerSSH_1.1
2019-12-05 13:23:49.636 INFO Sftp(7)[28] Info: Fingerprint (MD5): sadassdasd
2019-12-05 13:23:49.636 INFO Sftp(7)[28] Info: Fingerprint (SHA-256): asdasdasd
2019-12-05 13:23:49.636 INFO Sftp(7)[28] Info: Cipher info: SSH 2.0, diffie-hellman-group-exchange-sha256, ssh-dss, aes256-ctr/aes256-ctr, hmac-sha2-256/hmac-sha2-256
2019-12-05 13:23:49.808 INFO Sftp(7)[28] Command: SSH_FXP_INIT (4)
2019-12-05 13:23:49.824 INFO Sftp(7)[28] Response: SSH_FXP_VERSION (3, 0 extensions)
2019-12-05 13:23:49.824 INFO Sftp(7)[28] Info: Using SFTP v3.
2019-12-05 13:23:49.824 INFO Sftp(7)[28] Command: SSH_FXP_REALPATH (1, '.')
2019-12-05 13:23:49.840 INFO Sftp(7)[28] Response: SSH_FXP_NAME (1, 1 item)
2019-12-05 13:23:49.840 INFO Sftp(7)[28] Info: Home directory is '/homedir/'.
2019-12-05 13:23:49.840 INFO Sftp(7)[28] Command: SSH_FXP_REALPATH (2, '/homedir/targetdir/')
2019-12-05 13:23:49.855 INFO Sftp(7)[28] Response: SSH_FXP_NAME (2, 1 item)
2019-12-05 13:23:49.855 INFO Sftp(7)[28] Command: SSH_FXP_STAT (3, '/homedir/targetdir')
2019-12-05 13:23:50.871 INFO Sftp(7)[28] Response: SSH_FXP_STATUS (3, 4, '')
2019-12-05 13:23:50.871 ERROR Sftp(7)[28] Info: Rebex.Net.SftpException: Failure.
   at Rebex.Net.EGL.AH(HQ N, Type L)
   at Rebex.Net.EGL.ZS(String N, Boolean L, Boolean B, Boolean O, VGL C, SUL& J, UZL T)
   at Rebex.Net.Sftp.HD(String N, UZL L)
Applies to: Rebex SFTP

1 Answer

0 votes
by (148k points)

This problem has been reported previously and it seems to be a server-side issue caused by a bug in DataPowerSSH server that is unable to properly handle SFTP protocol's SSH_FXP_STAT command when called on a directory in order to check its existence.

The following hotfix attempts to work around the issue:

Please give it a try and let us know whether it solves the issue.

...