Keycloak 24.0.2- Replication issue

59 views
Skip to first unread message

rabee...@gmail.com

unread,
Aug 4, 2024, 3:50:46 AMAug 4
to Keycloak User
Dears,

I'm packaging the whole keycloak in my spring boot application to add some customization to keycloak and deploy it on kubernetes,


When I upgraded keycloak to version 24.0.2 the replication on are no longer working due to the following exception

```
(AbstractInternalProtoStreamMarshaller.java:72) - ISPN000559: Cannot marshall 'class org.infinispan.marshall.protostream.impl.MarshallableUserObject'
java.io.NotSerializableException: org.keycloak.models.sessions.infinispan.changes.ReplaceFunction
at java.base/java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1187)
at java.base/java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:350)
at org.infinispan.commons.marshall.JavaSerializationMarshaller.objectToBuffer(JavaSerializationMarshaller.java:44)
at org.infinispan.commons.marshall.AbstractMarshaller.objectToByteBuffer(AbstractMarshaller.java:70)
at org.infinispan.commons.marshall.AbstractMarshaller.objectToByteBuffer(AbstractMarshaller.java:60)
at org.infinispan.marshall.core.impl.DelegatingUserMarshaller.objectToByteBuffer(DelegatingUserMarshaller.java:58)
at org.infinispan.marshall.protostream.impl.MarshallableUserObject$Marshaller.write(MarshallableUserObject.java:150)
at org.infinispan.marshall.protostream.impl.MarshallableUserObject$Marshaller.write(MarshallableUserObject.java:100)
at org.infinispan.protostream.impl.ProtobufTagMarshallerDelegate.marshall(ProtobufTagMarshallerDelegate.java:27)
at org.infinispan.protostream.WrappedMessage.writeMessage(WrappedMessage.java:301)
at org.infinispan.protostream.WrappedMessage.write(WrappedMessage.java:242)
at org.infinispan.protostream.ProtobufUtil.toWrappedStream(ProtobufUtil.java:162)
at org.infinispan.marshall.protostream.impl.AbstractInternalProtoStreamMarshaller.objectToOutputStream(AbstractInternalProtoStreamMarshaller.java:69)
at org.infinispan.marshall.protostream.impl.AbstractInternalProtoStreamMarshaller.objectToByteBuffer(AbstractInternalProtoStreamMarshaller.java:87)
at org.infinispan.marshall.protostream.impl.AbstractInternalProtoStreamMarshaller.objectToByteBuffer(AbstractInternalProtoStreamMarshaller.java:92)
at org.infinispan.marshall.core.GlobalMarshaller.writeRawUnknown(GlobalMarshaller.java:637)
at org.infinispan.marshall.core.GlobalMarshaller.writeUnknown(GlobalMarshaller.java:626)
at org.infinispan.marshall.core.GlobalMarshaller.writeUnknown(GlobalMarshaller.java:617)
at org.infinispan.marshall.core.GlobalMarshaller.writeNonNullableObject(GlobalMarshaller.java:383)
at org.infinispan.marshall.core.GlobalMarshaller.writeNullableObject(GlobalMarshaller.java:351)
at org.infinispan.marshall.core.BytesObjectOutput.writeObject(BytesObjectOutput.java:26)
at org.infinispan.cache.impl.BiFunctionMapper$Externalizer.writeObject(BiFunctionMapper.java:73)
at org.infinispan.cache.impl.BiFunctionMapper$Externalizer.writeObject(BiFunctionMapper.java:59)
at org.infinispan.marshall.core.GlobalMarshaller.writeInternal(GlobalMarshaller.java:655)
at org.infinispan.marshall.core.GlobalMarshaller.writeNonNullableObject(GlobalMarshaller.java:370)
at org.infinispan.marshall.core.GlobalMarshaller.writeNullableObject(GlobalMarshaller.java:351)
at org.infinispan.marshall.core.BytesObjectOutput.writeObject(BytesObjectOutput.java:26)
at org.infinispan.commands.triangle.SingleKeyBackupWriteCommand.writeTo(SingleKeyBackupWriteCommand.java:129)
```


The infinispan configuration file is as follows:

```
<?xml version="1.0" encoding="UTF-8"?>
<infinispan
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="urn:infinispan:config:13.0 https://infinispan.org/schemas/infinispan-config-13.0.xsd
urn:org:jgroups http://www.jgroups.org/schema/jgroups-4.2.xsd"
xmlns="urn:infinispan:config:13.0"
xmlns:ispn="urn:infinispan:config:13.0">

<jgroups>
<!-- <stack-file name="jgroups" path="${jgroups.configfile:jgroups.xml}"/>-->
<!-- the default-configs/default-jgroups-udp.xml is located in infinispan-core-*.jar-->
<stack-file name="jgroups" path="${env.jgroups_configfile:default-configs/default-jgroups-udp.xml}"/>
</jgroups>

<cache-container name="keycloak">
<serialization marshaller="org.infinispan.commons.marshall.JavaSerializationMarshaller">
<allow-list>
<regex>org.keycloak.models.*</regex>
<regex>org.keycloak.cluster.*</regex>
<regex>org.keycloak.services.*</regex>
<regex>org.keycloak.storage.*</regex>
<regex>org.keycloak.component.*</regex>
<regex>org.keycloak.common.*</regex>
<regex>java.util.*</regex>
</allow-list>
</serialization>
<transport stack="jgroups" lock-timeout="60000"/>

<local-cache name="realms">
<memory>
<object size="10000"/>
</memory>
</local-cache>
<local-cache name="users">
<memory>
<object size="10000"/>
</memory>
</local-cache>
<local-cache name="authorization">
<memory>
<object size="10000"/>
</memory>
</local-cache>
<local-cache name="keys">
<expiration max-idle="3600000"/>
<memory>
<object size="1000"/>
</memory>
</local-cache>
<distributed-cache name="sessions" owners="${env.CACHE_OWNERS_COUNT:2}"/>
<distributed-cache name="authenticationSessions" owners="${env.CACHE_OWNERS_COUNT:2}"/>
<distributed-cache name="offlineSessions" owners="${env.CACHE_OWNERS_COUNT:2}"/>
<distributed-cache name="clientSessions" owners="${env.CACHE_OWNERS_COUNT:2}"/>
<distributed-cache name="offlineClientSessions" owners="${env.CACHE_OWNERS_COUNT:2}"/>
<distributed-cache name="loginFailures" owners="${env.CACHE_OWNERS_COUNT:2}"/>
<distributed-cache name="actionTokens" owners="${env.CACHE_OWNERS_COUNT:2}">
<expiration max-idle="-1" interval="300000"/>
<memory>
<object size="-1"/>
</memory>
</distributed-cache>
<replicated-cache name="work"/>
</cache-container>
</infinispan>
```



Any idea the reason of this issue?


Reply all
Reply to author
Forward
0 new messages