Memcache exception after restart cas 6.3.1 & 6.4.0-RC1

72 views
Skip to first unread message

John Bond

unread,
Feb 4, 2021, 11:00:07 AM2/4/21
to CAS Community

Hello all,

We are currently using memcached to store store tickets using the following configuration

```
cas.ticket.registry.memcached.servers=localhost:11213
cas.ticket.registry.memcached.transcoder=KRYO
```
After a recent upgrade from cas 6.2.7 -> 6.3.1 i noticed that, after cas is restarted, it is unable to de-serialize tickets. 

When using cas 6.3.1 we see the following error

Caused by: java.util.concurrent.ExecutionException: com.esotericsoftware.kryo.KryoException: com.esotericsoftware.kryo.KryoException: Invalid ordinal for enum "org.apereo.cas.validation.ValidationResponseType": 16Caused by: java.util.concurrent.ExecutionException: com.esotericsoftware.kryo.KryoException: com.esotericsoftware.kryo.KryoException: Invalid ordinal for enum "org.apereo.cas.validation.ValidationResponseType": 16

When using cas 6.4.0-RC1 we get a slightly different error:

java.lang.ClassCastException: class org.apereo.cas.authentication.DefaultAuthenticationHandlerExecutionResult cannot be cast to class org.apereo.cas.ticket.Ticket (org.apereo.cas.authentication.DefaultAuthenticationHandlerExecutionResult and org.apereo.cas.ticket.Ticket are in unnamed module of loader org.apache.catalina.loader.ParallelWebappClassLoader @686449f9)

In both cases, a naive look at the error, suggests it related to unpacking the memcache stored value.  This also looks like it may be related to an issue reported early with 6.3.0-RC3 (https://groups.google.com/u/1/g/jasig-cas-user/c/v2VTr1y_X8M/m/_gieSp0lDAAJ).

Its also worth noting that logging out works i.e. cas can delete the memcache value.  Finnaly i tested all the other transcoders and the issues is only present in the KYRO transcoder.  6.3.1 and 6.4.0-RC1 both work fine with the SERIAL, WHALIN and WHALINV1 trancoders

Any guidence or pointers to help troubleshoot this issue would be most welcome.  we also have a test environment to try out any fixes.

The cas-overlay-template we are using is avlible here:
and we are tracking this issues in our own phabricator ticket here:

Misagh Moayyed

unread,
Feb 5, 2021, 12:10:53 PM2/5/21
to CAS Community
Could you reproduce this with a unit test? 

John Bond

unread,
Feb 9, 2021, 10:02:33 AM2/9/21
to cas-...@apereo.org
Hi Misagh,

Thanks for the response however creating a unit test for cas is a bit beyond my capability (have tried before and failed).  however i asked a colleague a bit more familiar with java to take a look at our task and the came back with the following information which may be helpful

"""
from what I see in Kryo src:

 
> /** Registers the class using the lowest, next available integer ID and the {@link Kryo#getDefaultSerializer(Class) default
> * serializer}. If the class is already registered, no change will be made and the existing registration will be returned.
> * Registering a primitive also affects the corresponding primitive wrapper.
> * <p>
> * Because the ID assigned is affected by the IDs registered before it, the order classes are registered is important when
> * using this method. The order must be the same at deserialization as it was for serialization. */
> public Registration register (Class type) {
 
order of registering classes is important to Kryo and the change in registered classes affected that. If you want to use the same state, new registered classes have to be added at the end (or with a specific id)
In general. 

I'd try to reorganize register() methods on kryo - so that new ones are after the old ones. I'm not deep enough to understand the full issue here - but from looking a bit further, exception correlates with the javadoc I posted from the source code.
```

Thanks John

--
- Website: https://apereo.github.io/cas
- Gitter Chatroom: https://gitter.im/apereo/cas
- List Guidelines: https://goo.gl/1VRrw7
- Contributions: https://goo.gl/mh7qDG
---
You received this message because you are subscribed to a topic in the Google Groups "CAS Community" group.
To unsubscribe from this topic, visit https://groups.google.com/a/apereo.org/d/topic/cas-user/MkpgAZZn-Mw/unsubscribe.
To unsubscribe from this group and all its topics, send an email to cas-user+u...@apereo.org.
To view this discussion on the web visit https://groups.google.com/a/apereo.org/d/msgid/cas-user/a7716b2a-4007-4910-99e6-2437c360f37fn%40apereo.org.
Reply all
Reply to author
Forward
0 new messages