[keycloak-user] Issues starting up keycloak after DB migration to 2.2.1 from 1.8.0
Nathan McGinnis
mcginnis.nathan at gmail.com
Tue Feb 7 12:49:03 EST 2017
Hi Everyone,
I'm unable to start our keycloak server and could some assistance. Just to
give a quick recap of background and steps we've taken..
We've been using keycloak 1.8.0 for a while and are in the process of
migrating to a 2.2.1 instance in AWS. We're running standalone HA mode
with two nodes behind a public ELB. I have configured JDBC Ping to save
session state across both nodes in preproduction and it works there. I have
configured production the same way as preprod (we're also using Chef so I
know its configured the same).
In production, we've taken a backup of the keycloak postgresql DB (1.8.0)
and restored it to the keycloak DB our 2.2.1 instance is pointed to. I
have set migrationStrategy to manual and it produced a .sql file to run.
We had some issues running it related to indicies and tables and such
already existing so we decided to run each statement line by line. This
got us past the "Database not up-to-date" error, but we're now seeing this
in the server.log which causes the startup to fail. Does anyone have an
idea what the problem could be?
2017-02-07 17:16:50,380 ERROR [org.jboss.msc.service.fail] (ServerService
Thread Pool -- 55) 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:85)
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:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(
ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)
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)
at org.jboss.resteasy.spi.ResteasyProviderFactory.createProviderInstance(
ResteasyProviderFactory.java:2209)
at org.jboss.resteasy.spi.ResteasyDeployment.createApplication(
ResteasyDeployment.java:299)
at org.jboss.resteasy.spi.ResteasyDeployment.start(
ResteasyDeployment.java:240)
at org.jboss.resteasy.plugins.server.servlet.ServletContainerDispatcher.
init(ServletContainerDispatcher.java:113)
at org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher.init(
HttpServletDispatcher.java:36)
at io.undertow.servlet.core.LifecyleInterceptorInvocation.proceed(
LifecyleInterceptorInvocation.java:117)
at org.wildfly.extension.undertow.security.RunAsLifecycleInterceptor.init(
RunAsLifecycleInterceptor.java:78)
at io.undertow.servlet.core.LifecyleInterceptorInvocation.proceed(
LifecyleInterceptorInvocation.java:103)
at io.undertow.servlet.core.ManagedServlet$DefaultInstanceStrategy.start(
ManagedServlet.java:231)
at io.undertow.servlet.core.ManagedServlet.createServlet(
ManagedServlet.java:132)
at io.undertow.servlet.core.DeploymentManagerImpl.start(
DeploymentManagerImpl.java:526)
at org.wildfly.extension.undertow.deployment.UndertowDeploymentService.
startContext(UndertowDeploymentService.java:101)
at org.wildfly.extension.undertow.deployment.UndertowDeploymentService$1.
run(UndertowDeploymentService.java:82)
... 6 more
Caused by: javax.persistence.EntityNotFoundException: Unable to find
org.keycloak.models.jpa.entities.ClientEntity with id
asdfg123-123x-123e-1xx1-sdkasdjf7123
at org.hibernate.jpa.boot.internal.EntityManagerFactoryBuilderImp
l$JpaEntityNotFoundDelegate.handleEntityNotFound(
EntityManagerFactoryBuilderImpl.java:144)
at org.hibernate.proxy.AbstractLazyInitializer.checkTargetState(
AbstractLazyInitializer.java:242)
at org.hibernate.proxy.AbstractLazyInitializer.initialize(
AbstractLazyInitializer.java:159)
at org.hibernate.proxy.AbstractLazyInitializer.getImplementation(
AbstractLazyInitializer.java:266)
at org.hibernate.proxy.pojo.javassist.JavassistLazyInitializer.invoke(
JavassistLazyInitializer.java:68)
at org.keycloak.models.jpa.entities.ClientEntity_$$_jvst1c4_8.getRealm(
ClientEntity_$$_jvst1c4_8.java)
at org.keycloak.models.jpa.RealmAdapter.getMasterAdminClient(
RealmAdapter.java:1234)
at org.keycloak.models.cache.infinispan.entities.CachedRealm.<init>(
CachedRealm.java:241)
at org.keycloak.models.cache.infinispan.RealmCacheSession.
getRealm(RealmCacheSession.java:379)
at org.keycloak.migration.migrators.MigrateTo1_9_0.
migrate(MigrateTo1_9_0.java:45)
at org.keycloak.migration.MigrationModelManager.migrate(
MigrationModelManager.java:74)
at org.keycloak.services.resources.KeycloakApplication.migrateModel(
KeycloakApplication.java:221)
at org.keycloak.services.resources.KeycloakApplication.migrateAndBootstrap(
KeycloakApplication.java:162)
at org.keycloak.services.resources.KeycloakApplication$
1.run(KeycloakApplication.java:121)
at org.keycloak.models.utils.KeycloakModelUtils.runJobInTransaction(
KeycloakModelUtils.java:295)
at org.keycloak.services.resources.KeycloakApplication.
<init>(KeycloakApplication.java:112)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(
NativeConstructorAccessorImpl.java:62)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(
DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
at org.jboss.resteasy.core.ConstructorInjectorImpl.construct(
ConstructorInjectorImpl.java:150)
... 19 more
More information about the keycloak-user
mailing list