Post a reply

Before posting, please read how to report bug or request support effectively.

Bug reports without an attached log file are usually useless.

Options
Add an Attachment

If you do not want to add an Attachment to your Post, please leave the Fields blank.

(maximum 10 MB; please compress large files; only common media, archive, text and programming file formats are allowed)

Options

Topic review

LinQon

Re: Very Large folder getting Timeout waiting for WinSCP to respond

martin wrote:

Not SessionOptions.Timeout! Use Session.Timeout!


Perfect, that fixed it.
Thank you.
martin

Re: Very Large folder getting Timeout waiting for WinSCP to respond

Not SessionOptions.Timeout! Use Session.Timeout!
LinQon

Re: Very Large folder getting Timeout waiting for WinSCP to respond

martin wrote:

You have to set the Session.Timeout:
https://winscp.net/eng/docs/library_session#timeout


Thanks,
I've changed my $SessionOptions from using TimeoutInMilliseconds to the Timeout command. I must not be using it right as it still aborts after 65 seconds.

I've attached my script, would you be able to help me correct it?

Thanks
LinQon

Very Large folder getting Timeout waiting for WinSCP to respond

I've created a PowerShell script that works as expected copying files from a folder with <35K files.
However, WinSCP aborts after 65 seconds using the same script to copy files from a different folder (with >120K files) on the same SFTP server.

I have tried doubling the timeout to:
TimeoutInMilliseconds = 120000


The error message I get on failure is:
Exception calling "GetFiles" with "2" argument(s): "Timeout waiting for WinSCP to respond"

At E:\Scripts\MOS_DL.ps1:28 char:5
+     $session.GetFiles($SelectFiles, "E:\ITS_Archives\MOS\*").Check()
+     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (:) [], MethodInvocationException
    + FullyQualifiedErrorId : TimeoutException


Is there a way to increase the WinSCP timeout when reading a ridiculous number of files in a folder or is something else occurring?

Using WinSCP 5.9.4 on Windows Server 2008
Session & Debug logs attached