I have Keycloak 12.0.4 running on 3 nodes in a kubernetes cluster. Whenever I deploy changes the nodes get restarted one by one. All nodes are owners in regards to the Infinispan cache. Everytime that happens all of the offline sessions cannot be found anymore. Imagine the following:
{"error":"invalid_grant","error_description":"Offline user session not found"}
(I've listed step 3 and 4 only to mention that the process of refreshing a token does work!)
Does anyone know why this happens? I'm using a MSSQL database and I can even see the offline user session in the table. I can also see the session when I log into the admin dashboard and check the offline sessions.
I've found this which describes a similar problem but it didn't help either.
The Keycloak documentation mentiones that Keycloak preloads all offline sessions on server startup. I don't have this option disabled.
I've also checked the lifetimes on all tokens and as long as the server doesn't restart, everything works as expected.
Does anyone have an idea on why this could happen?
Thanks in advance!