Topic "System.TimeoutException Opening Session"

Author Message
Rick.Myers.fti
[View user's profile]

Joined: 2017-04-13
Posts: 2
Location: Annapolis, MD
I have a powershell script that calls several .NET programs that SFTP files. The script runs every hour and runs days without any problems. However, once in a while, it programs get a System.TimeoutException when performing the Session.Open(). The issue lasts about 15 minutes before correcting itself. The script is running multiple programs, some of them may fail before eventually recovering.

The script executes under the same user account each time.

WInSCP v5.9.3 .Net Assembly (NET 4.6.1)
Windows 2008 R2

Actual Exception:

System.TimeoutException: Timeout waiting for WinSCP to respond - WinSCP has not responded in time.There was no output. Response log file C:\Users\myserviceaccount\AppData\Local\Temp\wscp09E0.0348C725.tmp was not created. This could indicate lack of write permissions to the log folder or problems starting WinSCP itself.
at WinSCP.Session.CheckForTimeout(String additional)
at WinSCP.Session.Open(SessionOptions sessionOptions)

There is an older version of WinSCP running on the same server, however my application is running the version referenced in the NuGet package. Could there be a conflict with running multiple and/or different versions of WinSCP on the same sever?
Advertisements
martin◆
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 26911
Location: Prague, Czechia
Isn't the server under a heavy load, during those 15 minutes? Did you try setting a longer Session.Timeout?
Rick.Myers.fti
[View user's profile]

Joined: 2017-04-13
Posts: 2
Location: Annapolis, MD
martin wrote:
Isn't the server under a heavy load, during those 15 minutes? Did you try setting a longer Session.Timeout?


I'm running a 8 core Server running at 5% CPU when error occurred.

SessionOptions.TimeoutInMilliseconds set to 2 minutes, I believe that delay is the establishment of a session would expect to get a WinSCP.SessionRemoteException. Not really sure when System.TimeoutException is thrown.

I modified my send logic to implement a return loop (Circuit Breaker Pattern); Retries continue until it finally runs after 10 minutes. Bottom line, can code around the issue, still not sure why the timeout occurs. SFTP Site is up and running, can open the WINSCP UI and connect fine (no error).
martin◆
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 26911
Location: Prague, Czechia
I was asking about Session.Timeout, not SessionOptions.Timeout(InMilliseconds).

The Session.Timeout is what throws the TimeoutException.
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