Can't start Confluence after server reboot.
Asked by Nicol?s Coniglio:

Hello, I'm having troubles to start Confluence. I get the following error when access from a browser after restart:

Unable to start up Confluence. Fatal error during startup sequence: confluence.lifecycle.core:mananagedjobs (Start and stop the Managed Scheduled Jobs)

JDBC exception on Hibernate data access: SQLException for SQL \[n/a\]; SQL state \[HY000\]; error code \[3024\]; could not extract ResultSet; nested exception is org.hibernate.exception.GenericJDBCException: could not extract ResultSet

Here is the error in atlassian-confluence.log:

2018-07-17 11:37:21,184 ERROR \[localhost-startStop-1\] \[atlassian.config.lifecycle.LifecycleManager\] panicAndShutdown Unable to start up Confluence. Fatal error during startup sequence: confluence.lifecycle.core:mananagedjobs (Start and stop the Managed Scheduled Jobs)  
org.springframework.orm.hibernate5.HibernateJdbcException: JDBC exception on Hibernate data access: SQLException for SQL \[n/a\]; SQL state \[HY000\]; error code \[3024\]; could not extract ResultSet; nested exception is org.hibernate.exception.GenericJDBCException: could not extract ResultSet  
at org.springframework.orm.hibernate5.SessionFactoryUtils.convertHibernateAccessException(SessionFactoryUtils.java:248)  
at org.springframework.orm.hibernate5.HibernateTemplate.doExecute(HibernateTemplate.java:366)  
at org.springframework.orm.hibernate5.HibernateTemplate.execute(HibernateTemplate.java:313)  
at com.atlassian.confluence.internal.schedule.persistence.dao.HibernateInternalRunDetailsDao.getRecentRunDetails(HibernateInternalRunDetailsDao.java:102)  
at com.atlassian.confluence.internal.schedule.persistence.dao.HibernateInternalRunDetailsDao.getRecentRunDetails(HibernateInternalRunDetailsDao.java:114)  
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)  
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)  
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)  
at java.lang.reflect.Method.invoke(Method.java:498)  
at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:302)  
at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:190)  
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:157)  
at org.springframework.transaction.interceptor.TransactionInterceptor$1.proceedWithInvocation(TransactionInterceptor.java:99)  
at org.springframework.transaction.interceptor.TransactionAspectSupport.invokeWithinTransaction(TransactionAspectSupport.java:281)  
at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:96)  
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)  
at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:208)  
at com.sun.proxy.$Proxy156.getRecentRunDetails(Unknown Source)  
at com.atlassian.confluence.schedule.managers.DefaultScheduledJobStatusManager.getScheduledJobStatus(DefaultScheduledJobStatusManager.java:69)  
at com.atlassian.confluence.schedule.managers.DefaultScheduledJobManager.getScheduledJob(DefaultScheduledJobManager.java:102)  
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)  
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)  
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)  
at java.lang.reflect.Method.invoke(Method.java:498)  
at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:302)  
at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:190)  
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:157)  
at org.springframework.transaction.interceptor.TransactionInterceptor$1.proceedWithInvocation(TransactionInterceptor.java:99)  
at org.springframework.transaction.interceptor.TransactionAspectSupport.invokeWithinTransaction(TransactionAspectSupport.java:281)  
at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:96)  
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)  
at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:208)  
at com.sun.proxy.$Proxy158.getScheduledJob(Unknown Source)  
at com.atlassian.confluence.schedule.quartz.ManagedScheduledJobTriggerFactory.createAndRegisterTrigger(ManagedScheduledJobTriggerFactory.java:218)  
at com.atlassian.confluence.schedule.quartz.ManagedScheduledJobTriggerFactory.initialiseTriggers(ManagedScheduledJobTriggerFactory.java:152)  
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)  
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)  
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)  
at java.lang.reflect.Method.invoke(Method.java:498)  
at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:302)  
at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:190)  
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:157)  
at org.springframework.transaction.interceptor.TransactionInterceptor$1.proceedWithInvocation(TransactionInterceptor.java:99)  
at org.springframework.transaction.interceptor.TransactionAspectSupport.invokeWithinTransaction(TransactionAspectSupport.java:281)  
at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:96)  
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)  
at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:208)  
at com.sun.proxy.$Proxy159.initialiseTriggers(Unknown Source)  
at com.atlassian.confluence.schedule.listeners.ManagedScheduledJobsLifecycle.startup(ManagedScheduledJobsLifecycle.java:24)  
at com.atlassian.confluence.impl.setup.DefaultLifecycleManager.startUp(DefaultLifecycleManager.java:49)  
at com.atlassian.config.lifecycle.LifecycleServletContextListener.contextInitialized(LifecycleServletContextListener.java:17)  
at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4627)  
at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5091)  
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)  
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1427)  
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1417)  
at java.util.concurrent.FutureTask.run(FutureTask.java:266)  
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)  
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)  
at java.lang.Thread.run(Thread.java:748)  
Caused by: org.hibernate.exception.GenericJDBCException: could not extract ResultSet  
at org.hibernate.exception.internal.StandardSQLExceptionConverter.convert(StandardSQLExceptionConverter.java:47)  
at org.hibernate.engine.jdbc.spi.SqlExceptionHelper.convert(SqlExceptionHelper.java:111)  
at org.hibernate.engine.jdbc.spi.SqlExceptionHelper.convert(SqlExceptionHelper.java:97)  
at org.hibernate.engine.jdbc.internal.ResultSetReturnImpl.extract(ResultSetReturnImpl.java:80)  
at org.hibernate.loader.Loader.getResultSet(Loader.java:2123)  
at org.hibernate.loader.Loader.executeQueryStatement(Loader.java:1911)  
at org.hibernate.loader.Loader.executeQueryStatement(Loader.java:1887)  
at org.hibernate.loader.Loader.doQuery(Loader.java:932)  
at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:349)  
at org.hibernate.loader.Loader.doList(Loader.java:2615)  
at org.hibernate.loader.Loader.doList(Loader.java:2598)  
at org.hibernate.loader.Loader.listIgnoreQueryCache(Loader.java:2430)  
at org.hibernate.loader.Loader.list(Loader.java:2425)  
at org.hibernate.loader.hql.QueryLoader.list(QueryLoader.java:502)  
at org.hibernate.hql.internal.ast.QueryTranslatorImpl.list(QueryTranslatorImpl.java:370)  
at org.hibernate.engine.query.spi.HQLQueryPlan.performList(HQLQueryPlan.java:216)  
at org.hibernate.internal.SessionImpl.list(SessionImpl.java:1481)  
at org.hibernate.query.internal.AbstractProducedQuery.doList(AbstractProducedQuery.java:1441)  
at org.hibernate.query.internal.AbstractProducedQuery.list(AbstractProducedQuery.java:1410)  
at com.atlassian.confluence.internal.schedule.persistence.dao.HibernateInternalRunDetailsDao.lambda$getRecentRunDetails$0(HibernateInternalRunDetailsDao.java:108)  
at org.springframework.orm.hibernate5.HibernateTemplate.doExecute(HibernateTemplate.java:359)  
... 58 more  
Caused by: java.sql.SQLException: Query execution was interrupted, maximum statement execution time exceeded  
at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:1072)  
at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3563)  
at com.mysql.jdbc.MysqlIO.nextRowFast(MysqlIO.java:1553)  
at com.mysql.jdbc.MysqlIO.nextRow(MysqlIO.java:1409)  
at com.mysql.jdbc.MysqlIO.readSingleRowSet(MysqlIO.java:2888)  
at com.mysql.jdbc.MysqlIO.getResultSet(MysqlIO.java:476)  
at com.mysql.jdbc.MysqlIO.readResultsForQueryOrUpdate(MysqlIO.java:2581)  
at com.mysql.jdbc.MysqlIO.readAllResults(MysqlIO.java:1757)  
at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:2171)  
at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2693)  
at com.mysql.jdbc.PreparedStatement.executeInternal(PreparedStatement.java:2102)  
at com.mysql.jdbc.PreparedStatement.executeQuery(PreparedStatement.java:2261)  
at com.mchange.v2.c3p0.impl.NewProxyPreparedStatement.executeQuery(NewProxyPreparedStatement.java:379)  
at org.hibernate.engine.jdbc.internal.ResultSetReturnImpl.extract(ResultSetReturnImpl.java:71)

