EldoS | Feel safer!

Software components for data protection, secure storage and transfer

SFTP Download yields Couldn't stat remote file

Also by EldoS: BizCrypto
Components for BizTalk® and SQL Server® Integration Services that let you securely store and transfer information in your business automation solutions.
#32767
Posted: 03/25/2015 13:42:58
by Rafael Hernandez (Standard support level)
Joined: 02/04/2015
Posts: 21

I am currently evaluating the SFTP portion of SecureBlackbox (Java Version) and currently have my own working version of the sample Sftp Server. I can successfully upload only certain types of files like text and UTF-8 at the moment but when I try to re-download them I get the following error:
Couldn't stat remote file: No such file or directory
I am using SSH-2.0-OpenSSH_6.7 and Transmit as the clients. This issue does not occur in FileZilla as I am able to read the files just fine. Also, I have tried setting all the READ, WRITE, EXECUTE permissions of TElSftpFileAttributes to true to see if that helped any but no luck.

Please provide guidance on how I may resolve this issue. Thanks.
#32769
Posted: 03/25/2015 13:52:59
by Eugene Mayevski (EldoS Corp.)

Does the file actually exist (i.e. is it created after upload) on your server?

In general, the file operations are handled via event handlers in your code (or in sample code). You can put a breakpoint in the event handler for OnOpenFile event and see if it's reached when you try to download the file, and if it is, what's going on in the event handler (is the correct path specified, is the file opened etc).


Sincerely yours
Eugene Mayevski
#32771
Posted: 03/25/2015 17:01:08
by Rafael Hernandez (Standard support level)
Joined: 02/04/2015
Posts: 21

The file is never written to disk. It is intentionally virtual and is kept only in memory. The request never makes it to TElSFTPServerOpenFileEvent. However, I do see that TSSHReceiveEvent gets hit twice and TSSHSendEvent gets hit once before I see the message outputted on my OpenSSH client.
#32776
Posted: 03/26/2015 03:36:23
by Vsevolod Ievgiienko (EldoS Corp.)

I recommend you to check our SFTP server sample without any modifications as I also suggested in this topic: https://www.eldos.com/forum/read.php?F...ssage32775

This way it will be easier to localize the problem if the reason is in our code.
#32789
Posted: 03/26/2015 12:18:30
by Rafael Hernandez (Standard support level)
Joined: 02/04/2015
Posts: 21

Utilizing the latest SFTP Server sample (writes to disk) out-of-the-box, I have no issues with retrieval of a file. How can I achieve the same result when files are never written disk? This is our use-case and writing to disk for us is not an option. Please advise on the next steps. Thanks.
#32791
Posted: 03/26/2015 13:19:10
by Eugene Mayevski (EldoS Corp.)

The fact that the unmodified server works means that the problem originates from your code which handles events. Most likely directory listing event handler needs correction. Unfortunately that's all we can say without debugging your code.


Sincerely yours
Eugene Mayevski
#32797
Posted: 03/26/2015 16:01:26
by Rafael Hernandez (Standard support level)
Joined: 02/04/2015
Posts: 21

Understood. Can you please tell me when settingTElSftpFileAttributes, which FileType is recommended when dealing with virtual directories and files which are never written to disk? Thanks.
#32802
Posted: 03/27/2015 02:08:39
by Rafael Hernandez (Standard support level)
Joined: 02/04/2015
Posts: 21

For the benefit of anyone who may need it in the future. Indeed it was a logic error in TElSFTPServerRequestAttributesEvent. Once I fixed the logic, I was able to download some files successfully. Other files failed to download with the following error:
Corrupted MAC on input.
Disconnecting: Packet corrupt

The cause of this error is something else and I believe it may be associated to issue #32766 .

Thanks for all the great help on this one.
Also by EldoS: CallbackProcess
A component to control process creation and termination in Windows and .NET applications.

Reply

Statistics

Topic viewed 1648 times

Number of guests: 1, registered members: 0, in total hidden: 0




|

Back to top

As of July 15, 2016 EldoS Corporation will operate as a division of /n software inc. For more information, please read the announcement.

Got it!