Keycloak ClearExpiredEvents correlation
=======================================

=== ALL RELEVANT DEADLOCKS ===
2026-09-16T04:02:19+0200 node7 kc.sh[2270408]: 2026-09-16 04:02:19,293 ERROR [org.keycloak.services.scheduled.ScheduledTaskRunner] (Timer-0) Failed to run scheduled task ClearExpiredEvents: jakarta.persistence.PessimisticLockException: JDBC exception executing SQL [(conn=5581019) Deadlock found when trying to get lock; try restarting transaction] [select ee1_0.ID from EVENT_ENTITY ee1_0 where ee1_0.REALM_ID=? and ee1_0.EVENT_TIME<? order by ee1_0.EVENT_TIME limit ? for update skip locked]
2026-09-16T04:02:19+0200 node7 kc.sh[2270408]: Caused by: org.hibernate.exception.LockAcquisitionException: JDBC exception executing SQL [(conn=5581019) Deadlock found when trying to get lock; try restarting transaction] [select ee1_0.ID from EVENT_ENTITY ee1_0 where ee1_0.REALM_ID=? and ee1_0.EVENT_TIME<? order by ee1_0.EVENT_TIME limit ? for update skip locked]
2026-09-16T19:19:11+0200 node7 kc.sh[2270408]: 2026-09-16 19:19:11,344 ERROR [org.keycloak.services.scheduled.ScheduledTaskRunner] (Timer-0) Failed to run scheduled task ClearExpiredEvents: jakarta.persistence.PessimisticLockException: JDBC exception executing SQL [(conn=6513344) Deadlock found when trying to get lock; try restarting transaction] [select ee1_0.ID from EVENT_ENTITY ee1_0 where ee1_0.REALM_ID=? and ee1_0.EVENT_TIME<? order by ee1_0.EVENT_TIME limit ? for update skip locked]
2026-09-16T19:19:11+0200 node7 kc.sh[2270408]: Caused by: org.hibernate.exception.LockAcquisitionException: JDBC exception executing SQL [(conn=6513344) Deadlock found when trying to get lock; try restarting transaction] [select ee1_0.ID from EVENT_ENTITY ee1_0 where ee1_0.REALM_ID=? and ee1_0.EVENT_TIME<? order by ee1_0.EVENT_TIME limit ? for update skip locked]
2026-09-17T06:49:11+0200 node7 kc.sh[2270408]: 2026-09-17 06:49:11,389 ERROR [org.keycloak.services.scheduled.ScheduledTaskRunner] (Timer-0) Failed to run scheduled task ClearExpiredEvents: jakarta.persistence.PessimisticLockException: JDBC exception executing SQL [(conn=4488134) Deadlock found when trying to get lock; try restarting transaction] [select ee1_0.ID from EVENT_ENTITY ee1_0 where ee1_0.REALM_ID=? and ee1_0.EVENT_TIME<? order by ee1_0.EVENT_TIME limit ? for update skip locked]
2026-09-17T06:49:11+0200 node7 kc.sh[2270408]: Caused by: org.hibernate.exception.LockAcquisitionException: JDBC exception executing SQL [(conn=4488134) Deadlock found when trying to get lock; try restarting transaction] [select ee1_0.ID from EVENT_ENTITY ee1_0 where ee1_0.REALM_ID=? and ee1_0.EVENT_TIME<? order by ee1_0.EVENT_TIME limit ? for update skip locked]
2026-09-17T07:04:11+0200 node7 kc.sh[2270408]: 2026-09-17 07:04:11,818 ERROR [org.keycloak.services.scheduled.ScheduledTaskRunner] (Timer-0) Failed to run scheduled task ClearExpiredEvents: jakarta.persistence.PessimisticLockException: JDBC exception executing SQL [(conn=4488134) Deadlock found when trying to get lock; try restarting transaction] [select ee1_0.ID from EVENT_ENTITY ee1_0 where ee1_0.REALM_ID=? and ee1_0.EVENT_TIME<? order by ee1_0.EVENT_TIME limit ? for update skip locked]
2026-09-17T07:04:11+0200 node7 kc.sh[2270408]: Caused by: org.hibernate.exception.LockAcquisitionException: JDBC exception executing SQL [(conn=4488134) Deadlock found when trying to get lock; try restarting transaction] [select ee1_0.ID from EVENT_ENTITY ee1_0 where ee1_0.REALM_ID=? and ee1_0.EVENT_TIME<? order by ee1_0.EVENT_TIME limit ? for update skip locked]
2026-09-17T08:49:11+0200 node7 kc.sh[2270408]: 2026-09-17 08:49:11,498 ERROR [org.keycloak.services.scheduled.ScheduledTaskRunner] (Timer-0) Failed to run scheduled task ClearExpiredEvents: jakarta.persistence.PessimisticLockException: JDBC exception executing SQL [(conn=7261745) Deadlock found when trying to get lock; try restarting transaction] [select ee1_0.ID from EVENT_ENTITY ee1_0 where ee1_0.REALM_ID=? and ee1_0.EVENT_TIME<? order by ee1_0.EVENT_TIME limit ? for update skip locked]
2026-09-17T08:49:11+0200 node7 kc.sh[2270408]: Caused by: org.hibernate.exception.LockAcquisitionException: JDBC exception executing SQL [(conn=7261745) Deadlock found when trying to get lock; try restarting transaction] [select ee1_0.ID from EVENT_ENTITY ee1_0 where ee1_0.REALM_ID=? and ee1_0.EVENT_TIME<? order by ee1_0.EVENT_TIME limit ? for update skip locked]
2026-09-17T13:34:11+0200 node7 kc.sh[2270408]: 2026-09-17 13:34:11,303 ERROR [org.keycloak.services.scheduled.ScheduledTaskRunner] (Timer-0) Failed to run scheduled task ClearExpiredEvents: jakarta.persistence.PessimisticLockException: JDBC exception executing SQL [(conn=7421994) Deadlock found when trying to get lock; try restarting transaction] [select ee1_0.ID from EVENT_ENTITY ee1_0 where ee1_0.REALM_ID=? and ee1_0.EVENT_TIME<? order by ee1_0.EVENT_TIME limit ? for update skip locked]
2026-09-17T13:34:11+0200 node7 kc.sh[2270408]: Caused by: org.hibernate.exception.LockAcquisitionException: JDBC exception executing SQL [(conn=7421994) Deadlock found when trying to get lock; try restarting transaction] [select ee1_0.ID from EVENT_ENTITY ee1_0 where ee1_0.REALM_ID=? and ee1_0.EVENT_TIME<? order by ee1_0.EVENT_TIME limit ? for update skip locked]
2026-09-17T14:19:11+0200 node7 kc.sh[2270408]: 2026-09-17 14:19:11,365 ERROR [org.keycloak.services.scheduled.ScheduledTaskRunner] (Timer-0) Failed to run scheduled task ClearExpiredEvents: jakarta.persistence.PessimisticLockException: JDBC exception executing SQL [(conn=7421994) Deadlock found when trying to get lock; try restarting transaction] [select ee1_0.ID from EVENT_ENTITY ee1_0 where ee1_0.REALM_ID=? and ee1_0.EVENT_TIME<? order by ee1_0.EVENT_TIME limit ? for update skip locked]
2026-09-17T14:19:11+0200 node7 kc.sh[2270408]: Caused by: org.hibernate.exception.LockAcquisitionException: JDBC exception executing SQL [(conn=7421994) Deadlock found when trying to get lock; try restarting transaction] [select ee1_0.ID from EVENT_ENTITY ee1_0 where ee1_0.REALM_ID=? and ee1_0.EVENT_TIME<? order by ee1_0.EVENT_TIME limit ? for update skip locked]
2026-09-17T20:49:11+0200 node7 kc.sh[2270408]: 2026-09-17 20:49:11,466 ERROR [org.keycloak.services.scheduled.ScheduledTaskRunner] (Timer-0) Failed to run scheduled task ClearExpiredEvents: jakarta.persistence.PessimisticLockException: JDBC exception executing SQL [(conn=5756334) Deadlock found when trying to get lock; try restarting transaction] [select ee1_0.ID from EVENT_ENTITY ee1_0 where ee1_0.REALM_ID=? and ee1_0.EVENT_TIME<? order by ee1_0.EVENT_TIME limit ? for update skip locked]
2026-09-17T20:49:11+0200 node7 kc.sh[2270408]: Caused by: org.hibernate.exception.LockAcquisitionException: JDBC exception executing SQL [(conn=5756334) Deadlock found when trying to get lock; try restarting transaction] [select ee1_0.ID from EVENT_ENTITY ee1_0 where ee1_0.REALM_ID=? and ee1_0.EVENT_TIME<? order by ee1_0.EVENT_TIME limit ? for update skip locked]
2026-09-17T21:04:11+0200 node7 kc.sh[2270408]: 2026-09-17 21:04:11,564 ERROR [org.keycloak.services.scheduled.ScheduledTaskRunner] (Timer-0) Failed to run scheduled task ClearExpiredEvents: jakarta.persistence.PessimisticLockException: JDBC exception executing SQL [(conn=5377770) Deadlock found when trying to get lock; try restarting transaction] [select ee1_0.ID from EVENT_ENTITY ee1_0 where ee1_0.REALM_ID=? and ee1_0.EVENT_TIME<? order by ee1_0.EVENT_TIME limit ? for update skip locked]
2026-09-17T21:04:11+0200 node7 kc.sh[2270408]: Caused by: org.hibernate.exception.LockAcquisitionException: JDBC exception executing SQL [(conn=5377770) Deadlock found when trying to get lock; try restarting transaction] [select ee1_0.ID from EVENT_ENTITY ee1_0 where ee1_0.REALM_ID=? and ee1_0.EVENT_TIME<? order by ee1_0.EVENT_TIME limit ? for update skip locked]
2026-09-17T21:34:11+0200 node7 kc.sh[2270408]: 2026-09-17 21:34:11,649 ERROR [org.keycloak.services.scheduled.ScheduledTaskRunner] (Timer-0) Failed to run scheduled task ClearExpiredEvents: jakarta.persistence.PessimisticLockException: JDBC exception executing SQL [(conn=5756334) Deadlock found when trying to get lock; try restarting transaction] [select ee1_0.ID from EVENT_ENTITY ee1_0 where ee1_0.REALM_ID=? and ee1_0.EVENT_TIME<? order by ee1_0.EVENT_TIME limit ? for update skip locked]
2026-09-17T21:34:11+0200 node7 kc.sh[2270408]: Caused by: org.hibernate.exception.LockAcquisitionException: JDBC exception executing SQL [(conn=5756334) Deadlock found when trying to get lock; try restarting transaction] [select ee1_0.ID from EVENT_ENTITY ee1_0 where ee1_0.REALM_ID=? and ee1_0.EVENT_TIME<? order by ee1_0.EVENT_TIME limit ? for update skip locked]
2026-09-17T22:19:11+0200 node7 kc.sh[2270408]: 2026-09-17 22:19:11,362 ERROR [org.keycloak.services.scheduled.ScheduledTaskRunner] (Timer-0) Failed to run scheduled task ClearExpiredEvents: jakarta.persistence.PessimisticLockException: JDBC exception executing SQL [(conn=390646) Deadlock found when trying to get lock; try restarting transaction] [select ee1_0.ID from EVENT_ENTITY ee1_0 where ee1_0.REALM_ID=? and ee1_0.EVENT_TIME<? order by ee1_0.EVENT_TIME limit ? for update skip locked]
2026-09-17T22:19:11+0200 node7 kc.sh[2270408]: Caused by: org.hibernate.exception.LockAcquisitionException: JDBC exception executing SQL [(conn=390646) Deadlock found when trying to get lock; try restarting transaction] [select ee1_0.ID from EVENT_ENTITY ee1_0 where ee1_0.REALM_ID=? and ee1_0.EVENT_TIME<? order by ee1_0.EVENT_TIME limit ? for update skip locked]
2026-09-18T06:19:11+0200 node7 kc.sh[2270408]: 2026-09-18 06:19:11,750 ERROR [org.keycloak.services.scheduled.ScheduledTaskRunner] (Timer-0) Failed to run scheduled task ClearExpiredEvents: jakarta.persistence.PessimisticLockException: JDBC exception executing SQL [(conn=271555) Deadlock found when trying to get lock; try restarting transaction] [select ee1_0.ID from EVENT_ENTITY ee1_0 where ee1_0.REALM_ID=? and ee1_0.EVENT_TIME<? order by ee1_0.EVENT_TIME limit ? for update skip locked]
2026-09-18T06:19:11+0200 node7 kc.sh[2270408]: Caused by: org.hibernate.exception.LockAcquisitionException: JDBC exception executing SQL [(conn=271555) Deadlock found when trying to get lock; try restarting transaction] [select ee1_0.ID from EVENT_ENTITY ee1_0 where ee1_0.REALM_ID=? and ee1_0.EVENT_TIME<? order by ee1_0.EVENT_TIME limit ? for update skip locked]

