0 votes
by (190 points)

Hi,

My question is about getting this exception when trying to download a file from an SFTP server using DownloadAsync() with TransferMethod = Move:

Rebex.Net.SftpException: Error when retrieving items from a remote directory ('/MyDirectory'). Failure; Cannot invoke "Object.toString()" because the return value of "java.util.Map.get(Object)" is null.
   at kuwh.vidj(snro are, Type arf)
   at kuwh.vicv(kuwd apu, kuvq apv)
   at Rebex.Net.Sftp.nqzf(String su, Regex sv, kuvq sw, snfi sx)
   at kuwc.nbef(snfd bee, Boolean bef)
   --- End of inner exception stack trace ---
   at snff.nbds(Exception gw, TransferProblemType gx, snfc gy, snfc gz, BatchProblemReactions ha, BatchProblemReactions hb, BatchProblemReactions& hc)
   at snff.nbde(snfd fj)
   at snff.nbdc()
   at snff.nbdb(TransferAction fa, snfb fb, String fc, TransferMethod fd, MoveMode fe, LinkProcessingMode ff, ActionOnExistingFiles fg, snfc fh)
   at Rebex.Net.Sftp.nqzz(TransferAction ut, kuvq uu, kuwb uv, String uw, TransferMethod ux, MoveMode uy, LinkProcessingMode uz, ActionOnExistingFiles va)
   at Rebex.Net.Sftp.nraq(Object ws, Enum wt, Object[] wu)
   at snrp.ifwz()

The weird thing is that checking the local folder, the file WAS downloaded despite this exception in the log.

Why could this exception happen if the file gets downloaded anyway?

I realize that it might be impossible to answer this without more info, but the same type of text file is successfully processed at other times (this happens daily), usually with minimal or even no differences in its contents, so I doubt it's an issue with the file itself.

Just curious if there's a known issue with this outdated version, or if others have encountered this exception and if they've solved it.

Version: Rebex SFTP (2018 R4) for .NET 4.0-4.7

Thank you!

Applies to: Rebex SFTP

1 Answer

+1 vote
by (147k points)

This SftpException was thrown because the SFTP server responded with an error status to one of the client's commands. A debug log created using Sftp object's LogWriter property should make it possible to tell which command failed.

The error status received from the server contained the following error message:

Cannot invoke "Object.toString()" because the return value of "java.util.Map.get(Object)" is null.

This means that the root cause of the issue is a problem in some Java routine at the server (possibly a server-side bug), whose error message then gets passed to the client (another server-side bug). Most SFTP servers report an "Internal error" message if they run into an unexpected internal issue in the server code.

So this is unlikely to be caused by an outdated client version. A server-side bug is the most likely cause.

by (190 points)
Thank you for your response!
...