System.TimeoutException Opening Session

Advertisement

Rick.Myers.fti
Joined:
Posts:
2
Location:
Annapolis, MD

System.TimeoutException Opening Session

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?

Reply with quote

Advertisement

martin
Site Admin
martin avatar
Joined:
Posts:
28,096
Location:
Prague, Czechia

Re: System.TimeoutException Opening Session

Isn't the server under a heavy load, during those 15 minutes? Did you try setting a longer Session.Timeout?

Reply with quote

Rick.Myers.fti
Joined:
Posts:
2
Location:
Annapolis, MD

Re: System.TimeoutException Opening Session

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).

Reply with quote

martin
Site Admin
martin avatar
Joined:
Posts:
28,096
Location:
Prague, Czechia

Re: System.TimeoutException Opening Session

I was asking about Session.Timeout, not SessionOptions.Timeout(InMilliseconds).

The Session.Timeout is what throws the TimeoutException.

Reply with quote

Advertisement

You can post new topics in this forum