=== 2026-09-17 14:19 CORRELATION ===
2026-09-17T14:19:11+0200 node7 kc.sh[2270408]: 2026-09-17 14:19:11,364 WARN  [org.mariadb.jdbc.message.server.ErrorPacket] (Timer-0) Error: 1213-40001: Deadlock found when trying to get lock; try restarting transaction
2026-09-17T14:19:11+0200 node7 kc.sh[2270408]: 2026-09-17 14:19:11,365 ERROR [org.keycloak.services.scheduled.ScheduledTaskRunner] (Timer-0) Failed to run scheduled task ClearExpiredEvents: jakarta.persistence.PessimisticLockException: JDBC exception executing SQL [(conn=7421994) Deadlock found when trying to get lock; try restarting transaction] [select ee1_0.ID from EVENT_ENTITY ee1_0 where ee1_0.REALM_ID=? and ee1_0.EVENT_TIME<? order by ee1_0.EVENT_TIME limit ? for update skip locked]
2026-09-17T14:19:11+0200 node7 kc.sh[2270408]:         at org.keycloak.events.jpa.JpaEventStoreProvider.clearExpiredEvents(JpaEventStoreProvider.java:103)
2026-09-17T14:19:11+0200 node7 kc.sh[2270408]:         at org.keycloak.services.scheduled.ClearExpiredEvents.run(ClearExpiredEvents.java:40)
2026-09-17T14:19:11+0200 node7 kc.sh[2270408]: Caused by: org.hibernate.exception.LockAcquisitionException: JDBC exception executing SQL [(conn=7421994) Deadlock found when trying to get lock; try restarting transaction] [select ee1_0.ID from EVENT_ENTITY ee1_0 where ee1_0.REALM_ID=? and ee1_0.EVENT_TIME<? order by ee1_0.EVENT_TIME limit ? for update skip locked]
2026-09-17T14:19:11+0200 node7 kc.sh[2270408]: Caused by: java.sql.SQLTransactionRollbackException: (conn=7421994) Deadlock found when trying to get lock; try restarting transaction
2026-09-17T14:19:17+0200 node7 kc.sh[2270408]: 2026-09-17 14:19:17,585 WARN  [org.mariadb.jdbc.message.server.ErrorPacket] (user-session-purge-expired) Error: 1047-08S01: WSREP has not yet prepared node for application use
2026-09-17T14:19:17+0200 node7 kc.sh[2270408]: 2026-09-17 14:19:17,586 WARN  [org.mariadb.jdbc.message.server.ErrorPacket] (user-session-purge-expired) Error: 1047-08S01: WSREP has not yet prepared node for application use
2026-09-17T14:19:17+0200 node7 kc.sh[2270408]: 2026-09-17 14:19:17,586 WARN  [com.arjuna.ats.jta] (user-session-purge-expired) ARJUNA016045: attempted rollback of < formatId=131077, gtrid_length=35, bqual_length=36, tx_uid=0:ffff0a3e05a1:9efb:6a9fca6e:28c44c3, node_name=quarkus, branch_uid=0:ffff0a3e05a1:9efb:6a9fca6e:28c44c6, subordinatenodename=null, eis_name=0 > (io.agroal.narayana.LocalXAResource@4c00cc2a) failed with exception code XAException.XAER_RMERR: javax.transaction.xa.XAException: Error trying to transactionRollback local transaction: (conn=7986076) WSREP has not yet prepared node for application use
2026-09-17T14:19:17+0200 node7 kc.sh[2270408]: Caused by: java.sql.SQLNonTransientConnectionException: (conn=7986076) WSREP has not yet prepared node for application use
2026-09-17T14:19:17+0200 node7 kc.sh[2270408]: 2026-09-17 14:19:17,589 ERROR [org.keycloak.models.sessions.infinispan.expiration.BaseExpirationTask] (user-session-purge-expired) Unexpected error while removing expired entries from database: org.hibernate.exception.JDBCConnectionException: JDBC exception executing SQL [(conn=7986076) WSREP has not yet prepared node for application use] [select puse1_0.USER_SESSION_ID,puse1_0.USER_ID from OFFLINE_USER_SESSION puse1_0 where puse1_0.REALM_ID=? and puse1_0.OFFLINE_FLAG='1' and puse1_0.LAST_SESSION_REFRESH<? limit ?]
2026-09-17T14:19:17+0200 node7 kc.sh[2270408]: Caused by: java.sql.SQLNonTransientConnectionException: (conn=7986076) WSREP has not yet prepared node for application use
2026-09-17T14:19:17+0200 node7 kc.sh[2270408]: 2026-09-17 14:19:17,677 WARN  [org.mariadb.jdbc.message.server.ErrorPacket] (executor-thread-24021) Error: 1047-08S01: WSREP has not yet prepared node for application use
2026-09-17T14:19:17+0200 node7 kc.sh[2270408]: 2026-09-17 14:19:17,677 WARN  [org.mariadb.jdbc.message.server.ErrorPacket] (executor-thread-24021) Error: 1047-08S01: WSREP has not yet prepared node for application use
2026-09-17T14:19:17+0200 node7 kc.sh[2270408]: 2026-09-17 14:19:17,678 WARN  [com.arjuna.ats.jta] (executor-thread-24021) ARJUNA016045: attempted rollback of < formatId=131077, gtrid_length=35, bqual_length=36, tx_uid=0:ffff0a3e05a1:9efb:6a9fca6e:28c44c9, node_name=quarkus, branch_uid=0:ffff0a3e05a1:9efb:6a9fca6e:28c44cc, subordinatenodename=null, eis_name=0 > (io.agroal.narayana.LocalXAResource@33c8e8e2) failed with exception code XAException.XAER_RMERR: javax.transaction.xa.XAException: Error trying to transactionRollback local transaction: (conn=7421994) WSREP has not yet prepared node for application use
2026-09-17T14:19:17+0200 node7 kc.sh[2270408]: Caused by: java.sql.SQLNonTransientConnectionException: (conn=7421994) WSREP has not yet prepared node for application use
2026-09-17T14:19:17+0200 node7 kc.sh[2270408]: Caused by: java.sql.SQLNonTransientConnectionException: (conn=7421994) WSREP has not yet prepared node for application use

