MySQL regression after upgrade from RHBK 24 to RHBK 26

Solution Verified - Updated -

Issue

  • Startup issues after RHBK upgrade from version 24 to 26 when using MySQL 8 as database.
  • Server logs are printing a liquibase.exception.DatabaseException as follows:

    liquibase.exception.DatabaseException: Table 'TEMP_USER_CONSENT_IDS' already exists [Failed SQL: (1050) CREATE TABLE TEMP_USER_CONSENT_IDS AS SELECT uc.ID FROM wdw_rhbk_dev.USER_CONSENT uc INNER JOIN ( SELECT CLIENT_ID, USER_ID, MAX(LAST_UPDATED_DATE) AS MAX_UPDATED_DATE FROM wdw_rhbk_dev.USER_CONSENT GROUP BY CLIENT_ID, USER_ID HAVING COUNT(*) > 1 ) max_dates ON uc.CLIENT_ID = max_dates.CLIENT_ID AND uc.USER_ID = max_dates.USER_ID AND uc.LAST_UPDATED_DATE = max_dates.MAX_UPDATED_DATE]
    ...
    Caused by: java.sql.SQLSyntaxErrorException: Table 'TEMP_USER_CONSENT_IDS' already exists at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:121) at com.mysql.cj.jdbc.exceptions.SQLExceptionsMapping.translateException(SQLExceptionsMapping.java:122) at com.mysql.cj.jdbc.StatementImpl.executeInternal(StatementImpl.java:770) at com.mysql.cj.jdbc.StatementImpl.execute(StatementImpl.java:653) at io.agroal.pool.wrapper.StatementWrapper.execute(StatementWrapper.java:220) at liquibase.executor.jvm.JdbcExecutor$ExecuteStatementCallback.doInStatement(JdbcExecutor.java:470)
    

Environment

  • Red Hat build of Keycloak (RHBK)
    • 26.0.9 (and prior)
  • MySQL database
    • 8

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