[Keycloak-upgrade] From 3.4.2 version to 18.0

Hi Team,

We recently upgraded our Dev environment of Keycloak from 3.4.2 version to 18.0, since the data is not huge it worked smoothly.

Now when we are trying to do the same update in our staging env, it fails with the attached error.

We followed an article “Upgrading Guide (keycloak.org)” and manually created the sql script file and ran it in our staging DB before starting the keycloak. It fails with the same error attached.

We are trying to deploy keycloak using kubernetes with kubernetes cache stack enabled.

Any help would be appreciated!

Error details below added in two replies:

kl -f keycloak-6b8d6d94-vdxtw

JAVA_OPTS already set in environment; overriding default settings with values: -Xms1024m -Xmx2048m -XX:MetaspaceSize=96M -XX:MaxMetaspaceSize=256m -Djava.net.preferIPv4Stack=true -Djava.awt.headless=true
Appending additional Java properties to JAVA_OPTS: -Djgroups.dns.query=keycloak-headless.test.svc.cluster.local
2022-09-02 13:49:02,946 INFO [org.keycloak.common.Profile] (main) Preview feature enabled: scripts
2022-09-02 13:49:02,947 INFO [org.keycloak.common.Profile] (main) Preview feature enabled: token_exchange
2022-09-02 13:49:02,964 INFO [org.keycloak.quarkus.runtime.hostname.DefaultHostnameProvider] (main) Hostname settings: FrontEnd: testhostname, Strict HTTPS: true, Path: , Strict BackChannel: true, Admin: , Port: -1, Proxied: true
2022-09-02 13:49:03,813 WARN [org.infinispan.PERSISTENCE] (keycloak-cache-init) ISPN000554: jboss-marshalling is deprecated and planned for removal
2022-09-02 13:49:03,936 WARN [org.infinispan.CONFIG] (keycloak-cache-init) ISPN000569: Unable to persist Infinispan internal caches as no global state enabled
2022-09-02 13:49:03,953 INFO [org.infinispan.CONTAINER] (keycloak-cache-init) ISPN000556: Starting user marshaller ‘org.infinispan.jboss.marshalling.core.JBossUserMarshaller’
2022-09-02 13:49:04,354 INFO [org.infinispan.CONTAINER] (keycloak-cache-init) ISPN000128: Infinispan version: Infinispan ‘Triskaidekaphobia’ 13.0.9.Final
2022-09-02 13:49:04,523 INFO [org.infinispan.CLUSTER] (keycloak-cache-init) ISPN000078: Starting JGroups channel ISPN
2022-09-02 13:49:06,674 INFO [org.infinispan.CLUSTER] (keycloak-cache-init) ISPN000094: Received new cluster view for channel ISPN: [keycloak-6b8d6d94-vdxtw-11903|0] (1) [keycloak-6b8d6d94-vdxtw-11903]
2022-09-02 13:49:06,678 INFO [org.infinispan.CLUSTER] (keycloak-cache-init) ISPN000079: Channel ISPN local address is keycloak-6b8d6d94-vdxtw-11903, physical addresses are [xx.xx.xx.xx:7800]
2022-09-02 13:49:07,144 INFO [org.keycloak.connections.infinispan.DefaultInfinispanConnectionProviderFactory] (main) Node name: keycloak-6b8d6d94-vdxtw-11903, Site name: null
2022-09-02 13:54:05,373 WARN [com.arjuna.ats.arjuna] (Transaction Reaper) ARJUNA012117: TransactionReaper::check processing TX 0:ffff0afaa74f:aaf9:631209d1:0 in state RUN
2022-09-02 13:54:05,375 INFO [com.arjuna.ats.arjuna] (Transaction Reaper Worker 0) ARJUNA012404: Action id 0:ffff0afaa74f:aaf9:631209d1:0 - thread main at time 13:52:05.368 had stackTrace java.base@11.0.15/java.util.Collections$UnmodifiableCollection.isEmpty(Collections.java:1035)
java.base@11.0.15/java.util.Collections$UnmodifiableCollection.isEmpty(Collections.java:1035)
org.hibernate.bytecode.enhance.spi.interceptor.LazyAttributeLoadingInterceptor.hasAnyUninitializedAttributes(LazyAttributeLoadingInterceptor.java:132)
org.hibernate.tuple.entity.BytecodeEnhancementMetadataPojoImpl.hasUnFetchedAttributes(BytecodeEnhancementMetadataPojoImpl.java:109)
org.hibernate.persister.entity.AbstractEntityPersister.hasUninitializedLazyProperties(AbstractEntityPersister.java:5305)
org.hibernate.engine.internal.Cascade.cascade(Cascade.java:95)
org.hibernate.event.internal.AbstractFlushingEventListener.cascadeOnFlush(AbstractFlushingEventListener.java:159)
org.hibernate.event.internal.AbstractFlushingEventListener.prepareEntityFlushes(AbstractFlushingEventListener.java:149)
org.hibernate.event.internal.AbstractFlushingEventListener.flushEverythingToExecutions(AbstractFlushingEventListener.java:82)
org.hibernate.event.internal.DefaultAutoFlushEventListener.onAutoFlush(DefaultAutoFlushEventListener.java:50)
org.hibernate.internal.SessionImpl$$Lambda$846/0x0000000840ab0040.accept(Unknown Source)
org.hibernate.event.service.internal.EventListenerGroupImpl.fireEventOnEachListener(EventListenerGroupImpl.java:107)
org.hibernate.internal.SessionImpl.autoFlushIfRequired(SessionImpl.java:1367)
org.hibernate.internal.SessionImpl.scroll(SessionImpl.java:1592)
org.hibernate.query.internal.AbstractProducedQuery.doScroll(AbstractProducedQuery.java:1588)
org.hibernate.query.internal.AbstractProducedQuery.scroll(AbstractProducedQuery.java:1574)
org.hibernate.query.internal.AbstractProducedQuery.stream(AbstractProducedQuery.java:1598)
org.hibernate.query.Query.getResultStream(Query.java:1140)
org.keycloak.models.jpa.JpaRealmProvider.getRolesStream(JpaRealmProvider.java:334)
org.keycloak.models.jpa.JpaRealmProvider.getClientRolesStream(JpaRealmProvider.java:330)
org.keycloak.storage.RoleStorageManager.getClientRolesStream(RoleStorageManager.java:222)
org.keycloak.models.cache.infinispan.RealmCacheSession.getClientRolesStream(RealmCacheSession.java:711)
org.keycloak.models.jpa.ClientAdapter.getRolesStream(ClientAdapter.java:635)
org.keycloak.models.jpa.ClientAdapter.hasScope(ClientAdapter.java:655)
org.keycloak.models.delegate.ClientModelLazyDelegate.hasScope(ClientModelLazyDelegate.java:564)
org.keycloak.migration.migrators.MigrateTo4_0_0.lambda$migrateRealm$5(MigrateTo4_0_0.java:104)
org.keycloak.migration.migrators.MigrateTo4_0_0$$Lambda$1194/0x0000000840c10040.test(Unknown Source)
java.base@11.0.15/java.util.stream.ReferencePipeline$2$1.accept(ReferencePipeline.java:176)
java.base@11.0.15/java.util.stream.ReferencePipeline$2$1.accept(ReferencePipeline.java:177)
java.base@11.0.15/java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:195)
java.base@11.0.15/java.util.Iterator.forEachRemaining(Iterator.java:133)
java.base@11.0.15/java.util.Spliterators$IteratorSpliterator.forEachRemaining(Spliterators.java:1801)
java.base@11.0.15/java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:484)
java.base@11.0.15/java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:474)
java.base@11.0.15/java.util.stream.ForEachOps$ForEachOp.evaluateSequential(ForEachOps.java:150)
java.base@11.0.15/java.util.stream.ForEachOps$ForEachOp$OfRef.evaluateSequential(ForEachOps.java:173)
java.base@11.0.15/java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)
java.base@11.0.15/java.util.stream.ReferencePipeline.forEach(ReferencePipeline.java:497)
org.hibernate.query.spi.StreamDecorator.forEach(StreamDecorator.java:153)
org.keycloak.utils.ClosingStream.forEach(ClosingStream.java:128)
org.keycloak.migration.migrators.MigrateTo4_0_0.migrateRealm(MigrateTo4_0_0.java:111)
org.keycloak.migration.migrators.MigrateTo4_0_0.lambda$migrate$0(MigrateTo4_0_0.java:51)
org.keycloak.migration.migrators.MigrateTo4_0_0$$Lambda$1076/0x0000000840bb5c40.accept(Unknown Source)
java.base@11.0.15/java.util.stream.ForEachOps$ForEachOp$OfRef.accept(ForEachOps.java:183)
java.base@11.0.15/java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:195)
java.base@11.0.15/java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:195)
java.base@11.0.15/java.util.stream.ReferencePipeline$2$1.accept(ReferencePipeline.java:177)
java.base@11.0.15/java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:195)
java.base@11.0.15/java.util.Iterator.forEachRemaining(Iterator.java:133)
java.base@11.0.15/java.util.Spliterators$IteratorSpliterator.forEachRemaining(Spliterators.java:1801)
java.base@11.0.15/java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:484)
java.base@11.0.15/java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:474)
java.base@11.0.15/java.util.stream.ForEachOps$ForEachOp.evaluateSequential(ForEachOps.java:150)
java.base@11.0.15/java.util.stream.ForEachOps$ForEachOp$OfRef.evaluateSequential(ForEachOps.java:173)
java.base@11.0.15/java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)
java.base@11.0.15/java.util.stream.ReferencePipeline.forEach(ReferencePipeline.java:497)
org.hibernate.query.spi.StreamDecorator.forEach(StreamDecorator.java:153)
org.keycloak.utils.ClosingStream.forEach(ClosingStream.java:128)
org.keycloak.migration.migrators.MigrateTo4_0_0.migrate(MigrateTo4_0_0.java:51)
org.keycloak.migration.MigrationModelManager.migrate(MigrationModelManager.java:119)
org.keycloak.quarkus.runtime.storage.database.jpa.QuarkusJpaConnectionProviderFactory.migrateModel(QuarkusJpaConnectionProviderFactory.java:316)
org.keycloak.quarkus.runtime.storage.database.jpa.QuarkusJpaConnectionProviderFactory.initSchema(QuarkusJpaConnectionProviderFactory.java:241)
org.keycloak.quarkus.runtime.storage.database.jpa.QuarkusJpaConnectionProviderFactory$$Lambda$845/0x0000000840a97c40.run(Unknown Source)
org.keycloak.models.utils.KeycloakModelUtils.runJobInTransaction(KeycloakModelUtils.java:242)
org.keycloak.quarkus.runtime.storage.database.jpa.QuarkusJpaConnectionProviderFactory.postInit(QuarkusJpaConnectionProviderFactory.java:162)
org.keycloak.quarkus.runtime.integration.QuarkusKeycloakSessionFactory.init(QuarkusKeycloakSessionFactory.java:96)
org.keycloak.quarkus.runtime.integration.jaxrs.QuarkusKeycloakApplication.initializeKeycloakSessionFactory(QuarkusKeycloakApplication.java:68)
org.keycloak.quarkus.runtime.integration.jaxrs.QuarkusKeycloakApplication.startup(QuarkusKeycloakApplication.java:49)
org.keycloak.services.resources.KeycloakApplication$$Lambda$192/0x00000008402c5040.run(Unknown Source)
org.keycloak.quarkus.runtime.integration.QuarkusLifecycleObserver.onStartupEvent(QuarkusLifecycleObserver.java:37)
org.keycloak.quarkus.runtime.integration.QuarkusLifecycleObserver_Observer_onStartupEvent_b0e82415b143738dc1f986a5fa4668e83d0a5dea.notify(Unknown Source)
io.quarkus.arc.impl.EventImpl$Notifier.notifyObservers(EventImpl.java:320)
io.quarkus.arc.impl.EventImpl$Notifier.notify(EventImpl.java:302)
io.quarkus.arc.impl.EventImpl.fire(EventImpl.java:73)
io.quarkus.arc.runtime.ArcRecorder.fireLifecycleEvent(ArcRecorder.java:128)
io.quarkus.arc.runtime.ArcRecorder.handleLifecycleEvents(ArcRecorder.java:97)
io.quarkus.deployment.steps.LifecycleEventsBuildStep$startupEvent1144526294.deploy_0(Unknown Source)
io.quarkus.deployment.steps.LifecycleEventsBuildStep$startupEvent1144526294.deploy(Unknown Source)
io.quarkus.runner.ApplicationImpl.doStart(Unknown Source)
io.quarkus.runtime.Application.start(Application.java:101)
io.quarkus.runtime.ApplicationLifecycleManager.run(ApplicationLifecycleManager.java:103)
io.quarkus.runtime.Quarkus.run(Quarkus.java:67)
org.keycloak.quarkus.runtime.KeycloakMain.start(KeycloakMain.java:86)
org.keycloak.quarkus.runtime.cli.command.AbstractStartCommand.run(AbstractStartCommand.java:34)
picocli.CommandLine.executeUserObject(CommandLine.java:1939)
picocli.CommandLine.access$1300(CommandLine.java:145)
picocli.CommandLine$RunLast.executeUserObjectOfLastSubcommandWithSameParent(CommandLine.java:2358)
picocli.CommandLine$RunLast.handle(CommandLine.java:2352)
picocli.CommandLine$RunLast.handle(CommandLine.java:2314)
picocli.CommandLine$AbstractParseResultHandler.execute(CommandLine.java:2179)
picocli.CommandLine$RunLast.execute(CommandLine.java:2316)
picocli.CommandLine.execute(CommandLine.java:2078)
org.keycloak.quarkus.runtime.cli.Picocli.parseAndRun(Picocli.java:88)
org.keycloak.quarkus.runtime.KeycloakMain.main(KeycloakMain.java:77)
java.base@11.0.15/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
java.base@11.0.15/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
java.base@11.0.15/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
java.base@11.0.15/java.lang.reflect.Method.invoke(Method.java:566)
app//io.quarkus.bootstrap.runner.QuarkusEntryPoint.doRun(QuarkusEntryPoint.java:60)
app//io.quarkus.bootstrap.runner.QuarkusEntryPoint.main(QuarkusEntryPoint.java:31)

2022-09-02 13:54:05,375 INFO [com.arjuna.ats.arjuna] (Transaction Reaper Worker 0) ARJUNA012404: Action id 0:ffff0afaa74f:aaf9:631209d1:0 - thread main at time 13:52:35.367 had stackTrace org.hibernate.event.internal.AbstractFlushingEventListener.lambda$flushCollections$2(AbstractFlushingEventListener.java:299)
org.hibernate.event.internal.AbstractFlushingEventListener$$Lambda$1070/0x0000000840bb7440.accept(Unknown Source)
org.hibernate.engine.internal.StatefulPersistenceContext.forEachCollectionEntry(StatefulPersistenceContext.java:1136)
org.hibernate.event.internal.AbstractFlushingEventListener.flushCollections(AbstractFlushingEventListener.java:261)
org.hibernate.event.internal.AbstractFlushingEventListener.flushEverythingToExecutions(AbstractFlushingEventListener.java:94)
org.hibernate.event.internal.DefaultAutoFlushEventListener.onAutoFlush(DefaultAutoFlushEventListener.java:50)
org.hibernate.internal.SessionImpl$$Lambda$846/0x0000000840ab0040.accept(Unknown Source)
org.hibernate.event.service.internal.EventListenerGroupImpl.fireEventOnEachListener(EventListenerGroupImpl.java:107)
org.hibernate.internal.SessionImpl.autoFlushIfRequired(SessionImpl.java:1367)
org.hibernate.internal.SessionImpl.scroll(SessionImpl.java:1592)
org.hibernate.query.internal.AbstractProducedQuery.doScroll(AbstractProducedQuery.java:1588)
org.hibernate.query.internal.AbstractProducedQuery.scroll(AbstractProducedQuery.java:1574)
org.hibernate.query.internal.AbstractProducedQuery.stream(AbstractProducedQuery.java:1598)
org.hibernate.query.Query.getResultStream(Query.java:1140)
org.keycloak.models.jpa.JpaRealmProvider.getRolesStream(JpaRealmProvider.java:334)
org.keycloak.models.jpa.JpaRealmProvider.getClientRolesStream(JpaRealmProvider.java:330)
org.keycloak.storage.RoleStorageManager.getClientRolesStream(RoleStorageManager.java:222)
org.keycloak.models.cache.infinispan.RealmCacheSession.getClientRolesStream(RealmCacheSession.java:711)
org.keycloak.models.jpa.ClientAdapter.getRolesStream(ClientAdapter.java:635)
org.keycloak.models.jpa.ClientAdapter.hasScope(ClientAdapter.java:655)
org.keycloak.models.delegate.ClientModelLazyDelegate.hasScope(ClientModelLazyDelegate.java:564)
org.keycloak.migration.migrators.MigrateTo4_0_0.lambda$migrateRealm$5(MigrateTo4_0_0.java:104)
org.keycloak.migration.migrators.MigrateTo4_0_0$$Lambda$1194/0x0000000840c10040.test(Unknown Source)
java.base@11.0.15/java.util.stream.ReferencePipeline$2$1.accept(ReferencePipeline.java:176)
java.base@11.0.15/java.util.stream.ReferencePipeline$2$1.accept(ReferencePipeline.java:177)
java.base@11.0.15/java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:195)
java.base@11.0.15/java.util.Iterator.forEachRemaining(Iterator.java:133)
java.base@11.0.15/java.util.Spliterators$IteratorSpliterator.forEachRemaining(Spliterators.java:1801)
java.base@11.0.15/java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:484)
java.base@11.0.15/java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:474)
java.base@11.0.15/java.util.stream.ForEachOps$ForEachOp.evaluateSequential(ForEachOps.java:150)
java.base@11.0.15/java.util.stream.ForEachOps$ForEachOp$OfRef.evaluateSequential(ForEachOps.java:173)
java.base@11.0.15/java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)
java.base@11.0.15/java.util.stream.ReferencePipeline.forEach(ReferencePipeline.java:497)
org.hibernate.query.spi.StreamDecorator.forEach(StreamDecorator.java:153)
org.keycloak.utils.ClosingStream.forEach(ClosingStream.java:128)
org.keycloak.migration.migrators.MigrateTo4_0_0.migrateRealm(MigrateTo4_0_0.java:111)
org.keycloak.migration.migrators.MigrateTo4_0_0.lambda$migrate$0(MigrateTo4_0_0.java:51)
org.keycloak.migration.migrators.MigrateTo4_0_0$$Lambda$1076/0x0000000840bb5c40.accept(Unknown Source)
java.base@11.0.15/java.util.stream.ForEachOps$ForEachOp$OfRef.accept(ForEachOps.java:183)
java.base@11.0.15/java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:195)
java.base@11.0.15/java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:195)
java.base@11.0.15/java.util.stream.ReferencePipeline$2$1.accept(ReferencePipeline.java:177)
java.base@11.0.15/java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:195)
java.base@11.0.15/java.util.Iterator.forEachRemaining(Iterator.java:133)
java.base@11.0.15/java.util.Spliterators$IteratorSpliterator.forEachRemaining(Spliterators.java:1801)
java.base@11.0.15/java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:484)
java.base@11.0.15/java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:474)
java.base@11.0.15/java.util.stream.ForEachOps$ForEachOp.evaluateSequential(ForEachOps.java:150)
java.base@11.0.15/java.util.stream.ForEachOps$ForEachOp$OfRef.evaluateSequential(ForEachOps.java:173)
java.base@11.0.15/java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)
java.base@11.0.15/java.util.stream.ReferencePipeline.forEach(ReferencePipeline.java:497)
org.hibernate.query.spi.StreamDecorator.forEach(StreamDecorator.java:153)
org.keycloak.utils.ClosingStream.forEach(ClosingStream.java:128)
org.keycloak.migration.migrators.MigrateTo4_0_0.migrate(MigrateTo4_0_0.java:51)
org.keycloak.migration.MigrationModelManager.migrate(MigrationModelManager.java:119)
org.keycloak.quarkus.runtime.storage.database.jpa.QuarkusJpaConnectionProviderFactory.migrateModel(QuarkusJpaConnectionProviderFactory.java:316)
org.keycloak.quarkus.runtime.storage.database.jpa.QuarkusJpaConnectionProviderFactory.initSchema(QuarkusJpaConnectionProviderFactory.java:241)
org.keycloak.quarkus.runtime.storage.database.jpa.QuarkusJpaConnectionProviderFactory$$Lambda$845/0x0000000840a97c40.run(Unknown Source)
org.keycloak.models.utils.KeycloakModelUtils.runJobInTransaction(KeycloakModelUtils.java:242)
org.keycloak.quarkus.runtime.storage.database.jpa.QuarkusJpaConnectionProviderFactory.postInit(QuarkusJpaConnectionProviderFactory.java:162)
org.keycloak.quarkus.runtime.integration.QuarkusKeycloakSessionFactory.init(QuarkusKeycloakSessionFactory.java:96)
org.keycloak.quarkus.runtime.integration.jaxrs.QuarkusKeycloakApplication.initializeKeycloakSessionFactory(QuarkusKeycloakApplication.java:68)
org.keycloak.quarkus.runtime.integration.jaxrs.QuarkusKeycloakApplication.startup(QuarkusKeycloakApplication.java:49)
org.keycloak.services.resources.KeycloakApplication$$Lambda$192/0x00000008402c5040.run(Unknown Source)
org.keycloak.quarkus.runtime.integration.QuarkusLifecycleObserver.onStartupEvent(QuarkusLifecycleObserver.java:37)
org.keycloak.quarkus.runtime.integration.QuarkusLifecycleObserver_Observer_onStartupEvent_b0e82415b143738dc1f986a5fa4668e83d0a5dea.notify(Unknown Source)
io.quarkus.arc.impl.EventImpl$Notifier.notifyObservers(EventImpl.java:320)
io.quarkus.arc.impl.EventImpl$Notifier.notify(EventImpl.java:302)
io.quarkus.arc.impl.EventImpl.fire(EventImpl.java:73)
io.quarkus.arc.runtime.ArcRecorder.fireLifecycleEvent(ArcRecorder.java:128)
io.quarkus.arc.runtime.ArcRecorder.handleLifecycleEvents(ArcRecorder.java:97)
io.quarkus.deployment.steps.LifecycleEventsBuildStep$startupEvent1144526294.deploy_0(Unknown Source)
io.quarkus.deployment.steps.LifecycleEventsBuildStep$startupEvent1144526294.deploy(Unknown Source)
io.quarkus.runner.ApplicationImpl.doStart(Unknown Source)
io.quarkus.runtime.Application.start(Application.java:101)
io.quarkus.runtime.ApplicationLifecycleManager.run(ApplicationLifecycleManager.java:103)
io.quarkus.runtime.Quarkus.run(Quarkus.java:67)
org.keycloak.quarkus.runtime.KeycloakMain.start(KeycloakMain.java:86)
org.keycloak.quarkus.runtime.cli.command.AbstractStartCommand.run(AbstractStartCommand.java:34)
picocli.CommandLine.executeUserObject(CommandLine.java:1939)
picocli.CommandLine.access$1300(CommandLine.java:145)
picocli.CommandLine$RunLast.executeUserObjectOfLastSubcommandWithSameParent(CommandLine.java:2358)
picocli.CommandLine$RunLast.handle(CommandLine.java:2352)
picocli.CommandLine$RunLast.handle(CommandLine.java:2314)
picocli.CommandLine$AbstractParseResultHandler.execute(CommandLine.java:2179)
picocli.CommandLine$RunLast.execute(CommandLine.java:2316)
picocli.CommandLine.execute(CommandLine.java:2078)
org.keycloak.quarkus.runtime.cli.Picocli.parseAndRun(Picocli.java:88)
org.keycloak.quarkus.runtime.KeycloakMain.main(KeycloakMain.java:77)
java.base@11.0.15/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
java.base@11.0.15/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
java.base@11.0.15/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
java.base@11.0.15/java.lang.reflect.Method.invoke(Method.java:566)
app//io.quarkus.bootstrap.runner.QuarkusEntryPoint.doRun(QuarkusEntryPoint.java:60)
app//io.quarkus.bootstrap.runner.QuarkusEntryPoint.main(QuarkusEntryPoint.java:31)

