Wildfly NullPointerException

Hello,

I am trying to deploy Keycloak using a helm chart provided by code centric at: https://codecentric.github.io/helm-charts

this method worked by default, but when I added environment variables I keep getting the following error:

20:58:23,868 ERROR [org.jboss.as.controller.management-operation] (Controller Boot Thread) WFLYCTL0013: Operation ("add") failed - address: ([("subsystem" => "microprofile-metrics-smallrye")]): java.lang.NullPointerException
	at org.wildfly.extension.microprofile.metrics.MicroProfileMetricsSubsystemAdd$2.execute(MicroProfileMetricsSubsystemAdd.java:86)
	at org.jboss.as.controller.AbstractOperationContext.executeStep(AbstractOperationContext.java:999)
	at org.jboss.as.controller.AbstractOperationContext.processStages(AbstractOperationContext.java:743)
	at org.jboss.as.controller.AbstractOperationContext.executeOperation(AbstractOperationContext.java:467)
	at org.jboss.as.controller.OperationContextImpl.executeOperation(OperationContextImpl.java:1412)
	at org.jboss.as.controller.ModelControllerImpl.boot(ModelControllerImpl.java:521)
	at org.jboss.as.controller.AbstractControllerService.boot(AbstractControllerService.java:472)
	at org.jboss.as.controller.AbstractControllerService.boot(AbstractControllerService.java:434)
	at org.jboss.as.server.ServerService.boot(ServerService.java:435)
	at org.jboss.as.server.ServerService.boot(ServerService.java:394)
	at org.jboss.as.controller.AbstractControllerService$1.run(AbstractControllerService.java:374)
	at java.lang.Thread.run(Thread.java:748)

If I restart the postgres pod, the issue resolves itself however I lose all my settings.
I was wondering if someone could help, thanks!

Turns out I had to set the postgres password explicitly, since in each deploy KC server generated new password but the database remained the same. I added the following to my values.yaml file under the keycloak values which solved the issue:

  postgresql:
    postgresqlPassword: <some static password>

I have the same exception stack trace, but I am using an existing postgres database (not deployed with the chart). Adding postgresql.postgresqlPassword doesn’t help in my case (based on the comments in values, its because those values are only used for postgres if running as part of the helm chart).

Chart version: 6.2.0
Keycloak version: 8.0.2

Any other ideas?

I have an instance with a MySQL database running with docker-compose. I’m currently on version 7.0.0 and whenever I try to upgrade to 7.0.1 or 8.0.x I get the same exception above. Downgrading to 7.0.0 and the problem is gone again.

Please can anyone help to resolve this?
Thanks!

In my case I missed to set JDBC_PARAMS correctly to disable SSL for the db connection.
See: https://issues.redhat.com/browse/KEYCLOAK-13033?focusedCommentId=13976326

I have a similar error

Trying to upgrade from 6.0.1 to 10.0.2

2020-06-24 15:06:44,254 ERROR [org.jboss.as.controller.management-operation] (Controller Boot Thread) WFLYCTL0013: Operation ("add") failed - address: ([("subsystem" => "microprofile-metrics-smallrye")]): java.lang.NullPointerException
	at org.wildfly.extension.microprofile.metrics.MicroProfileMetricsSubsystemAdd$2.execute(MicroProfileMetricsSubsystemAdd.java:86)
	at org.jboss.as.controller.AbstractOperationContext.executeStep(AbstractOperationContext.java:999)
	at org.jboss.as.controller.AbstractOperationContext.processStages(AbstractOperationContext.java:743)
	at org.jboss.as.controller.AbstractOperationContext.executeOperation(AbstractOperationContext.java:467)
	at org.jboss.as.controller.OperationContextImpl.executeOperation(OperationContextImpl.java:1413)
	at org.jboss.as.controller.ModelControllerImpl.boot(ModelControllerImpl.java:527)
	at org.jboss.as.controller.AbstractControllerService.boot(AbstractControllerService.java:515)
	at org.jboss.as.controller.AbstractControllerService.boot(AbstractControllerService.java:477)
	at org.jboss.as.server.ServerService.boot(ServerService.java:448)
	at org.jboss.as.server.ServerService.boot(ServerService.java:401)
	at org.jboss.as.controller.AbstractControllerService$1.run(AbstractControllerService.java:416)
	at java.lang.Thread.run(Thread.java:748)

