Skip to content

MySQL: openmetadata_db should be created with explicit utf8mb4 charset to prevent FK incompatibility on upgraded instances #28255

Closed

Description

@AntoineGlacet

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 is utf8/utf8mb3.
    The Flowable ACT_* tables were therefore created with utf8mb3.
  • The target instance is a fresh MySQL 8.0 provisioning, whose server
    default is utf8mb4.
  • MySQL 8.0 strictly enforces that FK referencing and referenced columns share
    the same charset/collation. On restore, the FK constraint ACT_FK_BYTEARR_DEPL
    (between ACT_GE_BYTEARRAY.DEPLOYMENT_ID_ and ACT_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

  1. Have an existing OpenMetadata installation on 1.11.3 running on MySQL,
    where openmetadata_db was created without an explicit charset (standard
    init script). The server default charset on this instance is utf8/utf8mb3
    (common on Cloud SQL instances upgraded from an earlier MySQL version rather
    than freshly provisioned).

  2. Upgrade OpenMetadata from 1.11.3 → 1.12.3

  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 is utf8mb4)

  4. 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_db should be created with an explicit utf8mb4 charset
    regardless of the server default, consistent with how airflow_db is
    already handled.
  • The upgrade migration path should detect and convert any ACT_* tables
    still on utf8/utf8mb3 to utf8mb4, 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

  1. added
    bug
    on May 19, 2026
  2. added theissue type on Aug 26, 2026
  3. added this to Shipping and removed this from Roadmapon Aug 26, 2026
  4. moved this to Release Backlog 🚧 in Shippingon Aug 26, 2026
  5. moved this from Release Backlog 🚧 to Done ✅ in Shippingon Sep 28, 2026
  6. added a commit that references this issue on Sep 28, 2026
    4245609
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    backendbug

    Type

    Projects

    • Status
      Done ✅

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions