[keycloak-user] Update from 1.8.1 to 1.9.2: Persistent sessions fail to load
Marek Posolda
mposolda at redhat.com
Mon Apr 18 14:45:05 EDT 2016
On 18/04/16 13:44, Martin Ott wrote:
> Hi Marek,
>
> thank you for your quick response. I understand that you don’t support this setup.
> We would also opt for an optional feature to persist non-offline sessions.
>
> I want to suggest two documentation changes to clarify the current situation:
> - Section 4.3: User Sessions: "Keycloak provides implementations for basic in-memory,
> Infinispan, Relational Databases and MongoDB"
> - Section 35.6.6: The third paragraph states: "It's also possible to configure
> Infinispan to persist caches, although that would have impacts on performance.”
I agree with section 4.3. Feel free to create JIRA for it.
But I am not sure for section 35.6.6. You actually have the possibility
to configure infinispan to persist caches, but we're not testing this,
so not expect that setup to be properly supported for migration.
>
> We do not use offline sessions at the moment. But we intend to use them in the future.
>
> Persisted offlline sessions are migrated correctly when Keyloak is upgraded?
yes
Marek
>
> Cheers,
> Martin
>
>> On 18 Apr 2016, at 12:43, Marek Posolda <mposolda at redhat.com> wrote:
>>
>> We don't support (and never tested) the setup, which is using infinispan
>> file-store to store the infinispan user/client sessions by infinispan.
>>
>> Are you using offline sessions? If so, you don't need to configure
>> infinispan store. Keycloak takes care of persisting offline user/client
>> sessions into it's database and restore them automatically to infinispan
>> at next startup. We plan to add support for optionally persist
>> non-offline user/client sessions too to have them "survive" server
>> restart. But it's not yet supported ATM.
>>
>> So for now, I suggest you manually delete the file where are infinispan
>> sessions stored.
>>
>> Marek
>>
>>
>> On 18/04/16 12:32, Martin Ott wrote:
>>> Hi,
>>>
>>> I have an instance of Keycloak 1.8.1 running which is configured to persist the sessions stored in infinispan. I have added this change to the configuration in order to keep sessions in case of a restart of the process or machine.
>>>
>>> Configuration in standalone.xml looks like this:
>>>
>>> <local-cache name="sessions”>
>>> <file-store purge="false"/>
>>> </local-cache>
>>>
>>>
>>> After upgrading the Keycloak instance to version 1.9.2 the console includes the following stacktrace when acessing the sessions in the admin UI. It also cannot load org.keycloak.models.sessions.infinispan.entities.UserSessionEntity:
>>>
>>> — - snip — -
>>> 17:49:07,056 ERROR [org.infinispan.persistence.file.SingleFileStore] (persistence-thread--p9-t1) ISPN000252: Error executing parallel store task: org.infinispan.persistence.spi.PersistenceException: java.io.InvalidClassException: org.keycloak.models.sessions.infinispan.entities.ClientSessionEntity; Module load failed
>>> at org.infinispan.marshall.core.MarshalledEntryImpl.unmarshall(MarshalledEntryImpl.java:116)
>>> at org.infinispan.marshall.core.MarshalledEntryImpl.getValue(MarshalledEntryImpl.java:61)
>>> at org.infinispan.persistence.PersistenceUtil.convert(PersistenceUtil.java:133)
>>> at org.infinispan.persistence.util.PersistenceManagerCloseableSupplier$SupplierCacheLoaderTask.processEntry(PersistenceManagerCloseableSupplier.java:75)
>>> at org.infinispan.persistence.file.SingleFileStore$2.call(SingleFileStore.java:537)
>>> at org.infinispan.persistence.file.SingleFileStore$2.call(SingleFileStore.java:531)
>>> at java.util.concurrent.FutureTask.run(FutureTask.java:266)
>>> at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
>>> at java.util.concurrent.FutureTask.run(FutureTask.java:266)
>>> at org.infinispan.util.concurrent.WithinThreadExecutor.execute(WithinThreadExecutor.java:21)
>>> at java.util.concurrent.ExecutorCompletionService.submit(ExecutorCompletionService.java:181)
>>> at org.infinispan.executors.ExecutorAllCompletionService.submit(ExecutorAllCompletionService.java:31)
>>> at org.infinispan.persistence.file.SingleFileStore.process(SingleFileStore.java:531)
>>> at org.infinispan.persistence.manager.PersistenceManagerImpl.processOnAllStores(PersistenceManagerImpl.java:447)
>>> at org.infinispan.persistence.manager.PersistenceManagerImpl.processOnAllStores(PersistenceManagerImpl.java:432)
>>> at org.infinispan.persistence.util.PersistenceManagerCloseableSupplier.lambda$get$261(PersistenceManagerCloseableSupplier.java:115)
>>> at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
>>> at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
>>> at java.lang.Thread.run(Thread.java:745)
>>> Caused by: java.io.InvalidClassException: org.keycloak.models.sessions.infinispan.entities.ClientSessionEntity; Module load failed
>>> at org.jboss.marshalling.ModularClassResolver.resolveClass(ModularClassResolver.java:104)
>>> at org.jboss.marshalling.river.RiverUnmarshaller.doReadClassDescriptor(RiverUnmarshaller.java:948)
>>> at org.jboss.marshalling.river.RiverUnmarshaller.doReadNewObject(RiverUnmarshaller.java:1255)
>>> at org.jboss.marshalling.river.RiverUnmarshaller.doReadObject(RiverUnmarshaller.java:276)
>>> at org.jboss.marshalling.river.RiverUnmarshaller.doReadObject(RiverUnmarshaller.java:209)
>>> at org.jboss.marshalling.AbstractObjectInput.readObject(AbstractObjectInput.java:41)
>>> at org.infinispan.commons.marshall.jboss.AbstractJBossMarshaller.objectFromObjectStream(AbstractJBossMarshaller.java:134)
>>> at org.infinispan.marshall.core.VersionAwareMarshaller.objectFromByteBuffer(VersionAwareMarshaller.java:101)
>>> at org.infinispan.commons.marshall.AbstractDelegatingMarshaller.objectFromByteBuffer(AbstractDelegatingMarshaller.java:80)
>>> at org.infinispan.marshall.core.MarshalledEntryImpl.unmarshall(MarshalledEntryImpl.java:114)
>>> ... 18 more
>>> Caused by: org.jboss.modules.ModuleNotFoundException: org.keycloak.keycloak-model-sessions-infinispan:main
>>> at org.jboss.modules.ModuleLoader.loadModule(ModuleLoader.java:223)
>>> at org.jboss.marshalling.ModularClassResolver.resolveClass(ModularClassResolver.java:102)
>>> ... 27 more
>>> - - snip - -
>>>
>>> I assume that the sessions cannot be deserialized due to the module reorg in version 1.9. Is this correct? How could the sessions be migrated to 1.9.x?
>>>
>>> Cheers,
>>> Martin
>>>
>>>
>>>
>>>
>>> _______________________________________________
>>> keycloak-user mailing list
>>> keycloak-user at lists.jboss.org
>>> https://lists.jboss.org/mailman/listinfo/keycloak-user
>> _______________________________________________
>> keycloak-user mailing list
>> keycloak-user at lists.jboss.org
>> https://lists.jboss.org/mailman/listinfo/keycloak-user
More information about the keycloak-user
mailing list