2022-09-02 13:54:05,375 INFO [com.arjuna.ats.arjuna] (Transaction Reaper Worker 0) ARJUNA012404: Action id 0:ffff0afaa74f:aaf9:631209d1:0 - thread main at time 13:53:05.367 had stackTrace org.hibernate.engine.spi.CollectionEntry.preFlush(CollectionEntry.java:172)
org.hibernate.event.internal.AbstractFlushingEventListener.lambda$prepareCollectionFlushes$0(AbstractFlushingEventListener.java:195)
org.hibernate.event.internal.AbstractFlushingEventListener$$Lambda$1067/0x0000000840bb7840.accept(Unknown Source)
org.hibernate.engine.internal.StatefulPersistenceContext.forEachCollectionEntry(StatefulPersistenceContext.java:1136)
org.hibernate.event.internal.AbstractFlushingEventListener.prepareCollectionFlushes(AbstractFlushingEventListener.java:194)
org.hibernate.event.internal.AbstractFlushingEventListener.flushEverythingToExecutions(AbstractFlushingEventListener.java:86)
org.hibernate.event.internal.DefaultAutoFlushEventListener.onAutoFlush(DefaultAutoFlushEventListener.java:50)
org.hibernate.internal.SessionImpl$$Lambda$846/0x0000000840ab0040.accept(Unknown Source)
org.hibernate.event.service.internal.EventListenerGroupImpl.fireEventOnEachListener(EventListenerGroupImpl.java:107)
org.hibernate.internal.SessionImpl.autoFlushIfRequired(SessionImpl.java:1367)
org.hibernate.internal.SessionImpl.scroll(SessionImpl.java:1592)
org.hibernate.query.internal.AbstractProducedQuery.doScroll(AbstractProducedQuery.java:1588)
org.hibernate.query.internal.AbstractProducedQuery.scroll(AbstractProducedQuery.java:1574)
org.hibernate.query.internal.AbstractProducedQuery.stream(AbstractProducedQuery.java:1598)
org.hibernate.query.Query.getResultStream(Query.java:1140)
org.keycloak.models.jpa.JpaRealmProvider.getRolesStream(JpaRealmProvider.java:334)
org.keycloak.models.jpa.JpaRealmProvider.getClientRolesStream(JpaRealmProvider.java:330)
org.keycloak.storage.RoleStorageManager.getClientRolesStream(RoleStorageManager.java:222)
org.keycloak.models.cache.infinispan.RealmCacheSession.getClientRolesStream(RealmCacheSession.java:711)
org.keycloak.models.jpa.ClientAdapter.getRolesStream(ClientAdapter.java:635)
org.keycloak.models.jpa.ClientAdapter.hasScope(ClientAdapter.java:655)
org.keycloak.models.delegate.ClientModelLazyDelegate.hasScope(ClientModelLazyDelegate.java:564)
org.keycloak.migration.migrators.MigrateTo4_0_0.lambda$migrateRealm$5(MigrateTo4_0_0.java:104)
org.keycloak.migration.migrators.MigrateTo4_0_0$$Lambda$1194/0x0000000840c10040.test(Unknown Source)
java.base@11.0.15/java.util.stream.ReferencePipeline$2$1.accept(ReferencePipeline.java:176)
java.base@11.0.15/java.util.stream.ReferencePipeline$2$1.accept(ReferencePipeline.java:177)
java.base@11.0.15/java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:195)
java.base@11.0.15/java.util.Iterator.forEachRemaining(Iterator.java:133)
java.base@11.0.15/java.util.Spliterators$IteratorSpliterator.forEachRemaining(Spliterators.java:1801)
java.base@11.0.15/java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:484)
java.base@11.0.15/java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:474)
java.base@11.0.15/java.util.stream.ForEachOps$ForEachOp.evaluateSequential(ForEachOps.java:150)
java.base@11.0.15/java.util.stream.ForEachOps$ForEachOp$OfRef.evaluateSequential(ForEachOps.java:173)
java.base@11.0.15/java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)
java.base@11.0.15/java.util.stream.ReferencePipeline.forEach(ReferencePipeline.java:497)
org.hibernate.query.spi.StreamDecorator.forEach(StreamDecorator.java:153)
org.keycloak.utils.ClosingStream.forEach(ClosingStream.java:128)
org.keycloak.migration.migrators.MigrateTo4_0_0.migrateRealm(MigrateTo4_0_0.java:111)
org.keycloak.migration.migrators.MigrateTo4_0_0.lambda$migrate$0(MigrateTo4_0_0.java:51)
org.keycloak.migration.migrators.MigrateTo4_0_0$$Lambda$1076/0x0000000840bb5c40.accept(Unknown Source)
java.base@11.0.15/java.util.stream.ForEachOps$ForEachOp$OfRef.accept(ForEachOps.java:183)
java.base@11.0.15/java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:195)
java.base@11.0.15/java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:195)
java.base@11.0.15/java.util.stream.ReferencePipeline$2$1.accept(ReferencePipeline.java:177)
java.base@11.0.15/java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:195)
java.base@11.0.15/java.util.Iterator.forEachRemaining(Iterator.java:133)
java.base@11.0.15/java.util.Spliterators$IteratorSpliterator.forEachRemaining(Spliterators.java:1801)
java.base@11.0.15/java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:484)
java.base@11.0.15/java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:474)
java.base@11.0.15/java.util.stream.ForEachOps$ForEachOp.evaluateSequential(ForEachOps.java:150)
java.base@11.0.15/java.util.stream.ForEachOps$ForEachOp$OfRef.evaluateSequential(ForEachOps.java:173)
java.base@11.0.15/java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)
java.base@11.0.15/java.util.stream.ReferencePipeline.forEach(ReferencePipeline.java:497)
org.hibernate.query.spi.StreamDecorator.forEach(StreamDecorator.java:153)
org.keycloak.utils.ClosingStream.forEach(ClosingStream.java:128)
org.keycloak.migration.migrators.MigrateTo4_0_0.migrate(MigrateTo4_0_0.java:51)
org.keycloak.migration.MigrationModelManager.migrate(MigrationModelManager.java:119)
org.keycloak.quarkus.runtime.storage.database.jpa.QuarkusJpaConnectionProviderFactory.migrateModel(QuarkusJpaConnectionProviderFactory.java:316)
org.keycloak.quarkus.runtime.storage.database.jpa.QuarkusJpaConnectionProviderFactory.initSchema(QuarkusJpaConnectionProviderFactory.java:241)
org.keycloak.quarkus.runtime.storage.database.jpa.QuarkusJpaConnectionProviderFactory$$Lambda$845/0x0000000840a97c40.run(Unknown Source)
org.keycloak.models.utils.KeycloakModelUtils.runJobInTransaction(KeycloakModelUtils.java:242)
org.keycloak.quarkus.runtime.storage.database.jpa.QuarkusJpaConnectionProviderFactory.postInit(QuarkusJpaConnectionProviderFactory.java:162)
org.keycloak.quarkus.runtime.integration.QuarkusKeycloakSessionFactory.init(QuarkusKeycloakSessionFactory.java:96)
org.keycloak.quarkus.runtime.integration.jaxrs.QuarkusKeycloakApplication.initializeKeycloakSessionFactory(QuarkusKeycloakApplication.java:68)
org.keycloak.quarkus.runtime.integration.jaxrs.QuarkusKeycloakApplication.startup(QuarkusKeycloakApplication.java:49)
org.keycloak.services.resources.KeycloakApplication$$Lambda$192/0x00000008402c5040.run(Unknown Source)
org.keycloak.quarkus.runtime.integration.QuarkusLifecycleObserver.onStartupEvent(QuarkusLifecycleObserver.java:37)
org.keycloak.quarkus.runtime.integration.QuarkusLifecycleObserver_Observer_onStartupEvent_b0e82415b143738dc1f986a5fa4668e83d0a5dea.notify(Unknown Source)
io.quarkus.arc.impl.EventImpl$Notifier.notifyObservers(EventImpl.java:320)
io.quarkus.arc.impl.EventImpl$Notifier.notify(EventImpl.java:302)
io.quarkus.arc.impl.EventImpl.fire(EventImpl.java:73)
io.quarkus.arc.runtime.ArcRecorder.fireLifecycleEvent(ArcRecorder.java:128)
io.quarkus.arc.runtime.ArcRecorder.handleLifecycleEvents(ArcRecorder.java:97)
io.quarkus.deployment.steps.LifecycleEventsBuildStep$startupEvent1144526294.deploy_0(Unknown Source)
io.quarkus.deployment.steps.LifecycleEventsBuildStep$startupEvent1144526294.deploy(Unknown Source)
io.quarkus.runner.ApplicationImpl.doStart(Unknown Source)
io.quarkus.runtime.Application.start(Application.java:101)
io.quarkus.runtime.ApplicationLifecycleManager.run(ApplicationLifecycleManager.java:103)
io.quarkus.runtime.Quarkus.run(Quarkus.java:67)
org.keycloak.quarkus.runtime.KeycloakMain.start(KeycloakMain.java:86)
org.keycloak.quarkus.runtime.cli.command.AbstractStartCommand.run(AbstractStartCommand.java:34)
picocli.CommandLine.executeUserObject(CommandLine.java:1939)
picocli.CommandLine.access$1300(CommandLine.java:145)
picocli.CommandLine$RunLast.executeUserObjectOfLastSubcommandWithSameParent(CommandLine.java:2358)
picocli.CommandLine$RunLast.handle(CommandLine.java:2352)
picocli.CommandLine$RunLast.handle(CommandLine.java:2314)
picocli.CommandLine$AbstractParseResultHandler.execute(CommandLine.java:2179)
picocli.CommandLine$RunLast.execute(CommandLine.java:2316)
picocli.CommandLine.execute(CommandLine.java:2078)
org.keycloak.quarkus.runtime.cli.Picocli.parseAndRun(Picocli.java:88)
org.keycloak.quarkus.runtime.KeycloakMain.main(KeycloakMain.java:77)
java.base@11.0.15/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
java.base@11.0.15/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
java.base@11.0.15/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
java.base@11.0.15/java.lang.reflect.Method.invoke(Method.java:566)
app//io.quarkus.bootstrap.runner.QuarkusEntryPoint.doRun(QuarkusEntryPoint.java:60)
app//io.quarkus.bootstrap.runner.QuarkusEntryPoint.main(QuarkusEntryPoint.java:31)

