Timer being aborted - The underlying connection was closed: An unexpected error occur
Question

Hi all,

My team and I are having some trouble to identify what can be causing an issue when a timer is being aborted while trying to dump large amount of data to a SQL database consumed by an extension.

The target SQL database has plenty of space accordingly with the DB admins and there aren't any DB procedures running on parallel with my timer.
Update: This process as run without problems in the past, the logic implemented on the timer hasn't changed since last successful run and the SQL DB model hasn't changed too.

Any clues on what can be causing this issue?

The message below is what always been registered on Service Center -> Monitoring -> Timer Log

Scheduler Service: Error executing request http://127.0.0.1:80/XX_XXXXXXXXXX_XX/ for Timer Purge_Document. Request duration = 157 secs.  [retry 3 of 3 scheduled]

eSpaceVer: Id=0, PubId=0, CompiledWith=11.12.0.30456
RequestUrl: (Method: )
AppDomain: Scheduler.exe
Path: D:\Outsystems\Platform Server\Scheduler\
Locale:
DateFormat: yyyy-M-d
PID: 3556 ('Scheduler', Started='5/21/2022 11:32:33 PM', Priv=59Mb, Virt=630Mb)
TID: 11
Thread Name: Timer Processor #1 (Database: System)
.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.Scheduler.Core.TimerHandler.ExecuteTimer(String ssKey, Int32 timeout, Int32 tenantId)
at OutSystems.Scheduler.Core.TimerJob.Execute()
at OutSystems.Scheduler.Core.SchedulerProducerConsumer`1.Execute(Job job)

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

As per stack trace : An existing connection was forcibly closed by the remote host  and also timer has 3 tries. So it seems timer not getting response from DB somehow. Most probably it seems network error rather than data error.

I am not sure, but I think there may be many reasons which you can check like have permission to dump data on db, is appropriate port is open. Also if data set is large you can try to upload small chunk of data first. if it works or not.

regards

Sadly that's not the problem. I forgot to add more info to the description.
The timer as run without problems in the past, the logic implemented on the timer hasn't changed since last successful run and the SQL DB model hasn't changed too.

Anyway @Vikas Sharma  Thanks for your help.

Have you checked environment health for possible downtime to any FE servers?


Cheers

Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.