Connection time out error

Connection time out error

  

Hi, 

I have a list displaying records from a few entities, it seemed to work fine when there was minimal data in entity but now I am getting an error "The connection has timed out". Is there a way to increase the time it spends trying to run the server actions that gather the data prior to receiving this error?


Thanks.

Hi Chris,

Are your servers under VPN?

Nope. I should probably also mention I get the error after about 10 seconds.

We are also having this issue on some anroid devices. Especially on the 5.1 versions.

Increasing the timeouts is available on your espace properties, but wont sovle this issue.

On Wchich anroid version are you trying to run your application?

I'm running it on iPhone7 with the outsystems now application. If I modify the query that collects the data with a filter so only 1 result is displayed, it works fine. It just seems to not have enough time to collect the data. Where is the timeout espace property you mentioned?

Hi Chris,

You can select the aggregate and set a specific timeout just for this aggregate in its Server Request Timeout property.

You will note that, by default, it is inheriting the module's timeout. You can find it in the properties of the module (or eSpace, as you mentioned).

Anyway, it seems the query is taking too long...

It would be good to look into it to understand better the reasons.

Alternatively, a good practice is also to go to ServiceCenter and check the logs about slow queries.

I hope I've been of some help.

Kind regards,

Jaime

That looks like it would do the job but for some reason I can't publish the espace, it's getting stuck on step 2 (Generating and compiling ASP.NET......). Not sure if there's something wrong with Outsystems or my server/cloud environment?


Edit: The error message displayed is -

Invalid compiler output.
Timeout expired.  The timeout period elapsed prior to completion of the operation or the server is not responding.

Exception Details:
[1] System.Data.SqlClient.SqlException (0x80131904): Timeout expired.  The timeout period elapsed prior to completion of the operation or the server is not responding. ---> System.ComponentModel.Win32Exception (0x80004005): The wait operation timed out
   at System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection, Action`1 wrapCloseInAction)
   at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj, Boolean callerHasConnectionLock, Boolean asyncClose)
   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, Boolean describeParameterEncryptionRequest)
   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 OutSystems.HubEdition.DatabaseProvider.SqlServer.ExecutionService.ExecutionService.ExecuteReader(IDbCommand cmd)
   at OutSystems.HubEdition.DatabaseProvider.SqlServer.IntrospectionService.IntrospectionService.GetPrimaryKeyColumns(TableSourceInfo tableSource)
   at OutSystems.HubEdition.DatabaseProvider.SqlServer.Platform.IntrospectionService.PlatformIntrospectionService.<GetColumns>d__70.MoveNext()
   at System.Linq.Enumerable.WhereSelectEnumerableIterator`2.MoveNext()
   at System.Collections.Generic.List`1..ctor(IEnumerable`1 collection)
   at System.Linq.Enumerable.ToList[TSource](IEnumerable`1 source)
   at OutSystems.HubEdition.Compiler.Database.DALTypesConverter.ConvertColumns(IPlatformTableSourceInfo tableInfo, PlatformDatabaseContext context)
   at OutSystems.HubEdition.Compiler.Database.EntitySchema.EntitySchemaUpdater.DumpEspaceEntities(Boolean forceFullIntrospection)
   at OutSystems.HubEdition.Compiler.Database.EntitySchema.EntitySchemaUpdater.Dump(CompilationContext compilationContext)
   at OutSystems.HubEdition.Compiler.ESpace.UpdateDatabaseScript()
   at OutSystems.HubEdition.Compiler.ESpace.UpdateDatabaseScriptThread()
ClientConnectionId:73dc216d-1fbe-415b-829c-c62587c3b5c0
Error Number:-2,State:0,Class:11[2] System.ComponentModel.Win32Exception (0x80004005): The wait operation timed out

Hello Chris,

Both issues seem to suggest your database is struggling... could you give me a bit more info about your environment? Is it a personal (if so, what's the URL?) or an enterprise (on the cloud or on-premise). 

Cheers,
R

Ok bare with me because I don't know the correct terms for everything - It's a personal phone application. Most of the entities are from server side cloud environment, not sure what the URL is as the server side has no webscreens, purely entities (database storage), and then 1 or 2 local entities to store data on the device.


The application was working fine aside from my initial timeout error. After adjusting the timeout property for the SQL used the space wouldn't save. I tried reverting them back and the space still wouldn't save. I closed the application and outsystems and re-opened my environment (which I believe should take me back to thelast saved version) and even if I try publish this it still come up with this error.


To avoid a duplication of effort, I've actually raised this issue separately here:
http://www.outsystems.com/forums/discussion/21374/invalid-compiler-output/#Post83667

Ok so the error of not being able to publish my app is now fixed. I set the SQL timeout property to 30 seconds however I am still receiving a connection timeout error message after 10 seconds. 

Hello Chris,

Can you check if you still get the timeout error?

If so, can you confirm that your device can reach the Personal environment? Because if it reaches the personal environment you should have more information on Service Center logs regarding that request, how long it takes and if it's generating any error.

Cheers

Yep, still getting the error.

How do I confirm the device can reach the personal environment? At the moment everything seems to work except this query. I have a few pages that simply view the data within each entity and that all looks ok. Within the screen that I get the timeout error on, I have a button that filters the results (like show 'x' results) which seems to work fine. I'm fairly sure the description for the error says 'undefined' (if I'm looking in the right place).

Solution

Hello Chris,


If you're hitting on the 10 second timeout, I suspect you still have the default 10 s set in the module property Server Request Timeout.


Try to change this value to 60s, and deploy your application again. (unsure if you'll need to generate a new native build).

Cheers


Solution

That got it! Thanks very much!

Hello Chris,


Open your module with the Development Environment IDE, and select the top object on the module tree at the right. This is the module object, and below you'll find it's properties. One of these properties is the Server Request Timeout. change it and publish the module again.


Cheers