0 votes
by (160 points)

We get the following errors when connecting to an SFTP server. Any ideas?

Exception Type: Rebex.Net.SftpException
Message: Bad message; Bad message.
Method that threw an exception:
Void EC(Rebex.Net.SDB, System.Type)
Assembly: Rebex.Sftp
at Rebex.Net.YEB.EC(SDB A, Type B)
at Rebex.Net.YEB.HB(String A, VFB B, Boolean C, BEB D)
at Rebex.Net.Sftp.XAB(BEB A, String B, Stream C, Int64 D, Int64 E, WCB H)
at Rebex.Net.Sftp.XAB(FileMode A, BEB B, String C, String D, Int64 E, Int64 H, Int64 I, WCB J)
at Rebex.Net.Sftp.WAB(FileMode A, String B, String C, Int64 D, Int64 E, Int64 H, WCB I)
at Rebex.Net.Sftp.GetFile(String remotePath, String localPath)
at Rebex.Net.FileTransferClient.GetFile(String remotePath, String localPath)

Applies to: Rebex SFTP

1 Answer

0 votes
by (160 points)

It turned out we were sending requests for just the file name and the server wanted ./filename

Curiously it only gave the error sometimes.

by (144k points)
The "bad message" error has been reported by the server, possibly because it was unable to parse the client's request (it's actually supposed to indicate a "badly formatted packet", but this seems not to be the case here). If you would like to try to determine what is going on, please create a communication log using Sftp object's LogWriter property (see http://rebex.net/kb/logging/ for details) to create a communication log showing both the successful and failed requests, and mail it to support@rebex.net (or post it here) for analysis.