Topic "Very Large folder getting Timeout waiting for WinSCP to respond"

Author Message
LinQon
[View user's profile]
Donor
Joined: 2017-03-28
Posts: 3
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:
Code:
TimeoutInMilliseconds = 120000


The error message I get on failure is:
Code:
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
Debug.log (43.9 KB) [Download]

Description: Debug Log

MOS.log (138.05 KB) [Download]

Description: Session Log

Advertisements
martin◆
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 26911
Location: Prague, Czechia
You have to set the Session.Timeout:
https://winscp.net/eng/docs/library_session#timeout
LinQon
[View user's profile]
Donor
Joined: 2017-03-28
Posts: 3
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
DL-Script.txt (1.04 KB) Private file

Description: Powershell script

martin◆
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 26911
Location: Prague, Czechia
Not SessionOptions.Timeout! Use Session.Timeout!
LinQon
[View user's profile]
Donor
Joined: 2017-03-28
Posts: 3
martin wrote:
Not SessionOptions.Timeout! Use Session.Timeout!


Perfect, that fixed it.
Thank you.
Advertisements

You can post new topics in this forum

Search

What is WinSCP?

It is award-winning SFTP client, SCP client, FTPS client and FTP client integrated into one software program for file transfer to FTP server or secure SFTP server. [More]

And it's free!

Donate

About donations

$9   $19   $49   $99

About donations

Recommend

WinSCP Privacy Policy

WinSCP License