Running Key Cloak with MySQL on Docker Failed to Start

I am trying to start a Keycloak instance which uses a custom mysql database. It was previously using a mariadb database, but there is a requirement to migrate it to mysql. This is the docker-compose.yml file :

version: "3.6"
services:
 vnfm-keycloak:
  container_name: sample-keycloak
  image: quay.io/keycloak/keycloak:latest
  restart: always
  ports:
   - 8180:8080
  environment:
    PROXY_ADDRESS_FORWARDING: "true"
    DB_VENDOR: MYSQL
    DB_ADDR: 152.25.100.2
    DB_DATABASE: keycloak
    DB_USER: user
    DB_PASSWORD: password
    KEYCLOAK_USER: admin
    KEYCLOAK_PASSWORD: admin
  networks:
    - database_static-network
 networks:
  database_static-network:
   external: true

With mariadb it was starting fine with DB_VENDOR: mariadb. I changed that to DB_VENDOR: MYSQL.

I ensured that the database as well as the user is created in mysql and the privileges are given to the user for the database. With mysql up and running, i started the keycloak docker to connect and tables that got created as a result of executing this process inside the keycloak database. But the service is failed to start giving the following errors :

vnfm-keycloak    | 03:44:27,583 ERROR [org.jboss.as.server] (ServerService Thread Pool -- 46) WFLYSRV0022: Deploy of deployment "keycloak-server.war" was rolled back with no failure message
vnfm-keycloak    | 03:44:27,672 INFO  [org.jboss.as] (MSC service thread 1-5) WFLYSRV0050: Keycloak 12.0.4 (WildFly Core 13.0.3.Final) stopped in 742ms
vnfm-keycloak    | 03:44:27,671 ERROR [org.jboss.as.controller.management-operation] (Controller Boot Thread) WFLYCTL0403: Unexpected failure during execution of the following operation(s): [{
vnfm-keycloak    |     "address" => [
vnfm-keycloak    |         ("core-service" => "management"),
vnfm-keycloak    |         ("security-realm" => "ManagementRealm")
vnfm-keycloak    |     ],
vnfm-keycloak    |     "operation" => "add",
vnfm-keycloak    |     "map-groups-to-roles" => false
vnfm-keycloak    | }, {
vnfm-keycloak    | }]: java.util.concurrent.RejectedExecutionException
vnfm-keycloak    |  at org.jboss.threads@2.4.0.Final//org.jboss.threads.RejectingExecutor.execute(RejectingExecutor.java:37)
vnfm-keycloak    |  at org.jboss.threads@2.4.0.Final//org.jboss.threads.EnhancedQueueExecutor.rejectShutdown(EnhancedQueueExecutor.java:2029)
vnfm-keycloak    |  at org.jboss.threads@2.4.0.Final//org.jboss.threads.EnhancedQueueExecutor.execute(EnhancedQueueExecutor.java:757)
vnfm-keycloak    |  at org.jboss.as.controller@13.0.3.Final//org.jboss.as.controller.notification.NotificationSupports$NonBlockingNotificationSupport.emit(NotificationSupports.java:95)
vnfm-keycloak    |  at org.jboss.as.controller@13.0.3.Final//org.jboss.as.controller.OperationContextImpl.notifyModificationsComplete(OperationContextImpl.java:505)
vnfm-keycloak    |  at org.jboss.as.controller@13.0.3.Final//org.jboss.as.controller.OperationContextImpl.releaseStepLocks(OperationContextImpl.java:1233)
vnfm-keycloak    |  at org.jboss.as.controller@13.0.3.Final//org.jboss.as.controller.AbstractOperationContext$Step.finalizeInternal(AbstractOperationContext.java:1503)
vnfm-keycloak    |  at org.jboss.as.controller@13.0.3.Final//org.jboss.as.controller.AbstractOperationContext$Step.finalizeStep(AbstractOperationContext.java:1461)
vnfm-keycloak    |  at org.jboss.as.controller@13.0.3.Final//org.jboss.as.controller.AbstractOperationContext$Step.access$400(AbstractOperationContext.java:1325)
vnfm-keycloak    |  at org.jboss.as.controller@13.0.3.Final//org.jboss.as.controller.AbstractOperationContext.executeResultHandlerPhase(AbstractOperationContext.java:877)
vnfm-keycloak    |  at org.jboss.as.controller@13.0.3.Final//org.jboss.as.controller.AbstractOperationContext.processStages(AbstractOperationContext.java:757)
vnfm-keycloak    |  at org.jboss.as.controller@13.0.3.Final//org.jboss.as.controller.AbstractOperationContext.executeOperation(AbstractOperationContext.java:468)
vnfm-keycloak    |  at org.jboss.as.controller@13.0.3.Final//org.jboss.as.controller.OperationContextImpl.executeOperation(OperationContextImpl.java:1415)
vnfm-keycloak    |  at org.jboss.as.controller@13.0.3.Final//org.jboss.as.controller.ModelControllerImpl.boot(ModelControllerImpl.java:529)
vnfm-keycloak    |  at org.jboss.as.controller@13.0.3.Final//org.jboss.as.controller.AbstractControllerService.boot(AbstractControllerService.java:515)
vnfm-keycloak    |  at org.jboss.as.controller@13.0.3.Final//org.jboss.as.controller.AbstractControllerService.boot(AbstractControllerService.java:477)
vnfm-keycloak    |  at org.jboss.as.server@13.0.3.Final//org.jboss.as.server.ServerService.boot(ServerService.java:451)
vnfm-keycloak    |  at org.jboss.as.server@13.0.3.Final//org.jboss.as.server.ServerService.boot(ServerService.java:404)
vnfm-keycloak    |  at org.jboss.as.controller@13.0.3.Final//org.jboss.as.controller.AbstractControllerService$1.run(AbstractControllerService.java:416)
vnfm-keycloak    |  at java.base/java.lang.Thread.run(Thread.java:829)
vnfm-keycloak    |  Suppressed: java.util.concurrent.RejectedExecutionException: Executor is being shut down
vnfm-keycloak    |      at org.jboss.threads@2.4.0.Final//org.jboss.threads.EnhancedQueueExecutor.rejectShutdown(EnhancedQueueExecutor.java:2031)
vnfm-keycloak    |      ... 18 more

This Post Has One Comment

  1. No Fault

    Running Keycloak with MySql on docker – Failed to start

Leave a Reply