shashank joshi
shashank joshi

Reputation: 148

keycloak server 15.0.2 timeout error for mysql 5.7 and Java 17 and jconnect 8

I am getting error while connecting kycloak server 15.0.2 to my SQL 5.7 database using connect 8.0.27.

After starting keycloak server, I can see tables created by keycloak server in keycloak schema. But server starts and stops with errors.

At the first startup after configuring MySQL datasource, it get hung for 5 minutes, throws timeout exception and then stops with following stacktrace:

liquibase.exception.UnexpectedLiquibaseException: java.sql.SQLException: IJ031070: Transaction cannot proceed: STATUS_ROLLEDBACK

at liquibase.database.jvm.JdbcConnection.getURL(JdbcConnection.java:79)

at liquibase.executor.jvm.JdbcExecutor.execute(JdbcExecutor.java:66)

at liquibase.executor.jvm.JdbcExecutor.execute(JdbcExecutor.java:113)

at liquibase.database.AbstractJdbcDatabase.execute(AbstractJdbcDatabase.java:1277)

at liquibase.database.AbstractJdbcDatabase.executeStatements(AbstractJdbcDatabase.java:1259)

at liquibase.changelog.ChangeSet.execute(ChangeSet.java:582)

... 76 more

Caused by: java.sql.SQLException: IJ031070: Transaction cannot proceed: STATUS_ROLLEDBACK

at org.jboss.jca.adapters.jdbc.WrapperDataSource.checkTransactionActive(WrapperDataSource.java:272)

at org.jboss.jca.adapters.jdbc.WrappedConnection.checkTransactionActive(WrappedConnection.java:2007)

at org.jboss.jca.adapters.jdbc.WrappedConnection.checkStatus(WrappedConnection.java:2022)

at org.jboss.jca.adapters.jdbc.WrappedConnection.checkTransaction(WrappedConnection.java:1996)

at org.jboss.jca.adapters.jdbc.WrappedConnection.getMetaData(WrappedConnection.java:982)

at liquibase.database.jvm.JdbcConnection.getURL(JdbcConnection.java:77)

... 81 more

At subsequent startups, it throws foreign key error as follows and then again stops:

liquibase.exception.DatabaseException: Table 'keycloak.client_template_attributes' doesn't exist [Failed SQL: ALTER TABLE keycloak.CLIENT_TEMPLATE_ATTRIBUTES DROP FOREIGN KEY FK_CL_TEMPL_ATTR_TEMPL]

at liquibase.executor.jvm.JdbcExecutor$ExecuteStatementCallback.doInStatement(JdbcExecutor.java:309)

at liquibase.executor.jvm.JdbcExecutor.execute(JdbcExecutor.java:55)

at liquibase.executor.jvm.JdbcExecutor.execute(JdbcExecutor.java:113)

at liquibase.database.AbstractJdbcDatabase.execute(AbstractJdbcDatabase.java:1277)

at liquibase.database.AbstractJdbcDatabase.executeStatements(AbstractJdbcDatabase.java:1259)

at liquibase.changelog.ChangeSet.execute(ChangeSet.java:582)

... 76 more

Caused by: java.sql.SQLSyntaxErrorException: Table 'keycloak.client_template_attributes' doesn't exist

at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:120)

at com.mysql.cj.jdbc.exceptions.SQLExceptionsMapping.translateException(SQLExceptionsMapping.java:122)

at com.mysql.cj.jdbc.StatementImpl.executeInternal(StatementImpl.java:768)

at com.mysql.cj.jdbc.StatementImpl.execute(StatementImpl.java:653)

at org.jboss.jca.adapters.jdbc.WrappedStatement.execute(WrappedStatement.java:198)

at liquibase.executor.jvm.JdbcExecutor$ExecuteStatementCallback.doInStatement(JdbcExecutor.java:307)

... 81 more

Upvotes: 0

Views: 951

Answers (1)

Yogesh Upreti
Yogesh Upreti

Reputation: 31

You need to increase timeout value

Option 1 in standalone.xml

<coordinator-environment default-timeout="3600" statistics-enabled=......

Option 2 other ways are using the JVM argument -Djboss.as.management.blocking.timeout=3600

Upvotes: 0

Related Questions