# Keycloak upgrading from 3.4.3 to keycloak 10

**URL:** <https://forum.keycloak.org/t/keycloak-upgrading-from-3-4-3-to-keycloak-10/3813>\
**Category:** Getting advice\
**Created:** [July 16, 2020, 5:43am UTC](https://forum.keycloak.org/t/keycloak-upgrading-from-3-4-3-to-keycloak-10/3813 "2020-07-16T05:43:04Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![Nikhiljbhandari](https://yyz2.discourse-cdn.com/free1/user_avatar/forum.keycloak.org/nikhiljbhandari/32/10642_2.png) [@Nikhiljbhandari](https://forum.keycloak.org/u/Nikhiljbhandari)\
**Post date:** [July 16, 2020, 5:43am UTC](https://forum.keycloak.org/t/keycloak-upgrading-from-3-4-3-to-keycloak-10/3813/1 "2020-07-16T05:43:04Z")

</div>

Hi,  
we have a client using key cloak 3.4.3 and now wants to update to latest and greatest key cloak. We initially started migrating h2 database as we have it on one of client’s machine and then eventually will do with oracle in test and prod env. we tried with installing new keycloak 8 version on clients local machine and copied data folder from older keycloak 3.4.3 instance and it does not worked. further we tried with upgrading from keycloak 3.4.3 to keycloak 6 and it worked but any further upgradation fails with error as  
“Caused by: java.lang.NullPointerException  
at org.keycloak.migration.migrators.MigrateTo8\_0\_0.migrateRealmCommon(MigrateTo8\_0\_0.java:72)  
at org.keycloak.migration.migrators.MigrateTo8\_0\_0.lambda$migrate$0(MigrateTo8\_0\_0.java:49)  
at java.util.LinkedList$LLSpliterator.forEachRemaining(LinkedList.java:1235)  
at java.util.stream.ReferencePipeline$Head.forEach(ReferencePipeline.java:647)  
at org.keycloak.migration.migrators.MigrateTo8\_0\_0.migrate(MigrateTo8\_0\_0.java:49)  
at org.keycloak.migration.MigrationModelManager.migrate(MigrationModelManager.java:105)  
at org.keycloak.services.resources.KeycloakApplication.migrateModel(KeycloakApplication.java:272)  
at org.keycloak.services.resources.KeycloakApplication.migrateAndBootstrap(KeycloakApplication.java:213)  
at org.keycloak.services.resources.KeycloakApplication$1.run(KeycloakApplication.java:180)  
at org.keycloak.models.utils.KeycloakModelUtils.runJobInTransaction(KeycloakModelUtils.java:227)  
at org.keycloak.services.resources.KeycloakApplication.startup(KeycloakApplication.java:171)”

Can anyone have help here on this issue

---

<div class="post-metadata">

**Author:** ![Nikhiljbhandari](https://yyz2.discourse-cdn.com/free1/user_avatar/forum.keycloak.org/nikhiljbhandari/32/10642_2.png) [@Nikhiljbhandari](https://forum.keycloak.org/u/Nikhiljbhandari)\
**Post date:** [July 16, 2020, 5:44am UTC](https://forum.keycloak.org/t/keycloak-upgrading-from-3-4-3-to-keycloak-10/3813/2 "2020-07-16T05:44:21Z")

</div>

@mkanis, @bathe, @MoroccanGeek, @mshushkov, @pkadian, @ others, please guide with any inputs to proceed further

---

<div class="post-metadata">

**Author:** ![dasniko](https://yyz2.discourse-cdn.com/free1/user_avatar/forum.keycloak.org/dasniko/32/2969_2.png) [@dasniko](https://forum.keycloak.org/u/dasniko)\
**Post date:** [July 16, 2020, 6:37am UTC](https://forum.keycloak.org/t/keycloak-upgrading-from-3-4-3-to-keycloak-10/3813/3 "2020-07-16T06:37:18Z")

</div>

Did you delete any auto-created clients in any realm?  
The exception yields to migrating the Account client, but if you deleted it, the script will fail.

This is fixed in KC 9.x and up (I encountered the same error and did the PR fix).  
So, try to use KC 9.x or 10.x, this exception should no occur.  
Alternatively, re-create the Account client.

Deleting auto-created clients in a realm is not the way to go. Just disable the ones you don’t want/need, this prevents further issues.

---

<div class="post-metadata">

**Author:** ![Nikhiljbhandari](https://yyz2.discourse-cdn.com/free1/user_avatar/forum.keycloak.org/nikhiljbhandari/32/10642_2.png) [@Nikhiljbhandari](https://forum.keycloak.org/u/Nikhiljbhandari)\
**Post date:** [July 16, 2020, 9:06am UTC](https://forum.keycloak.org/t/keycloak-upgrading-from-3-4-3-to-keycloak-10/3813/4 "2020-07-16T09:06:53Z")

</div>

@dasniko, @mkanis, @bathe, @MoroccanGeek, @mshushkov, @pkadian, @dasniko anis, @bathe, @MoroccanGeek, @mshushkov, @pkadian, @others  
i tried with key cloak 10.0.2 but this time it failed with new error which doesnt seems to make any sense at all.  
"

2020-07-16 14:29:00.125Z ERROR [Controller Boot] o.j.a.c.management-operation  
{{}} 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(Abstrac "

and

" {{}} WFLYCTL0190: Step handler org.jboss.as.controller.AbstractAddStepHandler$1@599d88e3 for operation add at address [(“subsystem” =\> “transactions”)] 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)"

---

<div class="post-metadata">

**Author:** ![pkadian](https://yyz2.discourse-cdn.com/free1/user_avatar/forum.keycloak.org/pkadian/32/1354_2.png) [@pkadian](https://forum.keycloak.org/u/pkadian)\
**Post date:** [July 16, 2020, 12:29pm UTC](https://forum.keycloak.org/t/keycloak-upgrading-from-3-4-3-to-keycloak-10/3813/5 "2020-07-16T12:29:24Z")

</div>

Please Share complete logs of the keycloak. There should be another error or warning above the error which you shared with me.

Try to share debug logs. Enable logging on keycloak subsystem and change console log handler.

$ ./jboss-cli.sh --controller=[192.0.0.0:9990](http://192.0.0.0:9990) --connect

[[standalone@192.0.0.0:9990](http://standalone@192.0.0.0:9990) /] /subsystem=logging/logger=org.keycloak/:add(category=org.keycloak,level=TRACE)

$ [[standalone@192.0.0.0:9990](http://standalone@192.0.0.0:9990) /]/subsystem=logging/console-handler=CONSOLE:change-log-level(level=TRACE)

Thanks & Regards

---

<div class="post-metadata">

**Author:** ![Nikhiljbhandari](https://yyz2.discourse-cdn.com/free1/user_avatar/forum.keycloak.org/nikhiljbhandari/32/10642_2.png) [@Nikhiljbhandari](https://forum.keycloak.org/u/Nikhiljbhandari)\
**Post date:** [July 17, 2020, 5:10am UTC](https://forum.keycloak.org/t/keycloak-upgrading-from-3-4-3-to-keycloak-10/3813/6 "2020-07-17T05:10:09Z")

</div>

@dasniko, @mkanis, @bathe, @MoroccanGeek, @mshushkov, @pkadian, @dasniko anis, @bathe, @MoroccanGeek, @mshushkov, @pkadian, @others tried with all the log levels i.e. trace and also with log level “ALL” but there is no any error apart from the below:

"

2020-07-16 14:29:00.125Z ERROR [Controller Boot] o.j.a.c.management-operation  
{{}} 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(Abstrac "

and

" {{}} WFLYCTL0190: Step handler org.jboss.as.controller.AbstractAddStepHandler$1@599d88e3 for operation add at address [(“subsystem” =\> “transactions”)] 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)"

This is why i did mentioned the error doesnt make any sense at all.

---

<div class="post-metadata">

**Author:** ![Nikhiljbhandari](https://yyz2.discourse-cdn.com/free1/user_avatar/forum.keycloak.org/nikhiljbhandari/32/10642_2.png) [@Nikhiljbhandari](https://forum.keycloak.org/u/Nikhiljbhandari)\
**Post date:** [July 20, 2020, 6:42am UTC](https://forum.keycloak.org/t/keycloak-upgrading-from-3-4-3-to-keycloak-10/3813/7 "2020-07-20T06:42:06Z")

</div>

@dasniko, @mkanis, @bathe, @MoroccanGeek, @mshushkov, @pkadian, @others, any idea on how to proceed further

---

<div class="post-metadata">

**Author:** ![Nikhiljbhandari](https://yyz2.discourse-cdn.com/free1/user_avatar/forum.keycloak.org/nikhiljbhandari/32/10642_2.png) [@Nikhiljbhandari](https://forum.keycloak.org/u/Nikhiljbhandari)\
**Post date:** [August 19, 2020, 9:28am UTC](https://forum.keycloak.org/t/keycloak-upgrading-from-3-4-3-to-keycloak-10/3813/8 "2020-08-19T09:28:52Z")

</div>

@dasniko, @mkanis, @bathe, @MoroccanGeek, @mshushkov, @pkadian, @others, any idea on how to proceed further

---

<div class="post-metadata">

**Author:** ![ThanhTuan1695](https://yyz2.discourse-cdn.com/free1/user_avatar/forum.keycloak.org/thanhtuan1695/32/1352_2.png) [@ThanhTuan1695](https://forum.keycloak.org/u/ThanhTuan1695)\
**Post date:** [September 8, 2020, 7:35am UTC](https://forum.keycloak.org/t/keycloak-upgrading-from-3-4-3-to-keycloak-10/3813/9 "2020-09-08T07:35:32Z")

</div>

> [@Nikhiljbhandari](#):
>
> [Controller Boot] o.j.a.c.management-operation  
> {{}} WFLYCTL0013: Operation (“add”) failed - address: ([(“subsystem” =\> “microprofile-metrics-smallrye”)]): java.lang.NullPointerException

i am also stuck on it. Anyone have idea for this.

---

<div class="post-metadata">

**Author:** ![Nikhiljbhandari](https://yyz2.discourse-cdn.com/free1/user_avatar/forum.keycloak.org/nikhiljbhandari/32/10642_2.png) [@Nikhiljbhandari](https://forum.keycloak.org/u/Nikhiljbhandari)\
**Post date:** [September 30, 2020, 4:44am UTC](https://forum.keycloak.org/t/keycloak-upgrading-from-3-4-3-to-keycloak-10/3813/10 "2020-09-30T04:44:24Z")

</div>

Hi every1,

i was able to get this issue resolved. please follow below steps in order to resolve:

1. import realms from import feature in keycloak. you can import all the relams in one go or one file for one realm.
2. create a empty DB and let keycloak point to that db.  
once keycloak is started this new db is updated with keycloak schema.
3. now in keycloak export json file created in step1 and if success upgrade is done. In case of failure, create realm manually with same name as in old keycloak and then import json or u can import json while creating realm as well.