Other part of error details:

2022-09-02 13:54:05,376 INFO [com.arjuna.ats.arjuna] (Transaction Reaper Worker 0) ARJUNA012404: Action id 0:ffff0afaa74f:aaf9:631209d1:0 - thread main at time 13:53:35.367 had stackTrace org.hibernate.engine.internal.Collections.processReachableCollection(Collections.java:169)
org.hibernate.event.internal.FlushVisitor.processCollection(FlushVisitor.java:53)
org.hibernate.event.internal.AbstractVisitor.processValue(AbstractVisitor.java:104)
org.hibernate.event.internal.AbstractVisitor.processValue(AbstractVisitor.java:65)
org.hibernate.event.internal.AbstractVisitor.processEntityPropertyValues(AbstractVisitor.java:59)
org.hibernate.event.internal.DefaultFlushEntityEventListener.onFlushEntity(DefaultFlushEntityEventListener.java:183)
org.hibernate.event.internal.AbstractFlushingEventListener$$Lambda$1068/0x0000000840bb7c40.accept(Unknown Source)
org.hibernate.event.service.internal.EventListenerGroupImpl.fireEventOnEachListener(EventListenerGroupImpl.java:107)
org.hibernate.event.internal.AbstractFlushingEventListener.flushEntities(AbstractFlushingEventListener.java:229)
org.hibernate.event.internal.AbstractFlushingEventListener.flushEverythingToExecutions(AbstractFlushingEventListener.java:93)
org.hibernate.event.internal.DefaultAutoFlushEventListener.onAutoFlush(DefaultAutoFlushEventListener.java:50)
org.hibernate.internal.SessionImpl$$Lambda$846/0x0000000840ab0040.accept(Unknown Source)
org.hibernate.event.service.internal.EventListenerGroupImpl.fireEventOnEachListener(EventListenerGroupImpl.java:107)
org.hibernate.internal.SessionImpl.autoFlushIfRequired(SessionImpl.java:1367)
org.hibernate.internal.SessionImpl.scroll(SessionImpl.java:1592)
org.hibernate.query.internal.AbstractProducedQuery.doScroll(AbstractProducedQuery.java:1588)
org.hibernate.query.internal.AbstractProducedQuery.scroll(AbstractProducedQuery.java:1574)
org.hibernate.query.internal.AbstractProducedQuery.stream(AbstractProducedQuery.java:1598)
org.hibernate.query.Query.getResultStream(Query.java:1140)
org.keycloak.models.jpa.JpaRealmProvider.getRolesStream(JpaRealmProvider.java:334)
org.keycloak.models.jpa.JpaRealmProvider.getClientRolesStream(JpaRealmProvider.java:330)
org.keycloak.storage.RoleStorageManager.getClientRolesStream(RoleStorageManager.java:222)
org.keycloak.models.cache.infinispan.RealmCacheSession.getClientRolesStream(RealmCacheSession.java:711)
org.keycloak.models.jpa.ClientAdapter.getRolesStream(ClientAdapter.java:635)
org.keycloak.models.jpa.ClientAdapter.hasScope(ClientAdapter.java:655)
org.keycloak.models.delegate.ClientModelLazyDelegate.hasScope(ClientModelLazyDelegate.java:564)
org.keycloak.migration.migrators.MigrateTo4_0_0.lambda$migrateRealm$5(MigrateTo4_0_0.java:104)
org.keycloak.migration.migrators.MigrateTo4_0_0$$Lambda$1194/0x0000000840c10040.test(Unknown Source)
java.base@11.0.15/java.util.stream.ReferencePipeline$2$1.accept(ReferencePipeline.java:176)
java.base@11.0.15/java.util.stream.ReferencePipeline$2$1.accept(ReferencePipeline.java:177)
java.base@11.0.15/java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:195)
java.base@11.0.15/java.util.Iterator.forEachRemaining(Iterator.java:133)
java.base@11.0.15/java.util.Spliterators$IteratorSpliterator.forEachRemaining(Spliterators.java:1801)
java.base@11.0.15/java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:484)
java.base@11.0.15/java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:474)
java.base@11.0.15/java.util.stream.ForEachOps$ForEachOp.evaluateSequential(ForEachOps.java:150)
java.base@11.0.15/java.util.stream.ForEachOps$ForEachOp$OfRef.evaluateSequential(ForEachOps.java:173)
java.base@11.0.15/java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)
java.base@11.0.15/java.util.stream.ReferencePipeline.forEach(ReferencePipeline.java:497)
org.hibernate.query.spi.StreamDecorator.forEach(StreamDecorator.java:153)
org.keycloak.utils.ClosingStream.forEach(ClosingStream.java:128)
org.keycloak.migration.migrators.MigrateTo4_0_0.migrateRealm(MigrateTo4_0_0.java:111)
org.keycloak.migration.migrators.MigrateTo4_0_0.lambda$migrate$0(MigrateTo4_0_0.java:51)
org.keycloak.migration.migrators.MigrateTo4_0_0$$Lambda$1076/0x0000000840bb5c40.accept(Unknown Source)
java.base@11.0.15/java.util.stream.ForEachOps$ForEachOp$OfRef.accept(ForEachOps.java:183)
java.base@11.0.15/java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:195)
java.base@11.0.15/java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:195)
java.base@11.0.15/java.util.stream.ReferencePipeline$2$1.accept(ReferencePipeline.java:177)
java.base@11.0.15/java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:195)
java.base@11.0.15/java.util.Iterator.forEachRemaining(Iterator.java:133)
java.base@11.0.15/java.util.Spliterators$IteratorSpliterator.forEachRemaining(Spliterators.java:1801)
java.base@11.0.15/java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:484)
java.base@11.0.15/java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:474)
java.base@11.0.15/java.util.stream.ForEachOps$ForEachOp.evaluateSequential(ForEachOps.java:150)
java.base@11.0.15/java.util.stream.ForEachOps$ForEachOp$OfRef.evaluateSequential(ForEachOps.java:173)
java.base@11.0.15/java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)
java.base@11.0.15/java.util.stream.ReferencePipeline.forEach(ReferencePipeline.java:497)
org.hibernate.query.spi.StreamDecorator.forEach(StreamDecorator.java:153)
org.keycloak.utils.ClosingStream.forEach(ClosingStream.java:128)
org.keycloak.migration.migrators.MigrateTo4_0_0.migrate(MigrateTo4_0_0.java:51)
org.keycloak.migration.MigrationModelManager.migrate(MigrationModelManager.java:119)
org.keycloak.quarkus.runtime.storage.database.jpa.QuarkusJpaConnectionProviderFactory.migrateModel(QuarkusJpaConnectionProviderFactory.java:316)
org.keycloak.quarkus.runtime.storage.database.jpa.QuarkusJpaConnectionProviderFactory.initSchema(QuarkusJpaConnectionProviderFactory.java:241)
org.keycloak.quarkus.runtime.storage.database.jpa.QuarkusJpaConnectionProviderFactory$$Lambda$845/0x0000000840a97c40.run(Unknown Source)
org.keycloak.models.utils.KeycloakModelUtils.runJobInTransaction(KeycloakModelUtils.java:242)
org.keycloak.quarkus.runtime.storage.database.jpa.QuarkusJpaConnectionProviderFactory.postInit(QuarkusJpaConnectionProviderFactory.java:162)
org.keycloak.quarkus.runtime.integration.QuarkusKeycloakSessionFactory.init(QuarkusKeycloakSessionFactory.java:96)
org.keycloak.quarkus.runtime.integration.jaxrs.QuarkusKeycloakApplication.initializeKeycloakSessionFactory(QuarkusKeycloakApplication.java:68)
org.keycloak.quarkus.runtime.integration.jaxrs.QuarkusKeycloakApplication.startup(QuarkusKeycloakApplication.java:49)
org.keycloak.services.resources.KeycloakApplication$$Lambda$192/0x00000008402c5040.run(Unknown Source)
org.keycloak.quarkus.runtime.integration.QuarkusLifecycleObserver.onStartupEvent(QuarkusLifecycleObserver.java:37)
org.keycloak.quarkus.runtime.integration.QuarkusLifecycleObserver_Observer_onStartupEvent_b0e82415b143738dc1f986a5fa4668e83d0a5dea.notify(Unknown Source)
io.quarkus.arc.impl.EventImpl$Notifier.notifyObservers(EventImpl.java:320)
io.quarkus.arc.impl.EventImpl$Notifier.notify(EventImpl.java:302)
io.quarkus.arc.impl.EventImpl.fire(EventImpl.java:73)
io.quarkus.arc.runtime.ArcRecorder.fireLifecycleEvent(ArcRecorder.java:128)
io.quarkus.arc.runtime.ArcRecorder.handleLifecycleEvents(ArcRecorder.java:97)
io.quarkus.deployment.steps.LifecycleEventsBuildStep$startupEvent1144526294.deploy_0(Unknown Source)
io.quarkus.deployment.steps.LifecycleEventsBuildStep$startupEvent1144526294.deploy(Unknown Source)
io.quarkus.runner.ApplicationImpl.doStart(Unknown Source)
io.quarkus.runtime.Application.start(Application.java:101)
io.quarkus.runtime.ApplicationLifecycleManager.run(ApplicationLifecycleManager.java:103)
io.quarkus.runtime.Quarkus.run(Quarkus.java:67)
org.keycloak.quarkus.runtime.KeycloakMain.start(KeycloakMain.java:86)
org.keycloak.quarkus.runtime.cli.command.AbstractStartCommand.run(AbstractStartCommand.java:34)
picocli.CommandLine.executeUserObject(CommandLine.java:1939)
picocli.CommandLine.access$1300(CommandLine.java:145)
picocli.CommandLine$RunLast.executeUserObjectOfLastSubcommandWithSameParent(CommandLine.java:2358)
picocli.CommandLine$RunLast.handle(CommandLine.java:2352)
picocli.CommandLine$RunLast.handle(CommandLine.java:2314)
picocli.CommandLine$AbstractParseResultHandler.execute(CommandLine.java:2179)
picocli.CommandLine$RunLast.execute(CommandLine.java:2316)
picocli.CommandLine.execute(CommandLine.java:2078)
org.keycloak.quarkus.runtime.cli.Picocli.parseAndRun(Picocli.java:88)
org.keycloak.quarkus.runtime.KeycloakMain.main(KeycloakMain.java:77)
java.base@11.0.15/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
java.base@11.0.15/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
java.base@11.0.15/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
java.base@11.0.15/java.lang.reflect.Method.invoke(Method.java:566)
app//io.quarkus.bootstrap.runner.QuarkusEntryPoint.doRun(QuarkusEntryPoint.java:60)
app//io.quarkus.bootstrap.runner.QuarkusEntryPoint.main(QuarkusEntryPoint.java:31)

