<html>
<head>
<meta content="text/html; charset=windows-1252"
http-equiv="Content-Type">
</head>
<body text="#000000" bgcolor="#FFFFFF">
<div class="moz-cite-prefix">There is missing declaration of
userSessionPersister in the keycloak-server.json file. I bet that
if you add this:<br>
<br>
"userSessionPersister": {<br>
"provider": "jpa"<br>
},<br>
<br>
to the file
<a class="moz-txt-link-freetext" href="https://github.com/jboss-dockerfiles/keycloak/blob/master/server-ha-postgres/keycloak-server.json">https://github.com/jboss-dockerfiles/keycloak/blob/master/server-ha-postgres/keycloak-server.json</a>,
the things will start to work.<br>
<br>
Will be cool if you could doublecheck and possibly send PR if it
helps <span class="moz-smiley-s1"><span> :-) </span></span><br>
<br>
The even more proper solution will be to avoid having
keycloak-server.json in the docker image, as the file becomes
outdated during each update in Keycloak. Docker image should have
some script or something to edit the existing file "on the fly"
and update it to use cluster. <br>
Actually not sure if separate keycloak-server.json is still needed
as in latest Keycloak, keycloak-server.json already contains
configuration for connections-infinispan (which it wasn't before
AFAIK)<br>
<br>
Marek<br>
<br>
On 14/12/15 11:52, Thomas Darimont wrote:<br>
</div>
<blockquote
cite="mid:CAK-7U1g8vULnv0J-N=K+4Y=_y+4iqHe9K2tGmXWxnzDeM3NQ0A@mail.gmail.com"
type="cite">
<div dir="ltr">
<div>Starting the Keycloak Postgres HA Docker Image fails due to
a problem with loading OffilineUserSessions - see stacktrace
below.</div>
<div><br>
</div>
<div>There is an already resolved?! issue <a
moz-do-not-send="true"
href="https://issues.jboss.org/browse/KEYCLOAK-1999"><a class="moz-txt-link-freetext" href="https://issues.jboss.org/browse/KEYCLOAK-1999">https://issues.jboss.org/browse/KEYCLOAK-1999</a></a>
filed for Keycloak 1.6.0 that shows some </div>
<div>workaround suggestions, but I think disabling the support
for offline sessions is not a fix to the actual problem...</div>
<div><br>
</div>
<div>Would be great to have a real fix, since this hinders the
Keycloak Server to start.</div>
<div><br>
</div>
<div>Just verified this with:</div>
<div>- jboss/keycloak-ha-postgres:latest</div>
<div>- jboss/keycloak-ha-postgres:1.7.0.Release</div>
<div>- jboss/keycloak-ha-postgres:1.6.1.Release<br>
</div>
<div>- jboss/keycloak-ha-postgres:1.6.0.Release<br>
</div>
<div><br>
</div>
<div>Steps to reproduce:</div>
<div><br>
</div>
<div># Start Postgres Instance:</div>
<div>docker run --name kc-db -e POSTGRES_DATABASE=keycloak -e
POSTGRES_USER=keycloak -e POSTGRES_PASSWORD=password -e
POSTGRES_ROOT_PASSWORD=password -p 25432:5432 -d postgres<br>
</div>
<div><br>
</div>
<div># Start KC Server</div>
<div>docker run --name kc-server1 --link kc-db:postgres -e
POSTGRES_DATABASE=keycloak -e POSTGRES_USER=keycloak -e
POSTGRES_PASSWORD=password -p 8101:8080
jboss/keycloak-ha-postgres<br>
</div>
<div><br>
</div>
<div>#Exception during start:</div>
<div>...</div>
<div>
<div>10:33:54,461 INFO [org.jboss.as.clustering.infinispan]
(ServerService Thread Pool -- 62) WFLYCLINF0002: Started
offlineSessions cache from keycloak container</div>
<div>10:33:54,472 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: Failed to construct public
org.keycloak.services.resources.KeycloakApplication(javax.servlet.ServletContext,org.jboss.resteasy.core.Dispatcher)</div>
<div><span class="" style="white-space:pre">        </span>at
org.wildfly.extension.undertow.deployment.UndertowDeploymentService$1.run(UndertowDeploymentService.java:85)</div>
<div><span class="" style="white-space:pre">        </span>at
java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)</div>
<div><span class="" style="white-space:pre">        </span>at
java.util.concurrent.FutureTask.run(FutureTask.java:262)</div>
<div><span class="" style="white-space:pre">        </span>at
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)</div>
<div><span class="" style="white-space:pre">        </span>at
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)</div>
<div><span class="" style="white-space:pre">        </span>at
java.lang.Thread.run(Thread.java:745)</div>
<div><span class="" style="white-space:pre">        </span>at
org.jboss.threads.JBossThread.run(JBossThread.java:320)</div>
<div>Caused by: java.lang.RuntimeException: Failed to
construct public
org.keycloak.services.resources.KeycloakApplication(javax.servlet.ServletContext,org.jboss.resteasy.core.Dispatcher)</div>
<div><span class="" style="white-space:pre">        </span>at
org.jboss.resteasy.core.ConstructorInjectorImpl.construct(ConstructorInjectorImpl.java:160)</div>
<div><span class="" style="white-space:pre">        </span>at
org.jboss.resteasy.spi.ResteasyProviderFactory.createProviderInstance(ResteasyProviderFactory.java:2211)</div>
<div><span class="" style="white-space:pre">        </span>at
org.jboss.resteasy.spi.ResteasyDeployment.createApplication(ResteasyDeployment.java:295)</div>
<div><span class="" style="white-space:pre">        </span>at
org.jboss.resteasy.spi.ResteasyDeployment.start(ResteasyDeployment.java:236)</div>
<div><span class="" style="white-space:pre">        </span>at
org.jboss.resteasy.plugins.server.servlet.ServletContainerDispatcher.init(ServletContainerDispatcher.java:112)</div>
<div><span class="" style="white-space:pre">        </span>at
org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher.init(HttpServletDispatcher.java:36)</div>
<div><span class="" style="white-space:pre">        </span>at
io.undertow.servlet.core.LifecyleInterceptorInvocation.proceed(LifecyleInterceptorInvocation.java:117)</div>
<div><span class="" style="white-space:pre">        </span>at
org.wildfly.extension.undertow.security.RunAsLifecycleInterceptor.init(RunAsLifecycleInterceptor.java:78)</div>
<div><span class="" style="white-space:pre">        </span>at
io.undertow.servlet.core.LifecyleInterceptorInvocation.proceed(LifecyleInterceptorInvocation.java:103)</div>
<div><span class="" style="white-space:pre">        </span>at
io.undertow.servlet.core.ManagedServlet$DefaultInstanceStrategy.start(ManagedServlet.java:230)</div>
<div><span class="" style="white-space:pre">        </span>at
io.undertow.servlet.core.ManagedServlet.createServlet(ManagedServlet.java:131)</div>
<div><span class="" style="white-space:pre">        </span>at
io.undertow.servlet.core.DeploymentManagerImpl.start(DeploymentManagerImpl.java:511)</div>
<div><span class="" style="white-space:pre">        </span>at
org.wildfly.extension.undertow.deployment.UndertowDeploymentService.startContext(UndertowDeploymentService.java:101)</div>
<div><span class="" style="white-space:pre">        </span>at
org.wildfly.extension.undertow.deployment.UndertowDeploymentService$1.run(UndertowDeploymentService.java:82)</div>
<div><span class="" style="white-space:pre">        </span>... 6 more</div>
<div>Caused by: java.lang.NullPointerException</div>
<div><span class="" style="white-space:pre">        </span>at
org.keycloak.models.sessions.infinispan.initializer.OfflineUserSessionLoader.init(OfflineUserSessionLoader.java:25)</div>
<div><span class="" style="white-space:pre">        </span>at
org.keycloak.models.sessions.infinispan.initializer.InfinispanUserSessionInitializer$1.run(InfinispanUserSessionInitializer.java:100)</div>
<div><span class="" style="white-space:pre">        </span>at
org.keycloak.models.utils.KeycloakModelUtils.runJobInTransaction(KeycloakModelUtils.java:244)</div>
<div><span class="" style="white-space:pre">        </span>at
org.keycloak.models.sessions.infinispan.initializer.InfinispanUserSessionInitializer.getOrCreateInitializerState(InfinispanUserSessionInitializer.java:97)</div>
<div><span class="" style="white-space:pre">        </span>at
org.keycloak.models.sessions.infinispan.initializer.InfinispanUserSessionInitializer.startLoading(InfinispanUserSessionInitializer.java:148)</div>
<div><span class="" style="white-space:pre">        </span>at
org.keycloak.models.sessions.infinispan.initializer.InfinispanUserSessionInitializer.loadPersistentSessions(InfinispanUserSessionInitializer.java:78)</div>
<div><span class="" style="white-space:pre">        </span>at
org.keycloak.models.sessions.infinispan.InfinispanUserSessionProviderFactory$3.run(InfinispanUserSessionProviderFactory.java:111)</div>
<div><span class="" style="white-space:pre">        </span>at
org.keycloak.models.utils.KeycloakModelUtils.runJobInTransaction(KeycloakModelUtils.java:244)</div>
<div><span class="" style="white-space:pre">        </span>at
org.keycloak.models.sessions.infinispan.InfinispanUserSessionProviderFactory.loadPersistentSessions(InfinispanUserSessionProviderFactory.java:102)</div>
<div><span class="" style="white-space:pre">        </span>at
org.keycloak.models.sessions.infinispan.InfinispanUserSessionProviderFactory$2.onEvent(InfinispanUserSessionProviderFactory.java:86)</div>
<div><span class="" style="white-space:pre">        </span>at
org.keycloak.services.DefaultKeycloakSessionFactory.publish(DefaultKeycloakSessionFactory.java:47)</div>
<div><span class="" style="white-space:pre">        </span>at
org.keycloak.services.resources.KeycloakApplication.<init>(KeycloakApplication.java:87)</div>
<div><span class="" style="white-space:pre">        </span>at
sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native
Method)</div>
<div><span class="" style="white-space:pre">        </span>at
sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)</div>
<div><span class="" style="white-space:pre">        </span>at
sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)</div>
<div><span class="" style="white-space:pre">        </span>at
java.lang.reflect.Constructor.newInstance(Constructor.java:526)</div>
<div><span class="" style="white-space:pre">        </span>at
org.jboss.resteasy.core.ConstructorInjectorImpl.construct(ConstructorInjectorImpl.java:148)</div>
<div><span class="" style="white-space:pre">        </span>... 19
more</div>
<div><br>
</div>
<div>10:33:54,516 ERROR
[org.jboss.as.controller.management-operation] (Controller
Boot Thread) WFLYCTL0013: Operation ("add") failed -
address: ([("deployment" => "keycloak-server.war")]) - </div>
</div>
</div>
<br>
<fieldset class="mimeAttachmentHeader"></fieldset>
<br>
<pre wrap="">_______________________________________________
keycloak-user mailing list
<a class="moz-txt-link-abbreviated" href="mailto:keycloak-user@lists.jboss.org">keycloak-user@lists.jboss.org</a>
<a class="moz-txt-link-freetext" href="https://lists.jboss.org/mailman/listinfo/keycloak-user">https://lists.jboss.org/mailman/listinfo/keycloak-user</a></pre>
</blockquote>
<br>
</body>
</html>