Repository navigation
Description
Affected module
UI
Describe the bug
Describe the bug
After upgrading OpenMetadata from 1.11.3 → 1.12.3 on MySQL (Google Cloud
SQL), it is impossible to restore the database to a freshly provisioned MySQL
8.0 instance. The restore fails with:
ERROR 3780 (HY000) at line 66: Referencing column 'DEPLOYMENT_ID_' and
referenced column 'ID_' in foreign key constraint 'ACT_FK_BYTEARR_DEPL'
are incompatible.
This blocks a standard and expected operational task: migrating data from one
environment to another (e.g. dev → prod, or upgrading the underlying Cloud SQL
instance).
The failure occurs because:
- The source instance (running since before 1.12.3) was not freshly
provisioned on MySQL 8.0 — its server default charset isutf8/utf8mb3.
The FlowableACT_*tables were therefore created withutf8mb3. - The target instance is a fresh MySQL 8.0 provisioning, whose server
default isutf8mb4. - MySQL 8.0 strictly enforces that FK referencing and referenced columns share
the same charset/collation. On restore, the FK constraintACT_FK_BYTEARR_DEPL
(betweenACT_GE_BYTEARRAY.DEPLOYMENT_ID_andACT_RE_DEPLOYMENT.ID_) is
rejected because the two sides now have mismatched charsets.
The underlying cause is that openmetadata_db is created without an explicit
charset in the init script, so it silently inherits whatever the server default
is. This is inconsistent with airflow_db, which is already created with an
explicit CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci. Any user upgrading
from an older installation on a non-freshly-provisioned MySQL 8.0 instance is
at risk of hitting this.
Note: This is not specific to mysqldump — Google Cloud SQL's native
backup/restore mechanism fails with the same error.
To Reproduce
Steps to Reproduce
-
Have an existing OpenMetadata installation on 1.11.3 running on MySQL,
whereopenmetadata_dbwas created without an explicit charset (standard
init script). The server default charset on this instance isutf8/utf8mb3
(common on Cloud SQL instances upgraded from an earlier MySQL version rather
than freshly provisioned). -
Upgrade OpenMetadata from 1.11.3 → 1.12.3
-
Attempt to migrate/restore the upgraded DB to a freshly provisioned MySQL 8.0
instance running 1.12.3 (e.g. a new Google Cloud SQL instance whose
server default isutf8mb4) -
Observe failure:
ERROR 3780 (HY000) at line 66: Referencing column 'DEPLOYMENT_ID_' and
referenced column 'ID_' in foreign key constraint 'ACT_FK_BYTEARR_DEPL'
are incompatible.
Root: The 1.11.3 instance has ACT_* tables in utf8mb3. The fresh
1.12.3 instance defaults to utf8mb4. MySQL 8.0 strictly rejects the FK
constraint on restore because the charsets don't match.
Note: This also fails via Google Cloud SQL's native backup/restore —
it is not specific to mysqldump.
This also changes what the fix request should be. You should add:
markdown## Additional Ask
The 1.12.x upgrade path should include a migration step that converts any
ACT_* tables still on utf8/utf8mb3 to utf8mb4. Users upgrading from
older installations on non-default-charset MySQL instances have no automated
path to resolve this today.
Expected behavior
Expected Behavior
Upgrading OpenMetadata from 1.11.3 → 1.12.3 on MySQL should not silently
introduce a charset inconsistency that makes standard database operations
(backup/restore, environment migration) impossible.
Specifically:
openmetadata_dbshould be created with an explicitutf8mb4charset
regardless of the server default, consistent with howairflow_dbis
already handled.- The upgrade migration path should detect and convert any
ACT_*tables
still onutf8/utf8mb3toutf8mb4, so that users upgrading from older
installations are not left with a silently broken schema. - A backup taken from a 1.11.3 instance and restored into a fresh 1.12.3
MySQL 8.0 instance should succeed without manual intervention.
OS
MySQL 8.0 (Google Cloud SQL)
Python version
No response
OpenMetadata version
No response
OpenMetadata Ingestion package version
No response
Additional context
No response
Pre-submission checklist
- I searched for duplicate issues.
- I removed credentials, hostnames, emails, and other sensitive data from logs and config.
Activity
Fixes open-metadata#28255: Pin MySQL charset and migrate Flowable tab…