2022-09-02 13:54:05,377 WARN [com.arjuna.ats.arjuna] (Transaction Reaper Worker 0) ARJUNA012095: Abort of action id 0:ffff0afaa74f:aaf9:631209d1:0 invoked while multiple threads active within it.
2022-09-02 13:54:05,394 WARN [com.arjuna.ats.arjuna] (Transaction Reaper Worker 0) ARJUNA012381: Action id 0:ffff0afaa74f:aaf9:631209d1:0 completed with multiple threads - thread main was in progress with java.base@11.0.15/java.lang.reflect.Field.getBoolean(Field.java:452)
org.hibernate.property.access.spi.GetterFieldImpl.get(GetterFieldImpl.java:53)
org.hibernate.tuple.entity.AbstractEntityTuplizer.getPropertyValues(AbstractEntityTuplizer.java:574)
org.hibernate.tuple.entity.PojoEntityTuplizer.getPropertyValues(PojoEntityTuplizer.java:154)
org.hibernate.persister.entity.AbstractEntityPersister.getPropertyValues(AbstractEntityPersister.java:5260)
org.hibernate.event.internal.DefaultFlushEntityEventListener.getValues(DefaultFlushEntityEventListener.java:206)
org.hibernate.event.internal.DefaultFlushEntityEventListener.onFlushEntity(DefaultFlushEntityEventListener.java:162)
org.hibernate.event.internal.AbstractFlushingEventListener$$Lambda$1068/0x0000000840bb7c40.accept(Unknown Source)
org.hibernate.event.service.internal.EventListenerGroupImpl.fireEventOnEachListener(EventListenerGroupImpl.java:107)
org.hibernate.event.internal.AbstractFlushingEventListener.flushEntities(AbstractFlushingEventListener.java:229)
org.hibernate.event.internal.AbstractFlushingEventListener.flushEverythingToExecutions(AbstractFlushingEventListener.java:93)
org.hibernate.event.internal.DefaultAutoFlushEventListener.onAutoFlush(DefaultAutoFlushEventListener.java:50)
org.hibernate.internal.SessionImpl$$Lambda$846/0x0000000840ab0040.accept(Unknown Source)
org.hibernate.event.service.internal.EventListenerGroupImpl.fireEventOnEachListener(EventListenerGroupImpl.java:107)
org.hibernate.internal.SessionImpl.autoFlushIfRequired(SessionImpl.java:1367)
org.hibernate.internal.SessionImpl.scroll(SessionImpl.java:1592)
org.hibernate.query.internal.AbstractProducedQuery.doScroll(AbstractProducedQuery.java:1588)
org.hibernate.query.internal.AbstractProducedQuery.scroll(AbstractProducedQuery.java:1574)
org.hibernate.query.internal.AbstractProducedQuery.stream(AbstractProducedQuery.java:1598)
org.hibernate.query.Query.getResultStream(Query.java:1140)
org.keycloak.models.jpa.JpaRealmProvider.getRolesStream(JpaRealmProvider.java:334)
org.keycloak.models.jpa.JpaRealmProvider.getClientRolesStream(JpaRealmProvider.java:330)
org.keycloak.storage.RoleStorageManager.getClientRolesStream(RoleStorageManager.java:222)
org.keycloak.models.cache.infinispan.RealmCacheSession.getClientRolesStream(RealmCacheSession.java:711)
org.keycloak.models.jpa.ClientAdapter.getRolesStream(ClientAdapter.java:635)
org.keycloak.models.jpa.ClientAdapter.hasScope(ClientAdapter.java:655)
org.keycloak.models.delegate.ClientModelLazyDelegate.hasScope(ClientModelLazyDelegate.java:564)
org.keycloak.migration.migrators.MigrateTo4_0_0.lambda$migrateRealm$5(MigrateTo4_0_0.java:104)
org.keycloak.migration.migrators.MigrateTo4_0_0$$Lambda$1194/0x0000000840c10040.test(Unknown Source)
java.base@11.0.15/java.util.stream.ReferencePipeline$2$1.accept(ReferencePipeline.java:176)
java.base@11.0.15/java.util.stream.ReferencePipeline$2$1.accept(ReferencePipeline.java:177)
java.base@11.0.15/java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:195)
java.base@11.0.15/java.util.Iterator.forEachRemaining(Iterator.java:133)
java.base@11.0.15/java.util.Spliterators$IteratorSpliterator.forEachRemaining(Spliterators.java:1801)
java.base@11.0.15/java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:484)
java.base@11.0.15/java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:474)
java.base@11.0.15/java.util.stream.ForEachOps$ForEachOp.evaluateSequential(ForEachOps.java:150)
java.base@11.0.15/java.util.stream.ForEachOps$ForEachOp$OfRef.evaluateSequential(ForEachOps.java:173)
java.base@11.0.15/java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)
java.base@11.0.15/java.util.stream.ReferencePipeline.forEach(ReferencePipeline.java:497)
org.hibernate.query.spi.StreamDecorator.forEach(StreamDecorator.java:153)
org.keycloak.utils.ClosingStream.forEach(ClosingStream.java:128)
org.keycloak.migration.migrators.MigrateTo4_0_0.migrateRealm(MigrateTo4_0_0.java:111)
org.keycloak.migration.migrators.MigrateTo4_0_0.lambda$migrate$0(MigrateTo4_0_0.java:51)
org.keycloak.migration.migrators.MigrateTo4_0_0$$Lambda$1076/0x0000000840bb5c40.accept(Unknown Source)
java.base@11.0.15/java.util.stream.ForEachOps$ForEachOp$OfRef.accept(ForEachOps.java:183)
java.base@11.0.15/java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:195)
java.base@11.0.15/java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:195)
java.base@11.0.15/java.util.stream.ReferencePipeline$2$1.accept(ReferencePipeline.java:177)
java.base@11.0.15/java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:195)
java.base@11.0.15/java.util.Iterator.forEachRemaining(Iterator.java:133)
java.base@11.0.15/java.util.Spliterators$IteratorSpliterator.forEachRemaining(Spliterators.java:1801)
java.base@11.0.15/java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:484)
java.base@11.0.15/java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:474)
java.base@11.0.15/java.util.stream.ForEachOps$ForEachOp.evaluateSequential(ForEachOps.java:150)
java.base@11.0.15/java.util.stream.ForEachOps$ForEachOp$OfRef.evaluateSequential(ForEachOps.java:173)
java.base@11.0.15/java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)
java.base@11.0.15/java.util.stream.ReferencePipeline.forEach(ReferencePipeline.java:497)
org.hibernate.query.spi.StreamDecorator.forEach(StreamDecorator.java:153)
org.keycloak.utils.ClosingStream.forEach(ClosingStream.java:128)
org.keycloak.migration.migrators.MigrateTo4_0_0.migrate(MigrateTo4_0_0.java:51)
org.keycloak.migration.MigrationModelManager.migrate(MigrationModelManager.java:119)
org.keycloak.quarkus.runtime.storage.database.jpa.QuarkusJpaConnectionProviderFactory.migrateModel(QuarkusJpaConnectionProviderFactory.java:316)
org.keycloak.quarkus.runtime.storage.database.jpa.QuarkusJpaConnectionProviderFactory.initSchema(QuarkusJpaConnectionProviderFactory.java:241)
org.keycloak.quarkus.runtime.storage.database.jpa.QuarkusJpaConnectionProviderFactory$$Lambda$845/0x0000000840a97c40.run(Unknown Source)
org.keycloak.models.utils.KeycloakModelUtils.runJobInTransaction(KeycloakModelUtils.java:242)
org.keycloak.quarkus.runtime.storage.database.jpa.QuarkusJpaConnectionProviderFactory.postInit(QuarkusJpaConnectionProviderFactory.java:162)
org.keycloak.quarkus.runtime.integration.QuarkusKeycloakSessionFactory.init(QuarkusKeycloakSessionFactory.java:96)
org.keycloak.quarkus.runtime.integration.jaxrs.QuarkusKeycloakApplication.initializeKeycloakSessionFactory(QuarkusKeycloakApplication.java:68)
org.keycloak.quarkus.runtime.integration.jaxrs.QuarkusKeycloakApplication.startup(QuarkusKeycloakApplication.java:49)
org.keycloak.services.resources.KeycloakApplication$$Lambda$192/0x00000008402c5040.run(Unknown Source)
org.keycloak.quarkus.runtime.integration.QuarkusLifecycleObserver.onStartupEvent(QuarkusLifecycleObserver.java:37)
org.keycloak.quarkus.runtime.integration.QuarkusLifecycleObserver_Observer_onStartupEvent_b0e82415b143738dc1f986a5fa4668e83d0a5dea.notify(Unknown Source)
io.quarkus.arc.impl.EventImpl$Notifier.notifyObservers(EventImpl.java:320)
io.quarkus.arc.impl.EventImpl$Notifier.notify(EventImpl.java:302)
io.quarkus.arc.impl.EventImpl.fire(EventImpl.java:73)
io.quarkus.arc.runtime.ArcRecorder.fireLifecycleEvent(ArcRecorder.java:128)
io.quarkus.arc.runtime.ArcRecorder.handleLifecycleEvents(ArcRecorder.java:97)
io.quarkus.deployment.steps.LifecycleEventsBuildStep$startupEvent1144526294.deploy_0(Unknown Source)
io.quarkus.deployment.steps.LifecycleEventsBuildStep$startupEvent1144526294.deploy(Unknown Source)
io.quarkus.runner.ApplicationImpl.doStart(Unknown Source)
io.quarkus.runtime.Application.start(Application.java:101)
io.quarkus.runtime.ApplicationLifecycleManager.run(ApplicationLifecycleManager.java:103)
io.quarkus.runtime.Quarkus.run(Quarkus.java:67)
org.keycloak.quarkus.runtime.KeycloakMain.start(KeycloakMain.java:86)
org.keycloak.quarkus.runtime.cli.command.AbstractStartCommand.run(AbstractStartCommand.java:34)
picocli.CommandLine.executeUserObject(CommandLine.java:1939)
picocli.CommandLine.access$1300(CommandLine.java:145)
picocli.CommandLine$RunLast.executeUserObjectOfLastSubcommandWithSameParent(CommandLine.java:2358)
picocli.CommandLine$RunLast.handle(CommandLine.java:2352)
picocli.CommandLine$RunLast.handle(CommandLine.java:2314)
picocli.CommandLine$AbstractParseResultHandler.execute(CommandLine.java:2179)
picocli.CommandLine$RunLast.execute(CommandLine.java:2316)
picocli.CommandLine.execute(CommandLine.java:2078)
org.keycloak.quarkus.runtime.cli.Picocli.parseAndRun(Picocli.java:88)
org.keycloak.quarkus.runtime.KeycloakMain.main(KeycloakMain.java:77)
java.base@11.0.15/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
java.base@11.0.15/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
java.base@11.0.15/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
java.base@11.0.15/java.lang.reflect.Method.invoke(Method.java:566)
app//io.quarkus.bootstrap.runner.QuarkusEntryPoint.doRun(QuarkusEntryPoint.java:60)
app//io.quarkus.bootstrap.runner.QuarkusEntryPoint.main(QuarkusEntryPoint.java:31)

