we have a Timer running for every 5mins for a Server action that contains a  REST API which waits 60secs for response after that it will raise an error as operation has timed out. To handle this timed out error  we included an Exception Handler, with a call to the Server action again. 

This process is working fine up to 10mins after that Timer is giving Scheduler Error as below.

Error Detail
Time of Log:
2018-09-11 21:21:50

Session Id:

Scheduler Service: Error executing request for Timer XYZ. Request duration = 661 secs.  [retry 4 of 3 scheduled]
Environment InformationeSpaceVer: 0 (Id=0, PubId=0, CompiledWith=10.0.828.0)
RequestUrl:  (Method: )
AppDomain: Scheduler.exe
Path: C:\...\PS\
DateFormat: yyyy-M-d
PID: 5612 ('Scheduler', Started='8/15/2018 6:12:47 PM', Priv=65Mb, Virt=652Mb)
TID: 14
Thread Name: Timer Processor #2
.NET\: 4.0.30319.42000
[1] The underlying connection was closed: An unexpected error occurred on a receive.
   at System.Web.Services.Protocols.WebClientProtocol.GetWebResponse(WebRequest request)
   at System.Web.Services.Protocols.HttpWebClientProtocol.GetWebResponse(WebRequest request)
   at System.Web.Services.Protocols.SoapHttpClientProtocol.Invoke(String methodName, Object[] parameters)
   at OutSystems.HubEdition.Scheduler.TimerHandler.ExecuteTimer(String ssKey, Int32 timeout, Int32 tenantId)
   at OutSystems.HubEdition.Scheduler.TimerJob.<Execute>b__21_0()
   at OutSystems.HubEdition.ServerCommon.SandboxUtils.ExecuteForSingleSandbox(String sandboxToExecute, Action action)
   at OutSystems.HubEdition.Scheduler.SchedulerProducerConsumer`1.<>c__DisplayClass25_0.<Execute>b__0()

[2] Unable to read data from the transport connection: An existing connection was forcibly closed by the remote host.
   at System.Net.Sockets.NetworkStream.Read(Byte[] buffer, Int32 offset, Int32 size)
   at System.Net.PooledStream.Read(Byte[] buffer, Int32 offset, Int32 size)
   at System.Net.Connection.SyncRead(HttpWebRequest request, Boolean userRetrievedStream, Boolean probeRead)

[3] An existing connection was forcibly closed by the remote host
   at System.Net.Sockets.NetworkStream.Read(Byte[] buffer, Int32 offset, Int32 size)


Saranya P


Last I saw this giving error, it was a problem within the server 'antivirus', and I only solved the problem by disabling it. 

Could you share your espace? It`s a little bit odd having a timer that run every 5 minutes, that on timeout exception, you call the timer`s action again... It`s possible that you`re overflowing the server with calls to this timer, an so it trows this exception.


The way you are treating the timeout (calling the same action again) sounds fishy...

What kind of process are you trying to achieve? After the REST API call what do you do?

Meanwhile I'll leave you this link with some information about timeouts. You should know about the different timeouts in the platform before troubleshooting your app.


João Heleno