-
Notifications
You must be signed in to change notification settings - Fork 8k
Labels
area/organizationskind/bugCategorizes a PR related to a bugCategorizes a PR related to a bugpriority/blockerHighest Priority. Has a deadline and it blocks other tasksHighest Priority. Has a deadline and it blocks other tasksrelease/26.5.1release/26.6.0team/core-iam
Milestone
Description
Before reporting an issue
- I have read and understood the above terms for submitting issues, and I understand that my issue may be closed without action if I do not follow them.
Area
organizations
Describe the bug
When upgrading Keycloak from 26.4.7 to 26.5.0 on DB MariaDB 10.11, the following Liquibase exception is thrown blocking the upgrade.
2026-01-08 00:00:58,950 ERROR [org.keycloak.quarkus.runtime.cli.ExecutionExceptionHandler] (main) ERROR: liquibase.exception.LiquibaseException: liquibase.exception.MigrationFailedException: Migration failed for changeset META-INF/jpa-changelog-26.5.0.xml::26.5.0-invitations-table::keycloak:
Reason: liquibase.exception.DatabaseException: (conn=4) Can't create table `keycloak`.`ORG_INVITATION` (errno: 150 "Foreign key constraint is incorrectly formed") [Failed SQL: (1005) ALTER TABLE keycloak.ORG_INVITATION ADD CONSTRAINT FK_ORG_INVITATION_ORG FOREIGN KEY (ORGANIZATION_ID) REFERENCES keycloak.ORG (ID) ON DELETE CASCADE]
ref.
| <addForeignKeyConstraint baseTableName="ORG_INVITATION" |
Version
26.5.0
Regression
- The issue is a regression
Expected behavior
Upgrade not failing
Actual behavior
Failing due to the above issue
How to Reproduce?
Upgrade a Keycloak instance from 26.4.7 to 26.5.0 with DB MariaDB 10.11
Anything else?
Issue comes from the fact that ORG table is not created with UTF8
while ORG_INVITATION is
If the field ORG.ID referenced by foreign key FK_ORG_INVITATION_ORG is fixed to be in UTF8 as all the others
ALTER TABLE `ORG` CHANGE `ID` `ID` VARCHAR(255) CHARACTER SET utf8mb4 NOT NULL;
the constraint can be correctly created
ALTER TABLE keycloak.ORG_INVITATION ADD CONSTRAINT FK_ORG_INVITATION_ORG FOREIGN KEY (ORGANIZATION_ID) REFERENCES keycloak.ORG (ID) ON DELETE CASCADE
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
area/organizationskind/bugCategorizes a PR related to a bugCategorizes a PR related to a bugpriority/blockerHighest Priority. Has a deadline and it blocks other tasksHighest Priority. Has a deadline and it blocks other tasksrelease/26.5.1release/26.6.0team/core-iam