2022-09-02 13:54:05,395 WARN [com.arjuna.ats.arjuna] (Transaction Reaper Worker 0) ARJUNA012108: CheckedAction::check - atomic action 0:ffff0afaa74f:aaf9:631209d1:0 aborting with 1 threads active!
2022-09-02 13:54:05,398 WARN [io.agroal.pool] (Transaction Reaper Worker 0) Datasource ‘’: JDBC resources leaked: 2 ResultSet(s) and 2 Statement(s)
2022-09-02 13:54:05,408 WARN [org.hibernate.resource.transaction.backend.jta.internal.synchronization.SynchronizationCallbackCoordinatorTrackingImpl] (Transaction Reaper Worker 0) HHH000451: Transaction afterCompletion called by a background thread; delaying afterCompletion processing until the original thread can handle it. [status=4]
2022-09-02 13:54:05,409 WARN [com.arjuna.ats.arjuna] (Transaction Reaper Worker 0) ARJUNA012121: TransactionReaper::doCancellations worker Thread[Transaction Reaper Worker 0,5,main] successfully canceled TX 0:ffff0afaa74f:aaf9:631209d1:0
2022-09-02 13:54:05,431 WARN [org.hibernate.engine.jdbc.spi.SqlExceptionHelper] (main) SQL Error: 0, SQLState: null
2022-09-02 13:54:05,432 ERROR [org.hibernate.engine.jdbc.spi.SqlExceptionHelper] (main) Connection is closed
2022-09-02 13:54:05,453 WARN [com.arjuna.ats.arjuna] (main) ARJUNA012077: Abort called on already aborted atomic action 0:ffff0afaa74f:aaf9:631209d1:0
2022-09-02 13:54:05,634 INFO [org.infinispan.CLUSTER] (main) ISPN000080: Disconnecting JGroups channel ISPN
2022-09-02 13:54:05,789 ERROR [org.keycloak.quarkus.runtime.cli.ExecutionExceptionHandler] (main) ERROR: Failed to start server in (production) mode
2022-09-02 13:54:05,789 ERROR [org.keycloak.quarkus.runtime.cli.ExecutionExceptionHandler] (main) Error details:: org.hibernate.HibernateException: Transaction was rolled back in a different thread!
at org.hibernate.resource.transaction.backend.jta.internal.synchronization.SynchronizationCallbackCoordinatorTrackingImpl.processAnyDelayedAfterCompletion(SynchronizationCallbackCoordinatorTrackingImpl.java:90)
at org.hibernate.internal.SessionImpl.delayedAfterCompletion(SessionImpl.java:636)
at org.hibernate.internal.SessionImpl.scroll(SessionImpl.java:1599)
at org.hibernate.query.internal.AbstractProducedQuery.doScroll(AbstractProducedQuery.java:1588)
at org.hibernate.query.internal.AbstractProducedQuery.scroll(AbstractProducedQuery.java:1574)
at org.hibernate.query.internal.AbstractProducedQuery.stream(AbstractProducedQuery.java:1598)
at org.hibernate.query.Query.getResultStream(Query.java:1140)
at org.keycloak.models.jpa.JpaRealmProvider.getRolesStream(JpaRealmProvider.java:334)
at org.keycloak.models.jpa.JpaRealmProvider.getClientRolesStream(JpaRealmProvider.java:330)
at org.keycloak.storage.RoleStorageManager.getClientRolesStream(RoleStorageManager.java:222)
at org.keycloak.models.cache.infinispan.RealmCacheSession.getClientRolesStream(RealmCacheSession.java:711)
at org.keycloak.models.jpa.ClientAdapter.getRolesStream(ClientAdapter.java:635)
at org.keycloak.models.jpa.ClientAdapter.hasScope(ClientAdapter.java:655)
at org.keycloak.models.delegate.ClientModelLazyDelegate.hasScope(ClientModelLazyDelegate.java:564)
at org.keycloak.migration.migrators.MigrateTo4_0_0.lambda$migrateRealm$5(MigrateTo4_0_0.java:104)
at java.base/java.util.stream.ReferencePipeline$2$1.accept(ReferencePipeline.java:176)
at java.base/java.util.stream.ReferencePipeline$2$1.accept(ReferencePipeline.java:177)
at java.base/java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:195)
at java.base/java.util.Iterator.forEachRemaining(Iterator.java:133)
at java.base/java.util.Spliterators$IteratorSpliterator.forEachRemaining(Spliterators.java:1801)
at java.base/java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:484)
at java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:474)
at java.base/java.util.stream.ForEachOps$ForEachOp.evaluateSequential(ForEachOps.java:150)
at java.base/java.util.stream.ForEachOps$ForEachOp$OfRef.evaluateSequential(ForEachOps.java:173)
at java.base/java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)
at java.base/java.util.stream.ReferencePipeline.forEach(ReferencePipeline.java:497)
at org.hibernate.query.spi.StreamDecorator.forEach(StreamDecorator.java:153)
at org.keycloak.utils.ClosingStream.forEach(ClosingStream.java:128)
at org.keycloak.migration.migrators.MigrateTo4_0_0.migrateRealm(MigrateTo4_0_0.java:111)
at org.keycloak.migration.migrators.MigrateTo4_0_0.lambda$migrate$0(MigrateTo4_0_0.java:51)
at java.base/java.util.stream.ForEachOps$ForEachOp$OfRef.accept(ForEachOps.java:183)
at java.base/java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:195)
at java.base/java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:195)
at java.base/java.util.stream.ReferencePipeline$2$1.accept(ReferencePipeline.java:177)
at java.base/java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:195)
at java.base/java.util.Iterator.forEachRemaining(Iterator.java:133)
at java.base/java.util.Spliterators$IteratorSpliterator.forEachRemaining(Spliterators.java:1801)
at java.base/java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:484)
at java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:474)
at java.base/java.util.stream.ForEachOps$ForEachOp.evaluateSequential(ForEachOps.java:150)
at java.base/java.util.stream.ForEachOps$ForEachOp$OfRef.evaluateSequential(ForEachOps.java:173)
at java.base/java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)
at java.base/java.util.stream.ReferencePipeline.forEach(ReferencePipeline.java:497)
at org.hibernate.query.spi.StreamDecorator.forEach(StreamDecorator.java:153)
at org.keycloak.utils.ClosingStream.forEach(ClosingStream.java:128)
at org.keycloak.migration.migrators.MigrateTo4_0_0.migrate(MigrateTo4_0_0.java:51)
at org.keycloak.migration.MigrationModelManager.migrate(MigrationModelManager.java:119)
at org.keycloak.quarkus.runtime.storage.database.jpa.QuarkusJpaConnectionProviderFactory.migrateModel(QuarkusJpaConnectionProviderFactory.java:316)
at org.keycloak.quarkus.runtime.storage.database.jpa.QuarkusJpaConnectionProviderFactory.initSchema(QuarkusJpaConnectionProviderFactory.java:241)
at org.keycloak.models.utils.KeycloakModelUtils.runJobInTransaction(KeycloakModelUtils.java:242)
at org.keycloak.quarkus.runtime.storage.database.jpa.QuarkusJpaConnectionProviderFactory.postInit(QuarkusJpaConnectionProviderFactory.java:162)
at org.keycloak.quarkus.runtime.integration.QuarkusKeycloakSessionFactory.init(QuarkusKeycloakSessionFactory.java:96)
at org.keycloak.quarkus.runtime.integration.jaxrs.QuarkusKeycloakApplication.initializeKeycloakSessionFactory(QuarkusKeycloakApplication.java:68)
at org.keycloak.quarkus.runtime.integration.jaxrs.QuarkusKeycloakApplication.startup(QuarkusKeycloakApplication.java:49)
at org.keycloak.quarkus.runtime.integration.QuarkusLifecycleObserver.onStartupEvent(QuarkusLifecycleObserver.java:37)
at org.keycloak.quarkus.runtime.integration.QuarkusLifecycleObserver_Observer_onStartupEvent_b0e82415b143738dc1f986a5fa4668e83d0a5dea.notify(Unknown Source)
at io.quarkus.arc.impl.EventImpl$Notifier.notifyObservers(EventImpl.java:320)
at io.quarkus.arc.impl.EventImpl$Notifier.notify(EventImpl.java:302)
at io.quarkus.arc.impl.EventImpl.fire(EventImpl.java:73)
at io.quarkus.arc.runtime.ArcRecorder.fireLifecycleEvent(ArcRecorder.java:128)
at io.quarkus.arc.runtime.ArcRecorder.handleLifecycleEvents(ArcRecorder.java:97)
at io.quarkus.deployment.steps.LifecycleEventsBuildStep$startupEvent1144526294.deploy_0(Unknown Source)
at io.quarkus.deployment.steps.LifecycleEventsBuildStep$startupEvent1144526294.deploy(Unknown Source)
at io.quarkus.runner.ApplicationImpl.doStart(Unknown Source)
at io.quarkus.runtime.Application.start(Application.java:101)
at io.quarkus.runtime.ApplicationLifecycleManager.run(ApplicationLifecycleManager.java:103)
at io.quarkus.runtime.Quarkus.run(Quarkus.java:67)
at org.keycloak.quarkus.runtime.KeycloakMain.start(KeycloakMain.java:86)
at org.keycloak.quarkus.runtime.cli.command.AbstractStartCommand.run(AbstractStartCommand.java:34)
at picocli.CommandLine.executeUserObject(CommandLine.java:1939)
at picocli.CommandLine.access$1300(CommandLine.java:145)
at picocli.CommandLine$RunLast.executeUserObjectOfLastSubcommandWithSameParent(CommandLine.java:2358)
at picocli.CommandLine$RunLast.handle(CommandLine.java:2352)
at picocli.CommandLine$RunLast.handle(CommandLine.java:2314)
at picocli.CommandLine$AbstractParseResultHandler.execute(CommandLine.java:2179)
at picocli.CommandLine$RunLast.execute(CommandLine.java:2316)
at picocli.CommandLine.execute(CommandLine.java:2078)
at org.keycloak.quarkus.runtime.cli.Picocli.parseAndRun(Picocli.java:88)
at org.keycloak.quarkus.runtime.KeycloakMain.main(KeycloakMain.java:77)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:566)
at io.quarkus.bootstrap.runner.QuarkusEntryPoint.doRun(QuarkusEntryPoint.java:60)
at io.quarkus.bootstrap.runner.QuarkusEntryPoint.main(QuarkusEntryPoint.java:31)

I believe that the migration script only works between new major version and previous major version.

I.g: If you are migrating from 15 to 19 you will need to migrate 15 > 16, 16 > 17, 17 > 18, 18 > 19.
Maybe im wrong, hope someone can clarify this better

cheers.

In dev, we tried to upgrade from 3.4.2 to 18.0. it worked perfectly. Only in staging the issue is, guess it is due to huge data we have in staging.

We are checking how it can be done.

Hi Team,

We found that Arjuna timeout error is because of the configuration to close the connection after 5 mins by liquibase. It can be overwritten with the java environment variable “-Dquarkus.transaction-manager.default-transaction-timeout=3600”. Along with this, we added two more configurations for java environment variable to enable the batch size and mention the size number “-Dkeycloak.migration.batch-enabled=true -Dkeycloak.migration.batch-size=1000”.

With the above three parameters added, the upgrade of our keycloak environment from 3.4.2 to 18.0.2 succeeded. It took around 35 mins to complete it.