Error while implementing the distribution cache (ispn) in Keycloak Deployment #36380
Replies: 2 comments 19 replies
-
Are you going for a multi-site deployment, or single-site? The blog has some clarifications on which cache settings should be used in either case; perhaps that could help - https://www.keycloak.org/2024/12/storing-sessions-in-kc26.html. If you have an external Infinispan server for a multi-site deployment, you need to use the "cache-remote-store" settings and enable the "multi-site" feature. From the logs, it seems that the Keycloak service does not see the other instances in the cluster (it creates a cluster by itself). This would imply that the Keycloak nodes do not synchronize using the caches. I think it could be normal when using an external Infinispan server, as the Keycloak instances can use that to sync, instead of clustering the embedded Infinispan instances. |
Beta Was this translation helpful? Give feedback.
-
Hi, we switched to keycloak 26.1.0 with jdbc-ping as cache stack. We have 2 instances of keycloak. We are experiencing the same error from times to times:
|
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Description
We are getting below error in our Keycloak deployment, causing failures in transaction operations. Below is the error log for reference:
The issue seems to be related to the OFFLINE_USER_SESSION table and a Hibernate StaleStateException, indicating that batch updates are returning unexpected row counts. We have already reviewed our setup and implemented a distributed cache configuration to support multiple replicas. Below are the details of our environment and configuration:
Environment Details:
Caching Configuration:
We followed the Keycloak documentation for distributed cache (Keycloak Server Caching) and made the following changes:
Keycloak application starting logs:
Issue Summary:
The error appears to be related to the handling of the OFFLINE_USER_SESSION table. Despite implementing distributed caching for multi-replica support
Could you please assist in identifying the root cause of this issue and provide guidance on resolving it? Specifically:
We look forward to your assistance and are happy to provide further details if required.
Thanks.
Beta Was this translation helpful? Give feedback.
All reactions