No such file; No such directory

0 votes
asked Jun 18 by chris123 (120 points)

Hi, I'm having issues accessing a folder on our SFTP server. This was working before and there have been no code changes. I'm currently getting the error 'No Such File; no Such Directory' below is the log text:

2020-06-17 16:00:30.938 Opening log file.
2020-06-17 16:00:30.939 INFO FileLogWriter(1)[13] Info: Assembly: Rebex.Common 2017 R6.3 for .NET 4.0-4.7
2020-06-17 16:00:30.960 INFO FileLogWriter(1)[13] Info: Platform: Windows 10.0.17763 32-bit; CLR: 4.0.30319.42000
2020-06-17 16:00:30.960 DEBUG FileLogWriter(1)[13] Info: Culture: en; Windows-1252
2020-06-17 16:00:30.960 INFO FileLogWriter(1)[13] Info: FIPS-only mode has been enabled
2020-06-17 16:00:30.960 INFO Sftp(1)[13] Command: SSH_FXP_REALPATH (5, '/IOC/ITF')
2020-06-17 16:00:30.962 INFO Sftp(1)[13] Response: SSH_FXP_NAME (5, 1 item)
2020-06-17 16:00:30.962 INFO Sftp(1)[13] Command: SSH_FXP_STAT (6, '/IOC/ITF')
2020-06-17 16:00:30.969 INFO Sftp(1)[13] Response: SSH_FXP_STATUS (6, 2, 'File not found: /IOC/ITF')
2020-06-17 16:00:30.970 ERROR Sftp(1)[13] Info: Rebex.Net.SftpException: No such file; No such directory.
   at Rebex.Net.Sftp.WR(String N, JJM M)
Applies to: Rebex SFTP

1 Answer

0 votes
answered Jun 18 by Lukas Pokorny (109,670 points)

Does this error occur during ChangeDirectory method call?

If /IOC/ITF actually exists, that would mean the error is caused by a server-side bug in SSH_FXP_STAT command implementation. In that case, we recommend contacting the server vendor to have it fixed.

Alternatively, you might upgrade to Rebex SFTP 2020 R2 which has an experimental workaround for servers with broken SSH_FXP_STAT command. The following code shows how to enable the workaround:

var client = new Sftp();
client.LogWriter = new ConsoleLogWriter(LogLevel.Debug);
client.Connect("test.rebex.net");
client.Login("demo", "password");

// enable experimental workaround for broken SSH_FXP_STAT
Security.Cryptography.CryptoHelper.SetOption(client.Settings, "EnableDataPowerSshWorkaround", true);

client.ChangeDirectory("/pub");
client.GetRawList();

If you give this a try, please let us know whether it solves the issue.

commented Jun 18 by chris123 (120 points)
Thanks for the quick response.... issue is resolved..... issue was caused by recent updates to the server causing some of the accounts access to change.
...