This is the hibernate configuration extracted from confluence.cfg.xml

\<property name="confluence.setup.server.id"\>BXVR-S3YR-DY1T-23DW\</property\>  
\<property name="confluence.webapp.context.path"\>\</property\>  
\<property name="hibernate.c3p0.acquire_increment"\>1\</property\>  
\<property name="hibernate.c3p0.automaticTestTable"\>conTestTable\</property\>  
\<property name="hibernate.c3p0.idle_test_period"\>30\</property\>  
\<property name="hibernate.c3p0.max_size"\>60\</property\>  
\<property name="hibernate.c3p0.max_statements"\>0\</property\>  
\<property name="hibernate.c3p0.min_size"\>0\</property\>  
\<property name="hibernate.c3p0.timeout"\>300\</property\>  
\<property name="hibernate.connection.driver_class"\>com.mysql.jdbc.Driver\</property\>  
\<property name="hibernate.connection.password"\>Centos.1234\</property\>  
\<property name="hibernate.connection.url"\>jdbc:mysql://192.168.140.111/confluence?autoReconnect=true\&amp;\</property\>  
\<property name="hibernate.connection.username"\>confluence\</property\>  
\<property name="hibernate.database.lower_non_ascii_supported"\>true\</property\>  
\<property name="hibernate.dialect"\>com.atlassian.confluence.impl.hibernate.dialect.MySQLDialect\</property\>  
\<property name="hibernate.setup"\>true\</property\>  

