Foreign key constraint is incorrectly formed error when upgrading RH-SSO

Solution Unverified - Updated -

Issue

  • The following exception is thrown when upgrading RH-SSO database schema:

    Caused by: liquibase.exception.DatabaseException: Can't create table `rhsso_ext_test1`.`CLIENT_SCOPE_CLIENT` (errno: 150 "Foreign key constraint is incorrectly formed") [Failed SQL: ALTER TABLE rhsso_ext_test1.CLIENT_SCOPE_CLIENT ADD CONSTRAINT FK_C_CLI_SCOPE_CLIENT FOREIGN KEY (CLIENT_ID) REFERENCES rhsso_ext_test1.CLIENT (ID)]
      at liquibase.executor.jvm.JdbcExecutor$ExecuteStatementCallback.doInStatement(JdbcExecutor.java:309)
      at liquibase.executor.jvm.JdbcExecutor.execute(JdbcExecutor.java:55)
      ...
    Caused by: java.sql.SQLException: Can't create table `rhsso_ext_test1`.`CLIENT_SCOPE_CLIENT` (errno: 150 "Foreign key constraint is incorrectly formed")
      at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:1078)
      at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:4187)
      at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:4119)
      ...
    

Environment

  • Red Hat Single Sign-On (RH-SSO)
    • 7
  • MySQL/MariaDB database

Subscriber exclusive content

A Red Hat subscription provides unlimited access to our knowledgebase of over 48,000 articles and solutions.

Current Customers and Partners

Log in for full access

Log In