Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

trying to up keycloak with docker but it's not starting . Operation ("add") failed - address:

05:49:02,840 ERROR [org.jboss.as.controller.management-operation] (Controller Boot Thread) WFLYCTL0013: Operation ("add") failed - address: ([("subsystem" => "microprofile-metrics-smallrye")]): java.lang.NullPointerException
        at [email protected]//org.wildfly.extension.microprofile.metrics.MicroProfileMetricsSubsystemAdd$2.execute(MicroProfileMetricsSubsystemAdd.java:86)
        at [email protected]//org.jboss.as.controller.AbstractOperationContext.executeStep(AbstractOperationContext.java:999)
        at [email protected]//org.jboss.as.controller.AbstractOperationContext.processStages(AbstractOperationContext.java:743)
        at [email protected]//org.jboss.as.controller.AbstractOperationContext.executeOperation(AbstractOperationContext.java:467)
        at [email protected]//org.jboss.as.controller.OperationContextImpl.executeOperation(OperationContextImpl.java:1413)
        at [email protected]//org.jboss.as.controller.ModelControllerImpl.boot(ModelControllerImpl.java:527)
        at [email protected]//org.jboss.as.controller.AbstractControllerService.boot(AbstractControllerService.java:515)
        at [email protected]//org.jboss.as.controller.AbstractControllerService.boot(AbstractControllerService.java:477)
        at [email protected]//org.jboss.as.server.ServerService.boot(ServerService.java:451)
        at [email protected]//org.jboss.as.server.ServerService.boot(ServerService.java:404)
        at [email protected]//org.jboss.as.controller.AbstractControllerService$1.run(AbstractControllerService.java:416)
        at java.base/java.lang.Thread.run(Thread.java:834)
like image 594
spidy Avatar asked Sep 10 '20 10:09

spidy


People also ask

How do I reset a Keycloak container?

Start a Keycloak container in podman with the correct DB_USER, DB_PASSWORD, DB_VENDOR, DB_DATABASE, DB_ADDR, KEYCLOAK_USER, KEYCLOAK_PASSWORD environment variables. (Keycloak will not start since it cannot connect to its database) Start the database. Restart the Keycloak container.


2 Answers

I had this error while trying to run Keycloak in a docker-compose setup. My problem was caused because Keycloak was unable to connect to the database container. In fact keycloak startup logs were complaining about database connection problems few lines prior the error "... Operation ("add") failed ..."

like image 103
Dovydas Giršvaldas Avatar answered Sep 20 '22 21:09

Dovydas Giršvaldas


One of the reasons why the Keycloak start-up might fail is that you missed to enable the upload scripts flag.

The flag is deprecated and is normally only necessary if you want to do a realm import via the admin interface but in my case it was also necessary to enable the flag if I wanted to start-up Keycloak with an import file. Otherwise the same exception would be thrown that you provided in the original question.

The start-up param for enabling the flag is: -Dkeycloak.profile.feature.upload_scripts=enabled

A small disclaimer here. As the documentation states this flag should not be continuously enabled. So just enable it for the initial import and persist your realm configuration in an external database.

like image 33
BOSD Avatar answered Sep 17 '22 21:09

BOSD