Session timeout issue every 10-15 mins during activity not during inactivity.

3
Users are kicked out of app and redirects to login page during activity. Session timeout occurs every 10-15 mins during activity not during inactivity  in our mendix application. We are running mendix app in kubernetes cluster(ACS) and with Azure SQL DB. Session timeout happens during activity. The modeler version of  app is 7.23.9. In our kubernetes logs, we see below error when session timeout occurs ERROR - Core: Batch update of sessions that should be kept alive failed ERROR - Core: com.mendix.connectionbus.ConnectionBusRuntimeException: com.microsoft.sqlserver.jdbc.SQLServerException: The connection is closed. at com.mendix.connectionbus.connections.jdbc.TransactionConnectionManagerAction.addSavepoint(TransactionConnectionManagerAction.java:52) Could anyone help in this? What could have caused this?   Below is the stack trace:   2020-04-06T04:58:48.932209055Z ERROR - Core: Batch update of sessions that should be kept alive failed 2020-04-06T04:58:48.932301156Z ERROR - Core: com.mendix.connectionbus.ConnectionBusRuntimeException: com.microsoft.sqlserver.jdbc.SQLServerException: The connection is closed. 2020-04-06T04:58:48.932443557Z     at com.mendix.connectionbus.connections.jdbc.TransactionConnectionManagerAction.addSavepoint(TransactionConnectionManagerAction.java:52) 2020-04-06T04:58:48.932454457Z  2020-04-06T04:58:48.932641559Z Caused by: com.microsoft.sqlserver.jdbc.SQLServerException: The connection is closed. 2020-04-06T04:58:48.932680259Z     at com.microsoft.sqlserver.jdbc.SQLServerException.makeFromDriverError(SQLServerException.java:226) 2020-04-06T04:58:48.932817561Z     at com.microsoft.sqlserver.jdbc.SQLServerConnection.checkClosed(SQLServerConnection.java:1051) 2020-04-06T04:58:48.932830061Z     at com.microsoft.sqlserver.jdbc.SQLServerConnection.setSavepoint(SQLServerConnection.java:5018) 2020-04-06T04:58:48.933062263Z     at org.apache.commons.dbcp2.DelegatingConnection.setSavepoint(DelegatingConnection.java:671) 2020-04-06T04:58:48.933087963Z     at org.apache.commons.dbcp2.DelegatingConnection.setSavepoint(DelegatingConnection.java:671) 2020-04-06T04:58:48.933243065Z     at com.mendix.connectionbus.connections.jdbc.TransactionConnectionManagerAction.addSavepoint(TransactionConnectionManagerAction.java:49) 2020-04-06T04:58:48.933473667Z     at com.mendix.connectionbus.connections.jdbc.TransactionConnectionManager.addSavepoint(TransactionConnectionManager.java:50) 2020-04-06T04:58:48.933484967Z     at com.mendix.connectionbus.connections.jdbc.JdbcDataStore.addSavepoint(JdbcDataStore.java:706) 2020-04-06T04:58:48.933647568Z     at com.mendix.connectionbus.ConnectionBusImpl.addSavepoint(ConnectionBusImpl.java:600) 2020-04-06T04:58:48.933656968Z     at com.mendix.basis.action.RequestScope.pushSavePoint(RequestScope.scala:183) 2020-04-06T04:58:48.93384997Z     at com.mendix.basis.action.RequestScope.startTransaction(RequestScope.scala:119) 2020-04-06T04:58:48.93387657Z     at com.mendix.basis.action.ContextImpl.startTransaction(ContextImpl.java:198) 2020-04-06T04:58:48.934092872Z     at com.mendix.basis.action.system.SessionKeepAlive$.$anonfun$updateSessionsInTheDatabase$7(SessionKeepAlive.scala:88) 2020-04-06T04:58:48.934107872Z     at scala.runtime.java8.JFunction0$mcV$sp.apply(JFunction0$mcV$sp.java:23) 2020-04-06T04:58:48.934115272Z     at scala.util.Try$.apply(Try.scala:213) 2020-04-06T04:58:48.934292274Z     at com.mendix.basis.action.system.SessionKeepAlive$.updateSessionsInTheDatabase(SessionKeepAlive.scala:87) 2020-04-06T04:58:48.934424175Z     at com.mendix.basis.action.system.SessionKeepAlive$.keepAlive(SessionKeepAlive.scala:31) 2020-04-06T04:58:48.934554176Z     at com.mendix.basis.action.system.SessionKeepAliveUpdateAction.execute(SessionKeepAliveUpdateAction.scala:23) 2020-04-06T04:58:48.934684678Z     at com.mendix.basis.action.system.SessionKeepAliveUpdateAction.execute(SessionKeepAliveUpdateAction.scala:14) 2020-04-06T04:58:48.934701278Z     at com.mendix.basis.actionmanagement.CoreActionHandlerImpl.doCall(CoreActionHandlerImpl.scala:79) 2020-04-06T04:58:48.93493558Z     at com.mendix.basis.actionmanagement.CoreActionHandlerImpl.call(CoreActionHandlerImpl.scala:57) 2020-04-06T04:58:48.935052481Z     at com.mendix.core.actionmanagement.CoreAction.call(CoreAction.java:55) 2020-04-06T04:58:48.935224483Z     at com.mendix.basis.actionmanagement.ActionManagerBase$1.execute(ActionManagerBase.java:150) 2020-04-06T04:58:48.935253483Z     at com.mendix.util.classloading.Runner.doRunUsingClassLoaderOf(Runner.java:32) 2020-04-06T04:58:48.936660696Z     at com.mendix.basis.actionmanagement.ActionManagerBase.executeSync(ActionManagerBase.java:155) 2020-04-06T04:58:48.936681996Z     at com.mendix.basis.actionmanagement.SystemScheduledAction.executeScheduledAction(ScheduledAction.scala:42) 2020-04-06T04:58:48.936687296Z     at com.mendix.basis.actionmanagement.ScheduledAction$ScheduledRun.$anonfun$run$1(ScheduledAction.scala:141) 2020-04-06T04:58:48.936691896Z     at com.mendix.basis.actionmanagement.IMonitoredAction$$anon$1.execute(IMonitoredAction.scala:47) 2020-04-06T04:58:48.936696596Z     at com.mendix.util.classloading.Runner.doRunUsingClassLoaderOf(Runner.java:32) 2020-04-06T04:58:48.936701196Z     at com.mendix.basis.actionmanagement.IMonitoredAction.monitor(IMonitoredAction.scala:49) 2020-04-06T04:58:48.936705896Z     at com.mendix.basis.actionmanagement.IMonitoredAction.monitor$(IMonitoredAction.scala:25) 2020-04-06T04:58:48.936724096Z     at com.mendix.basis.actionmanagement.ScheduledAction$ScheduledRun.monitor(ScheduledAction.scala:132) 2020-04-06T04:58:48.936728396Z     at com.mendix.basis.actionmanagement.ScheduledAction$ScheduledRun.run(ScheduledAction.scala:141) 2020-04-06T04:58:48.936733096Z     at com.mendix.basis.actionmanagement.ScheduledAction.execute(ScheduledAction.scala:130) 2020-04-06T04:58:48.936738296Z     at com.mendix.basis.actionmanagement.ScheduledAction.run(ScheduledAction.scala:111) 2020-04-06T04:58:48.936742996Z     at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) 2020-04-06T04:58:48.936747696Z     at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:308) 2020-04-06T04:58:48.936759797Z     at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(ScheduledThreadPoolExecutor.java:180) 2020-04-06T04:58:48.936764697Z     at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:294) 2020-04-06T04:58:48.936770697Z     at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) 2020-04-06T04:58:48.936873498Z     at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) 2020-04-06T04:58:48.936884298Z     at java.lang.Thread.run(Thread.java:748) 2020-04-06T04:58:48.936888398Z   
asked
3 answers
1

Similar problem here.  One interesting thing we noticed was that the user session, the last active date/time did not update.  I believe that this is the symptom of the problem.  A simple restart of the application appears to have resolved the immediate issue.

We found release notes on newer versions of Studio Pro.  Note in the release notes the comment about the below under “Fixes”. 

session keep alive

https://docs.mendix.com/releasenotes/studio-pro/7.23

https://docs.mendix.com/releasenotes/studio-pro/8.6

https://docs.mendix.com/releasenotes/studio-pro/8.12

It appears as if an upgrade to the relevant sub version may be necessary.

answered
1

Hey Chandrashekar, 


Did you ever resolve this? I’m also experiencing this now, and it’s causing us quite a headache. 
 

Thanks,

Matthew 

answered
0

The connection to your sql server connection is being closed.

That probably depends on a setting in sql server. I don't know enough about SqlServer to know which setting, i am afraid.

answered