Exception: ArgumentOutOfRangeException was unhandled

Jul 11, 2011 at 1:03 PM
Edited Jul 11, 2011 at 2:12 PM

Hello,

I got this error when trying to use SftpClient.ListDirectory. 

Error message: {"capacity was less than the current size.\r\nParameter name: requiredLength"}

It was fine before, problem started last Thursday May, 7 around 12: 20 pm. Can someone help on this issue ASAP. Thanks.

 

 

Jul 11, 2011 at 2:22 PM

Have you tried the latest build?

Go here and click the Download to the right side. http://sshnet.codeplex.com/SourceControl/list/changesets

Jul 11, 2011 at 3:23 PM

I did download new version of 2011.5.14 and still got the same error.

It works after I downloaded v9056 from your link. :)

Thanks Kenneth!

Jul 11, 2011 at 5:06 PM

If you experience problems with v9056, and there is a new one availiable, download that and if you still have a problem you can open a topic here or maybe in the issues. But perhaps its best to post it in discussion so I can validate if the problem is sshnet :-)

Glad you got it working!

Coordinator
Jul 11, 2011 at 5:59 PM

It sounds like the problem occurred deep down, where I use StringBuilder class.

I did some SFTP refactoring since then so it should be fine now.

So, yes, if it happens again, please let us know, as well as scenario that you using so we could recreate the problem.

I am more interesting in how big is list directory that you queering.

 

Thanks,

Oleg

Jul 11, 2011 at 6:15 PM

It's the second level of directory from what I can see. It's "/boss1" when login to sftp site, tried go to "/boss1/_Output", then got error. Like I said in the first post, sftp client worked fine until last Thursday May, 7 around 12: 20 pm (ran one around 9:30 am EST).

Anyway, it works now after Idownloading v9056.

Definitely I will come here and post any problems it may occurs in the future.

Again, thanks for help!

Jul 11, 2011 at 6:21 PM
olegkap wrote:

It sounds like the problem occurred deep down, where I use StringBuilder class.

I did some SFTP refactoring since then so it should be fine now.

So, yes, if it happens again, please let us know, as well as scenario that you using so we could recreate the problem.

I am more interesting in how big is list directory that you queering.

 

Thanks,

Oleg


Just curious as I don't "see it"; how do you think that the size of the directory list would impact that method?

Coordinator
Jul 11, 2011 at 6:28 PM

well, this is just a guess, as I had a problem before with huge directory, so I thought it could be related.

Now another possible problem, may be again, is depends on the file name.

I know earlier I had a problem with SFTP path resolution routine, which I fixed, but after May release. It should not cause this problem, but may be.

And I think another assumption that I am making, if I remeber correctly, is that ListDirectory always return something, like "." and ".." entires and may be in his case it didnt.

So it could be many causes so huge directory is only one of them which I remember I had before already.

Jul 11, 2011 at 6:42 PM

I looked at the ListDirectoryCommand (?), and it should handle large lists just fine. But you might be into something about either filenames or the dots. I will look into it sometime. I'll just create an issue for myself so I dont have to remember it :P 

Jul 11, 2011 at 6:47 PM
This discussion has been copied to a work item. Click here to go to the work item and continue the discussion.
Jul 11, 2011 at 7:05 PM

FYI: current there are 192 files about 13MB in the directory.