=== 2026-09-17 22:19 CORRELATION ===
2026-09-17T22:19:11+0200 node7 kc.sh[2270408]: 2026-09-17 22:19:11,361 WARN  [org.mariadb.jdbc.message.server.ErrorPacket] (Timer-0) Error: 1213-40001: Deadlock found when trying to get lock; try restarting transaction
2026-09-17T22:19:11+0200 node7 kc.sh[2270408]: 2026-09-17 22:19:11,362 ERROR [org.keycloak.services.scheduled.ScheduledTaskRunner] (Timer-0) Failed to run scheduled task ClearExpiredEvents: jakarta.persistence.PessimisticLockException: JDBC exception executing SQL [(conn=390646) Deadlock found when trying to get lock; try restarting transaction] [select ee1_0.ID from EVENT_ENTITY ee1_0 where ee1_0.REALM_ID=? and ee1_0.EVENT_TIME<? order by ee1_0.EVENT_TIME limit ? for update skip locked]
2026-09-17T22:19:11+0200 node7 kc.sh[2270408]:         at org.keycloak.events.jpa.JpaEventStoreProvider.clearExpiredEvents(JpaEventStoreProvider.java:103)
2026-09-17T22:19:11+0200 node7 kc.sh[2270408]:         at org.keycloak.services.scheduled.ClearExpiredEvents.run(ClearExpiredEvents.java:40)
2026-09-17T22:19:11+0200 node7 kc.sh[2270408]: Caused by: org.hibernate.exception.LockAcquisitionException: JDBC exception executing SQL [(conn=390646) Deadlock found when trying to get lock; try restarting transaction] [select ee1_0.ID from EVENT_ENTITY ee1_0 where ee1_0.REALM_ID=? and ee1_0.EVENT_TIME<? order by ee1_0.EVENT_TIME limit ? for update skip locked]
2026-09-17T22:19:11+0200 node7 kc.sh[2270408]: Caused by: java.sql.SQLTransactionRollbackException: (conn=390646) Deadlock found when trying to get lock; try restarting transaction
2026-09-17T22:19:17+0200 node7 kc.sh[2270408]: 2026-09-17 22:19:17,323 WARN  [org.mariadb.jdbc.message.server.ErrorPacket] (executor-thread-25061) Error: 1047-08S01: WSREP has not yet prepared node for application use
2026-09-17T22:19:17+0200 node7 kc.sh[2270408]: 2026-09-17 22:19:17,324 WARN  [org.mariadb.jdbc.message.server.ErrorPacket] (executor-thread-25061) Error: 1047-08S01: WSREP has not yet prepared node for application use
2026-09-17T22:19:17+0200 node7 kc.sh[2270408]: 2026-09-17 22:19:17,324 WARN  [com.arjuna.ats.jta] (executor-thread-25061) ARJUNA016045: attempted rollback of < formatId=131077, gtrid_length=35, bqual_length=36, tx_uid=0:ffff0a3e05a1:9efb:6a9fca6e:2a1b38d, node_name=quarkus, branch_uid=0:ffff0a3e05a1:9efb:6a9fca6e:2a1b390, subordinatenodename=null, eis_name=0 > (io.agroal.narayana.LocalXAResource@2db8a835) failed with exception code XAException.XAER_RMERR: javax.transaction.xa.XAException: Error trying to transactionRollback local transaction: (conn=509100) WSREP has not yet prepared node for application use
2026-09-17T22:19:17+0200 node7 kc.sh[2270408]: Caused by: java.sql.SQLNonTransientConnectionException: (conn=509100) WSREP has not yet prepared node for application use
2026-09-17T22:19:17+0200 node7 kc.sh[2270408]: 2026-09-17 22:19:17,325 WARN  [org.mariadb.jdbc.message.server.ErrorPacket] (executor-thread-25061) Error: 1047-08S01: WSREP has not yet prepared node for application use
2026-09-17T22:19:17+0200 node7 kc.sh[2270408]: 2026-09-17 22:19:17,325 WARN  [com.arjuna.ats.jta] (executor-thread-25061) ARJUNA016045: attempted rollback of < formatId=131077, gtrid_length=35, bqual_length=36, tx_uid=0:ffff0a3e05a1:9efb:6a9fca6e:2a1b393, node_name=quarkus, branch_uid=0:ffff0a3e05a1:9efb:6a9fca6e:2a1b396, subordinatenodename=null, eis_name=0 > (io.agroal.narayana.LocalXAResource@4f4be976) failed with exception code XAException.XAER_RMERR: javax.transaction.xa.XAException: Error trying to transactionRollback local transaction: (conn=390646) WSREP has not yet prepared node for application use
2026-09-17T22:19:17+0200 node7 kc.sh[2270408]: Caused by: java.sql.SQLNonTransientConnectionException: (conn=390646) WSREP has not yet prepared node for application use
2026-09-17T22:19:19+0200 node7 kc.sh[2270408]: 2026-09-17 22:19:19,067 WARN  [org.mariadb.jdbc.message.server.ErrorPacket] (executor-thread-25076) Error: 1047-08S01: WSREP has not yet prepared node for application use
2026-09-17T22:19:19+0200 node7 kc.sh[2270408]: Caused by: java.sql.SQLNonTransientConnectionException: (conn=530256) WSREP has not yet prepared node for application use
2026-09-17T22:19:19+0200 node7 kc.sh[2270408]: 2026-09-17 22:19:19,068 WARN  [org.mariadb.jdbc.message.server.ErrorPacket] (executor-thread-25076) Error: 1047-08S01: WSREP has not yet prepared node for application use
2026-09-17T22:19:19+0200 node7 kc.sh[2270408]: 2026-09-17 22:19:19,069 WARN  [com.arjuna.ats.jta] (executor-thread-25076) ARJUNA016045: attempted rollback of < formatId=131077, gtrid_length=35, bqual_length=36, tx_uid=0:ffff0a3e05a1:9efb:6a9fca6e:2a1b39f, node_name=quarkus, branch_uid=0:ffff0a3e05a1:9efb:6a9fca6e:2a1b3a8, subordinatenodename=null, eis_name=0 > (io.agroal.narayana.LocalXAResource@6126599f) failed with exception code XAException.XAER_RMERR: javax.transaction.xa.XAException: Error trying to transactionRollback local transaction: (conn=530256) WSREP has not yet prepared node for application use
2026-09-17T22:19:19+0200 node7 kc.sh[2270408]: Caused by: java.sql.SQLNonTransientConnectionException: (conn=530256) WSREP has not yet prepared node for application use

