[keycloak-user] Clean Install with MySQL - Keycloak restarts itself due to liquibase errors - Docker Swarm environment

James Green james.mk.green at gmail.com
Thu Aug 3 05:22:06 EDT 2017


Unsure what I'm doing wrong here. Circumstance: we've spotted KeyCloak,
have reason to be interested, so are deploying an instance into our test
environment which happens to be Docker Swarm.

Problem: The KeyCloak service is being restarted by Docker, presumably due
to a crash. The logs indicate it gets so far within a liquibase script then
fails.

Here's the docker-compose.yml file that we are using for deployment
purposes:

https://gist.github.com/jmkgreen/b79f95c3eca2eac3fb66c66d12017f07

Here's the log from MySQL:

https://gist.github.com/jmkgreen/75b99fe98cf1d16a99895e78dae47cce

Here's an initial log from KeyCloak:

https://gist.github.com/jmkgreen/96285800949b5c4f62c31caa3eba27ef

Here's an further log from KeyCloak once Docker has decided it needed to be
restarted:

https://gist.github.com/jmkgreen/2051ab14e470d1d46dabcfdd519d5c42

As you can see, the MySQL server starts and is configured due to there
being no data already present. All looks good. KeyCloak eventually gets
connected to MySQL and begins using Liquibase to roll through transitions
but crashes (how?) and thus the container overall crashes forcing Docker to
restart, which merely happens over and over.

FWIW I earlier created a StackOverflow post which has us at a _different_
liquibase change but also failing:

https://stackoverflow.com/questions/45466482/keycloak-will-not-start-due-to-liquibase-changelog-error?noredirect=1#comment77894983_45466482

What I've posted in the Gists above occurred after I shut everything down
and wiped the MySQL data directory of it's contents in full.

An aside - we have multiple projects working within Swarm using stack
deployments with externally managed networks (as recommended by Docker) and
GlusterFS volumes without issue. In this particular case the only tangible
difference is the use of the latest MySQL version which other projects may
not be using. We also do not have experience of WildFly-based software.

Any ideas what I've done wrong?

Thanks,

James


More information about the keycloak-user mailing list