2020-06-24 15:06:44,259 ERROR [org.jboss.as.controller.management-operation] (Controller Boot Thread) WFLYCTL0190: Step handler org.jboss.as.server.DeployerChainAddHandler$FinalRuntimeStepHandler@6826e014 for operation add-deployer-chains at address [] failed -- java.util.concurrent.RejectedExecutionException: java.util.concurrent.RejectedExecutionException
	at org.jboss.threads.RejectingExecutor.execute(RejectingExecutor.java:37)
	at org.jboss.threads.EnhancedQueueExecutor.rejectShutdown(EnhancedQueueExecutor.java:2026)
	at org.jboss.threads.EnhancedQueueExecutor.execute(EnhancedQueueExecutor.java:757)
	at org.jboss.as.controller.notification.NotificationSupports$NonBlockingNotificationSupport.emit(NotificationSupports.java:95)
	at org.jboss.as.controller.OperationContextImpl.notifyModificationBegun(OperationContextImpl.java:877)
	at org.jboss.as.controller.OperationContextImpl.ensureWriteLockForRuntime(OperationContextImpl.java:866)
	at org.jboss.as.controller.OperationContextImpl.removeService(OperationContextImpl.java:639)
	at org.jboss.as.server.DeployerChainAddHandler$FinalRuntimeStepHandler$1.handleRollback(DeployerChainAddHandler.java:135)
	at org.jboss.as.controller.AbstractOperationContext$RollbackDelegatingResultHandler.handleResult(AbstractOperationContext.java:1561)
	at org.jboss.as.controller.AbstractOperationContext$Step.invokeResultHandler(AbstractOperationContext.java:1533)
	at org.jboss.as.controller.AbstractOperationContext$Step.handleResult(AbstractOperationContext.java:1515)
	at org.jboss.as.controller.AbstractOperationContext$Step.finalizeInternal(AbstractOperationContext.java:1472)
	at org.jboss.as.controller.AbstractOperationContext$Step.finalizeStep(AbstractOperationContext.java:1455)
	at org.jboss.as.controller.AbstractOperationContext$Step.access$400(AbstractOperationContext.java:1319)
	at org.jboss.as.controller.AbstractOperationContext.executeResultHandlerPhase(AbstractOperationContext.java:876)
	at org.jboss.as.controller.AbstractOperationContext.processStages(AbstractOperationContext.java:756)
	at org.jboss.as.controller.AbstractOperationContext.executeOperation(AbstractOperationContext.java:467)
	at org.jboss.as.controller.OperationContextImpl.executeOperation(OperationContextImpl.java:1413)
	at org.jboss.as.controller.ModelControllerImpl.boot(ModelControllerImpl.java:527)
	at org.jboss.as.controller.AbstractControllerService.boot(AbstractControllerService.java:515)
	at org.jboss.as.controller.AbstractControllerService.boot(AbstractControllerService.java:477)
	at org.jboss.as.server.ServerService.boot(ServerService.java:448)
	at org.jboss.as.server.ServerService.boot(ServerService.java:401)
	at org.jboss.as.controller.AbstractControllerService$1.run(AbstractControllerService.java:416)
	at java.lang.Thread.run(Thread.java:748)
	Suppressed: java.util.concurrent.RejectedExecutionException: Executor is being shut down
		at org.jboss.threads.EnhancedQueueExecutor.rejectShutdown(EnhancedQueueExecutor.java:2028)
		... 23 more

I had the same error upgrading from 6.0.1 to 10.0.2. It turned out, that one of the realms had the “account” client deleted. I recreated the client from scratch and it works like a charm now.

Is this a bug that is worth filing? IMHO deleting this client is sure my fault.

2 Likes