=== COUNTEREXAMPLE: 2026-09-18 06:19 ===
2026-09-18T06:19:11+0200 node7 kc.sh[2270408]: 2026-09-18 06:19:11,729 WARN  [org.mariadb.jdbc.message.server.ErrorPacket] (Timer-0) Error: 1213-40001: Deadlock found when trying to get lock; try restarting transaction
2026-09-18T06:19:11+0200 node7 kc.sh[2270408]: 2026-09-18 06:19:11,750 ERROR [org.keycloak.services.scheduled.ScheduledTaskRunner] (Timer-0) Failed to run scheduled task ClearExpiredEvents: jakarta.persistence.PessimisticLockException: JDBC exception executing SQL [(conn=271555) Deadlock found when trying to get lock; try restarting transaction] [select ee1_0.ID from EVENT_ENTITY ee1_0 where ee1_0.REALM_ID=? and ee1_0.EVENT_TIME<? order by ee1_0.EVENT_TIME limit ? for update skip locked]
2026-09-18T06:19:11+0200 node7 kc.sh[2270408]:         at org.keycloak.events.jpa.JpaEventStoreProvider.clearExpiredEvents(JpaEventStoreProvider.java:103)
2026-09-18T06:19:11+0200 node7 kc.sh[2270408]:         at org.keycloak.services.scheduled.ClearExpiredEvents.run(ClearExpiredEvents.java:40)
2026-09-18T06:19:11+0200 node7 kc.sh[2270408]: Caused by: org.hibernate.exception.LockAcquisitionException: JDBC exception executing SQL [(conn=271555) Deadlock found when trying to get lock; try restarting transaction] [select ee1_0.ID from EVENT_ENTITY ee1_0 where ee1_0.REALM_ID=? and ee1_0.EVENT_TIME<? order by ee1_0.EVENT_TIME limit ? for update skip locked]
2026-09-18T06:19:11+0200 node7 kc.sh[2270408]: Caused by: java.sql.SQLTransactionRollbackException: (conn=271555) Deadlock found when trying to get lock; try restarting transaction
