[keycloak-user] Keycloak database startup error

Abhishek Singh abhishek.singh at spire.ai
Tue Jun 11 03:03:06 EDT 2019


Hi,


I'm trying to upgrade the standalone mode to cluster-mode in Keycloak and
for this i have configured a cluster using J groups and configured using
local mysql database.

The version is same as i have changed only conf file standalone-ha.xml .
The cluster is successfully formed and checked also.


Now when i'm pointing the both nodes to production database MySQL and
starts the keycloak it's generating Database error called “Failed to update
the database Table already exists”

I have tried every possible option my setting migration strategy as manual
in standalone-ha.xml nut noting works.

I'm using keycloak-3.4.3.Final version and Mysql
mysql-server-5.5-1.6.amzn1.noarch

Below is error code shown as exception by starting keycloak.


05:22:44,963 ERROR
[org.keycloak.connections.jpa.updater.liquibase.conn.DefaultLiquibaseConnectionProvider]
(ServerService Thread Pool -- 62) Change Set META-INF/
jpa-changelog-1.0.0.Final.xml::1.0.0.Final::sthorger at redhat.com failed.
Error: Table 'APPLICATION_DEFAULT_ROLES' already exists [Failed SQL: CREATE
TABLE keycloak3_schema.APPLICATION_DEFAULT_ROLES (APPLICATION_ID
VARCHAR(36) NOT NULL, ROLE_ID VARCHAR(36) NOT NULL)]:
liquibase.exception.DatabaseException: Table 'APPLICATION_DEFAULT_ROLES'
already exists [Failed SQL: CREATE TABLE
keycloak3_schema.APPLICATION_DEFAULT_ROLES (APPLICATION_ID VARCHAR(36) NOT
NULL, ROLE_ID VARCHAR(36) NOT NULL)]

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


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

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

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


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


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

at liquibase.changelog.visitor.UpdateVisitor.visit(UpdateVisitor.java:51)

at liquibase.changelog.ChangeLogIterator.run(ChangeLogIterator.java:73)

at liquibase.Liquibase.update(Liquibase.java:210)

at liquibase.Liquibase.update(Liquibase.java:190)

at liquibase.Liquibase.update(Liquibase.java:186)


05:22:44,983 ERROR [org.jboss.msc.service.fail] (ServerService Thread Pool
-- 62) MSC000001: Failed to start service
jboss.undertow.deployment.default-server.default-host./auth:
org.jboss.msc.service.StartException in service
jboss.undertow.deployment.default-server.default-host./auth:
java.lang.RuntimeException: RESTEASY003325: Failed to construct public
org.keycloak.services.resources.KeycloakApplication(javax.servlet.ServletContext,org.jboss.resteasy.core.Dispatcher)


at
org.wildfly.extension.undertow.deployment.UndertowDeploymentService$1.run(UndertowDeploymentService.java:84)


at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)

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)

at org.jboss.threads.JBossThread.run(JBossThread.java:320)

Caused by: java.lang.RuntimeException: RESTEASY003325: Failed to construct
public
org.keycloak.services.resources.KeycloakApplication(javax.servlet.ServletContext,org.jboss.resteasy.core.Dispatcher)


at
org.jboss.resteasy.core.ConstructorInjectorImpl.construct(ConstructorInjectorImpl.java:162)



Please help for this issue.

Regards,

Abhishek


More information about the keycloak-user mailing list