Database errors when upgrading to Red Hat build of Keycloak 26.0.X with MariaDB

Solution Verified - Updated -

Issue

After upgrading to Red Hat build of Keycloak 26.X using MariaDB, the following errors are displayed in the logs:

ERROR [org.hibernate.orm.jdbc.batch] (main) HHH100501: Exception executing batch [java.sql.BatchUpdateException: (conn=277330) Socket error], SQL: insert into CLIENT_SCOPE_ATTRIBUTES (VALUE,SCOPE_ID,NAME) values (?,?,?)
WARN  [org.hibernate.engine.jdbc.spi.SqlExceptionHelper] (main) SQL Error: -1, SQLState: 08000
ERROR [org.hibernate.engine.jdbc.spi.SqlExceptionHelper] (main) (conn=277330) Socket error
WARN  [com.arjuna.ats.jta] (main) ARJUNA016045: attempted rollback of < formatId=131077, gtrid_length=35, bqual_length=36, tx_uid=0:ffffc0a80676:b2e5:67d40a1c:7, node_name=quarkus, branch_uid=0:ffffc0a80676:b2e5:67d40a1c:a, subordinatenodename=null, eis_name=0 > (io.agroal.narayana.LocalXAResource@564519de) failed with exception code XAException.XAER_RMERR: javax.transaction.xa.XAException: Error trying to transactionRollback local transaction: (conn=277330) Connection is closed
...
Caused by: java.sql.SQLNonTransientConnectionException: (conn=277330) Connection is closed
    at org.mariadb.jdbc.export.ExceptionFactory.createException(ExceptionFactory.java:300)
    at org.mariadb.jdbc.export.ExceptionFactory.create(ExceptionFactory.java:378)
    at org.mariadb.jdbc.client.impl.StandardClient.checkNotClosed(StandardClient.java:1275)
    at org.mariadb.jdbc.client.impl.StandardClient.sendQuery(StandardClient.java:843)
    at org.mariadb.jdbc.client.impl.StandardClient.execute(StandardClient.java:1015)
    at org.mariadb.jdbc.client.impl.StandardClient.execute(StandardClient.java:873)
    at org.mariadb.jdbc.Connection.rollback(Connection.java:237)
    at io.agroal.pool.ConnectionHandler.transactionRollback(ConnectionHandler.java:359)
    at io.agroal.narayana.LocalXAResource.rollback(LocalXAResource.java:86)
    ... 51 more

Environment

  • Red Hat build of Keycloak
    • 26.0.X

Subscriber exclusive content

A Red Hat subscription provides unlimited access to our knowledgebase, tools, and much more.

Current Customers and Partners

Log in for full access

Log In

New to Red Hat?

Learn more about Red Hat subscriptions

Using a Red Hat product through a public cloud?

How to access this content