Skip to content
Advertisement

Keycloak giving Lock wait timeout exceeded error in case Save Events enable

I am using keycloak as an Identity broker in my project.

Environment setup: Keycloak version 16.1.1 deployed in k8s cluster with replica 2.

Cluster configuration:

JavaScript

In keycloak setup we want to log Login and Logout events so I enabled the Save Events and added Save Types as below

Event config: enter image description here

Now when users login/logout from the application, I am getting below error in logs and the event is not getting saved, I am not getting this error all the time.

Error:

JavaScript

I am not getting this error if I disable Save Events

Advertisement

Answer

The issue was with database which is MariaDB Opensource.

I checked in database with show processlist, I found that to many delete and insert query running on the table EVENT_ENTITY and table size was around 14GB.

I truncated the table EVENT_ENTITY as I don’t required older events. After truncating records all is working as expected.

User contributions licensed under: CC BY-SA
8 People found this is helpful
Advertisement