Sftp Download - Out of bound Array exception

0 votes
asked May 22, 2012 by ap0thecary (120 points)
edited Jul 12, 2012

Hello. I'm attempting a bulk transfer using the Download method and am experiencing a similar exception to what's outlined in this string: (http://forum.rebex.net/questions/2613/sftp-getfiles-throws-index-out-of-the-bounds-exception).

I'm able to successfully perform individual file, NonRecursive, transfers, ie:

client.Download("/cms/cmstables/chr0721", @"c:\sftp", TraversalMode.NonRecursive, TransferMethod.Copy, ActionOnExistingFiles.OverwriteAll);

however when I attempt a recursive, matchFilesShallow, or matchFilesDeep transfer, ie.

client.Download("/cms/cmstables/*", @"c:\sftp", TraversalMode.Recursive, TransferMethod.Copy, ActionOnExistingFiles.OverwriteAll);

the following exception is thrown:

System.ArgumentOutOfRangeException was unhandled
  Message=Index is out of the bounds of an array.
Parameter name: created
Actual value was 12/31/1969 4:00:00 PM.
  Source=Rebex.Sftp
  ParamName=created
  StackTrace:
       at Rebex.Net.SftpItem..ctor(String path, String filename, Int64 size, SftpItemType type, DateTime accessed, DateTime modified, DateTime created)
       at gbMKS.9h58kZ.ProcessRemoteDirectory(1YiDCIZ traversalInfo, Boolean addNewInfos)
       at 1RyBHn.1yALZOZ.cIZv0(1YiDCIZ )
       at 1RyBHn.1yALZOZ.N30HDZ()
       at 1RyBHn.1yALZOZ.Transfer(YpcDbZ method, 18waHwZ sourceFilter, String targetPath, TransferMethod transferMethod, MoveMode moveMode, LinkProcessingMode actionOnLinks, ActionOnExistingFiles actionOnExistingFiles, 1Acxa2 expectedRootItem)
       at gbMKS.9h58kZ.1jMzU7Z(28xx7VZ , p5IYsZ , String , TransferMethod , MoveMode , LinkProcessingMode , ActionOnExistingFiles )
       at Rebex.Net.Sftp.1yALZOZ(28xx7VZ , udycp , dpo7FZ , String , TransferMethod , MoveMode , LinkProcessingMode , ActionOnExistingFiles )
       at Rebex.Net.Sftp.VGSfy(udycp , String , String , TraversalMode , TransferMethod , MoveMode , LinkProcessingMode , ActionOnExistingFiles , Boolean )
       at Rebex.Net.Sftp.VGSfy(udycp , String , String , TraversalMode , TransferMethod , ActionOnExistingFiles )
       at Rebex.Net.Sftp.Download(String remotePath, String localDirectoryPath, TraversalMode traversalMode, TransferMethod transferMethod, ActionOnExistingFiles existingFileMode)
       at ConsoleApplication2.Program.Main(String[] args) in C:\Users\xxxx\Desktop\Projects\ECH\ECH Decoder\ConsoleApplication2\ConsoleApplication2\Program.cs:line 25
       at System.AppDomain._nExecuteAssembly(RuntimeAssembly assembly, String[] args)
       at System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity, String[] args)
       at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
       at System.Threading.ThreadHelper.ThreadStart_Context(Object state)
       at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean ignoreSyncCtx)
       at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
       at System.Threading.ThreadHelper.ThreadStart()
  InnerException: 

I'm using Rebex SFTP for .Net 2012 R1 (Trial Version). Anyone have any advice?

thanks, brad

1 Answer

0 votes
answered May 23, 2012 by Lukas Matyska (54,470 points)
edited Jul 12, 2012

UPDATE: This is fixed in version 2012 R2

It seems to be the same issue as you mentioned in your question. The answer of Lukas Pokorny should work for you too:

This is caused by a bug in a workaround for servers that return invalid (zero) date/time values (such as FreeFTPd). A hotfix is already available. Please download it from one of these URLs and give it a try:

Rebex SFTP - Hotfix Build 4527 (for .NET 2.0/3.0/3.5/4.0)

Rebex SFTP - Hotfix Build 4527 (for .NET CF 2.0/3.5)

commented May 23, 2012 by ap0thecary (120 points)
edited May 23, 2012

That worked perfectly. Thanks Lukas.

...