Skip to content

Error when adding or removing a user from an organisation when there are 2 or more Keycloak servers in a cluster #33777

@magoogli

Description

@magoogli

Before reporting an issue

  • I have read and understood the above terms for submitting issues, and I understand that my issue may be closed without action if I do not follow them.

Area

organizations

Describe the bug

If I add or remove a user from an organization I am getting the error below - note that this only occurs in a cluster where there is more than 1 server:

Caused by: java.lang.ClassCastException: class org.keycloak.models.cache.infinispan.events.CacheKeyInvalidatedEvent cannot be cast to class org.keycloak.models.cache.infinispan.events.UserCacheInvalidationEvent (org.keycloak.models.cache.infinispan.events.CacheKeyInvalidatedEvent and org.keycloak.models.cache.infinispan.events.UserCacheInvalidationEvent are in unnamed module of loader io.quarkus.bootstrap.runner.RunnerClassLoader @7e6cbb7a)

Version

26.0.0

Regression

  • The issue is a regression

Expected behavior

I would expect to add and remove a user from an organization without errors occuring.

Actual behavior

When I add or remove a user from an organization an error occurs - although the user does actually seem to be added / removed, leading me to believe it has something to do with the caching rather than the actual mechanics of adding or removing the user.

How to Reproduce?

Run a 2 Keycloak server cluster. I am using kubernetes and the codecentric/keycloakx helm chart found here https://codecentric.github.io/helm-charts.

Create a realm and enable organizations.
Add an organization to the realm
Add a test user
Add the user to the organization

Anything else?

No response

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions