Process timeout

I have an error during Process execution:
Request timed out.
RequestUrl: (Method: POST)

In log also appears this error:
Scheduler Service: Error executing request for Activity CreateOrUpdateCustomer. Request duration = 301 secs. 
System.InvalidOperationException: Client found response content type of 'text/html; charset=utf-8', but expected 'text/xml'.
The request failed with the error message:
<!DOCTYPE html>
    <body bgcolor="white">
            <span><H1>Server Error in '/ScreeningCore' Application.<hr width=100% size=1 color=silver></H1>
            <h2> <i>Request timed out.</i> </h2></span>
            <font face="Arial, Helvetica, Geneva, SunSans-Regular, sans-serif ">
            <b> Description: </b>An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
            <b> Exception Details: </b>System.Web.HttpException: Request timed out.<br><br>
            <b>Source Error:</b> <br><br>
            <table width=100% bgcolor="#ffffcc">
An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.</code>
            <b>Stack Trace:</b> <br><br>
            <table width=100% bgcolor="#ffffcc">
[HttpException (0x80004005): Request timed out.]
            <hr width=100% size=1 color=silver>
            <b>Version Information:</b> Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.0.30319.34248
[HttpException]: Request timed out.

Stack trace:
   at System.Web.Services.Protocols.SoapHttpClientProtocol.ReadResponse(SoapClientMessage message, WebResponse response, Stream responseStream, Boolean asyncCall)
   at System.Web.Services.Protocols.SoapHttpClientProtocol.Invoke(String methodName, Object[] parameters)
   at OutSystems.HubEdition.RuntimePlatform.Processes.ActivityHandler.ExecuteActivityActionv2(String ssKey, Int32 activityId, Int32 processId, Int32 tenantId, ActivityStatus forInitialStatus, DateTime previousNextRun)
   at #uwf.#twf.Execute()
   at OutSystems.HubEdition.Scheduler.SchedulerProducerConsumer`1.<>c__DisplayClassa.<Execute>b__9()

and this (at the same time): Thread was being aborted.

   at System.Threading.Monitor.Enter(Object obj)
   at OutSystems.HubEdition.Extensibility.Data.TransactionService.GenericTransactionManager.GetRequestTransaction()
   at OutSystems.Internal.Db.DatabaseAccessProvider`1.GetRequestTransaction()
   at OutSystems.HubEdition.RuntimePlatform.Processes.ProcessBase.SaveProcessOutputs(HeContext heContext)
   at OutSystems.HubEdition.RuntimePlatform.Processes.ProcessBase.AbstractProcessActivityBase.SaveVariables(HeContext heContext)
   at OutSystems.HubEdition.RuntimePlatform.Processes.ProcessBase.AbstractProcessActivityBase.StartWork(HeContext heContext, Boolean isUnattended, ActivityStatus forInitialStatus, DateTime previousNextRun)

and also this (at the same time): Thread was being aborted.

RequestUrl: (Method: POST)
   at SNIReadSyncOverAsync(SNI_ConnWrapper* , SNI_Packet** , Int32 )
   at SNINativeMethodWrapper.SNIReadSyncOverAsync(SafeHandle pConn, IntPtr& packet, Int32 timeout)
   at System.Data.SqlClient.TdsParserStateObject.ReadSniSyncOverAsync()
   at System.Data.SqlClient.TdsParserStateObject.TryReadNetworkPacket()
   at System.Data.SqlClient.TdsParserStateObject.TryPrepareBuffer()
   at System.Data.SqlClient.TdsParserStateObject.TryReadByte(Byte& value)
   at System.Data.SqlClient.TdsParser.TryRun(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj, Boolean& dataReady)
   at System.Data.SqlClient.SqlDataReader.TryConsumeMetaData()
   at System.Data.SqlClient.SqlDataReader.get_MetaData()
   at System.Data.SqlClient.SqlCommand.FinishExecuteReader(SqlDataReader ds, RunBehavior runBehavior, String resetOptionsString)
   at System.Data.SqlClient.SqlCommand.RunExecuteReaderTds(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, Boolean async, Int32 timeout, Task& task, Boolean asyncWrite, SqlDataReader ds)
   at System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method, TaskCompletionSource`1 completion, Int32 timeout, Task& task, Boolean asyncWrite)
   at System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method)
   at System.Data.SqlClient.SqlCommand.ExecuteReader(CommandBehavior behavior, String method)
   at System.Data.SqlClient.SqlCommand.ExecuteDbDataReader(CommandBehavior behavior)
   at System.Data.Common.DbCommand.System.Data.IDbCommand.ExecuteReader()
   at OutSystems.HubEdition.Extensibility.Data.ExecutionService.BaseExecutionService.ExecuteReader(IDbCommand cmd)
   at #aDb.#wDb.ExecuteReader(String description, Boolean isApplication, Boolean transformParameters, Boolean skipLog)
   at OutSystems.Internal.Db.DatabaseAccessProvider`1.ExecuteQuery[T](Command cmd, GenericRecordList`1 rl, String description)
   at ssCustomers.Actions.FuncActionContact_CreateOrUpdate.datasetGetPeriodsByPatientId(HeContext heContext, Int32 maxRecords, IterationMultiplicity multiplicity, Int32& outParamCount, Int32 qpinP)
   at ssCustomers.Actions.ActionContact_CreateOrUpdate(HeContext heContext, RCContactRecord inParamSource, Int32 inParamSystemUserRoleId, RCContactRecord& outParamContact)
   at ssScreeningCore.RsseSpaceCustomers.MssContact_CreateOrUpdate(HeContext heContext, IRecord inParamSource, Int32 inParamSystemUserRoleId, IRecord& outParamContact)
   at ssScreeningCore.Actions.ActionContact_CreateOrUpdate(HeContext heContext, RCContactRecord inParamSource, Int32 inParamSystemUserRoleId, RCContactRecord& outParamContact)
   at ssScreeningCore.Actions.ActionScreeningData_Import(HeContext heContext, STExcelScreeningDataStructure inParamExcelScreeningData, Int32 inParamScreeningTemplateId)
   at ssScreeningCore.Processes.ProcExcUploading_Customer.ActExecCreateOrUpdateCustomer.ExecuteActivity(HeContext heContext)

Does anyone have an idea, why my Process throws the timeout? (it's similar to a Timer timeout exception, but I use Process not Timer)

thank you in advance,
Vasily Migunov
Hi Vasiliy,

Activities have an execution time limit as well. 300 seconds is the execution limit for Automatic Activities.

From the error stacks I can only say that when the timeout occured it was inside a ScreeningData_Import action, doing Contact_CreateOrUpdate operations.
See this topic for recommendations about the same issue.

João Rosado
Hi Vasily,

Few months ago I was facing exactly the same issue.

You must be giving WebService call and after that must be doing some database related operation.

So here problem is that one of value's datatype returned by your WebServic's XML is not matching with the structure generated. In structure one attribute's value must be integer and now webservice is returningit as a text so you are getting an error because text value can not be stored in integer and it is getting timed out.

Let me know, are you passing this response to RecordListToXML conversion? If that is true, replace that particular value with the integer before passing to that control.

I hope that works. If possible please post sample oml of this action.

Thank you for your answers!

Suraj, how I understand these other errors are engendered from timeout error, but thanks for your decision proposal.

João, thanks a lot for the link, I will solve the timeout issue the same way!