<div dir="ltr"><div><div><div><div><div><div>Hi,<br><br></div>We&#39;re running into a bit of a problem when trying to delete users through the API. The error returned is of HTML format with 500 error code:<br>&lt;html&gt;&lt;head&gt;&lt;title&gt;Error&lt;/title&gt;&lt;/head&gt;&lt;body&gt;Internal Server Error&lt;/body&gt;&lt;/html&gt;<br><br></div><div>Please note: <br>- We&#39;re using Infinispan for userSessions, realmCache and userCache. Rest of the data is in MySQL.<br></div><div>- Issue only occurs when Keycloak servers are highly available (2 servers in our case). Works fine when only one server is up. <br></div><div><br></div>Logs reveal that this is possibly a serialization issue related to Infinispan:<br><br>[2015-06-12 04:56:54.0303], ERROR, org.infinispan.interceptors.InvocationContextInterceptor default task-11 - ISPN000136: Execution error: org.infinispan.commons.CacheException: java.lang.RuntimeException: Failure to marshal argument(s)<br>    at org.infinispan.commons.util.Util.rewrapAsCacheException(Util.java:581)<br>    at org.infinispan.remoting.transport.jgroups.CommandAwareRpcDispatcher.invokeRemoteCommand(CommandAwareRpcDispatcher.java:176)<br>    at org.infinispan.remoting.transport.jgroups.JGroupsTransport.invokeRemotely(JGroupsTransport.java:521)<br>    at org.infinispan.remoting.rpc.RpcManagerImpl.invokeRemotely(RpcManagerImpl.java:281)<br>Caused by: java.lang.RuntimeException: Failure to marshal argument(s)<br>    at org.infinispan.remoting.transport.jgroups.CommandAwareRpcDispatcher.marshallCall(CommandAwareRpcDispatcher.java:333)<br>    at org.infinispan.remoting.transport.jgroups.CommandAwareRpcDispatcher.processSingleCall(CommandAwareRpcDispatcher.java:352)<br>    at org.infinispan.remoting.transport.jgroups.CommandAwareRpcDispatcher.invokeRemoteCommand(CommandAwareRpcDispatcher.java:167)<br>    ... 94 more<br>Caused by: org.infinispan.commons.marshall.NotSerializableException: org.keycloak.models.sessions.infinispan.entities.LoginFailureKey<br>Caused by: an exception which occurred:<br>    in object org.keycloak.models.sessions.infinispan.entities.LoginFailureKey@f42bdd72<br>        -&gt; toString = org.keycloak.models.sessions.infinispan.entities.LoginFailureKey@f42bdd72<br>    in object org.infinispan.commands.write.RemoveCommand@914fd0ce<br>        -&gt; toString = RemoveCommand{key=org.keycloak.models.sessions.infinispan.entities.LoginFailureKey@f42bdd72, value=null, flags=null, valueMatcher=MATCH_ALWAYS}<br>    in object org.infinispan.commands.remote.SingleRpcCommand@bfee4c5c<br>        -&gt; toString = SingleRpcCommand{cacheName=&#39;loginFailures&#39;, command=RemoveCommand{key=org.keycloak.models.sessions.infinispan.entities.LoginFailureKey@f42bdd72, value=null, flags=null, valueMatcher=MATCH_ALWAYS}}<br><br></div><br>Also there&#39;s a DEBUG log as follows:<br><br>[2015-06-12 04:56:54.0301], DEBUG, org.infinispan.marshall.core.VersionAwareMarshaller default task-11 - Object is not serializable: java.io.NotSerializableException: org.keycloak.models.sessions.infinispan.entities.LoginFailureKey<br>    at org.jboss.marshalling.river.RiverMarshaller.doWriteObject(RiverMarshaller.java:860)<br>    at org.jboss.marshalling.AbstractObjectOutput.writeObject(AbstractObjectOutput.java:58)<br>    at org.jboss.marshalling.AbstractMarshaller.writeObject(AbstractMarshaller.java:111)<br>    at org.infinispan.marshall.exts.ReplicableCommandExternalizer.writeCommandParameters(ReplicableCommandExternalizer.java:57)<br>    at org.infinispan.marshall.exts.ReplicableCommandExternalizer.writeObject(ReplicableCommandExternalizer.java:42)<br>    at org.infinispan.marshall.exts.ReplicableCommandExternalizer.writeObject(ReplicableCommandExternalizer.java:30)<br>    at org.infinispan.marshall.core.ExternalizerTable$ExternalizerAdapter.writeObject(ExternalizerTable.java:395)<br>    at org.jboss.marshalling.river.RiverMarshaller.doWriteObject(RiverMarshaller.java:138)<br><br><br></div>Our Keycloak HA system works fine except for this issue. Please advise on how tackle this.<br><br><br></div>Regards,<br></div>Lohitha. <br></div>