I need help with this problem, I've looked and can't find the solution.

Thanks in advance!


Answers:
author: AnnWorley
body: Hi Nicol?s,

That error "could not extract ResultSet" was resolved in another case by adding permissions to the user Confluence uses to connect to the database. Please check out this thread and see if that works for your case: [Confluence MS SQL Server connection with Microsoft Authentication Mode](https://community.atlassian.com/t5/Confluence-questions/Confluence-MS-SQL-Server-connection-with-Microsoft/qaq-p/711969)

Thanks,

Ann

comments: author: Nicol?s Coniglio
body: Hi Ann, I've already seen this case, gave the permissions, but the problem persists :(


author: AnnWorley
body: I understand the user has full permissions on the MySQL database but you are still seeing "could not extract ResultSet" when you start Confluence.

Were there any moves, adds or changes in the environment since last time you started Confluence? Since this is happening on a restart and not a new installation we have to ask ourselves what may have changed since the last restart.


author: AnnWorley
body: [@Nicol?s Coniglio](/t5/user/viewprofilepage/user-id/1614615) - What version of Confluence server are you running? My test instance on MySQL doesn't have a test table in the confluence.cfg.xml like the in the one you posted:

```
<property name="hibernate.c3p0.automaticTestTable">conTestTable</property>
```

Is that something your team added? I found a [Stack Overflow post](https://stackoverflow.com/questions/49827199/springboot-could-not-extract-resultset) where the "could not extract ResultSet" was being seen because of a mixed case test table name.

Please try backing up the file, removing that line from confluence.cfg.xml and restarting Confluence.


author: Pavel Potcheptsov
body: Check if your Mysql server at 192.168.140.111 is up and running.

Execute this from confluence server console:

```
telnet 192.168.140.111 3306
```

comments: author: Nicol?s Coniglio
body: Yes it is running fine, and it is in the same server too, so there isn't conectivity issues.


Tags: confluence-server

server