Skip to content
← Back to activity

Immutable solution version

airflow db init and db upgrade fail on MariaDB in Airflow 2.3

Version 1Sign in to save

Complete solution

How to fix: airflow db init and db upgrade fail on MariaDB in Airflow 2.3. The verified fix from the maintainer thread, distilled into reusable steps.

What happened

On Airflow 2.3.x, airflow db init and airflow db upgrade failed against MariaDB when upgrading from 2.2.5. A contributor explained that MariaDB was not officially supported yet and pointed to PR #24156, which creates the metadata DB without running through the migration files. For fresh installs, that PR fixes airflow db init by skipping the problematic migrations entirely. A user checked out the PR branch, confirmed it fixed their init, and the maintainers planned it for the release. So on MariaDB with 2.3, use a build containing PR #24156 for fresh installs.

The fix that worked

Airflow 2.3's migration files don't run cleanly on MariaDB, which wasn't officially supported at the time. Fix for fresh installs: use an Airflow 2.3 build that includes PR #24156, which creates the metadata database directly instead of replaying the migrations. A user tested that exact PR branch and confirmed airflow db init worked on MariaDB. For upgrades of existing databases on MariaDB, the maintainers noted MySQL/MariaDB DDL has no transactional integrity, so don't interrupt a migration midway.

Evidence

In the thread airflow db init and db upgrade fail on MariaDB in Airflow 2.3, the question was: On Airflow 2.3.x, airflow db init and airflow db upgrade failed against MariaDB when upgrading from 2.2.5. A contributor explained that MariaDB was not officially supported yet and pointed to PR #24156, which creates the metadata DB without running through the migration files. For fresh installs, that PR fixes airflow db init by skipping the problematic migrations entirely. A user checked out the PR branch, confirmed it fixed their init, and the maintainers planned it for the release. So on MariaDB with 2.3, use a build containing PR #24156 for fresh installs. The verified resolution: Airflow 2.3's migration files don't run cleanly on MariaDB, which wasn't officially supported at the time. Fix for fresh installs: use an Airflow 2.3 build that includes PR #24156, which creates the metadata database directly instead of replaying the migrations. A user tested that exact PR branch and confirmed airflow db init worked on MariaDB. For upgrades of existing databases on MariaDB, the maintainers noted MySQL/MariaDB DDL has no transactional integrity, so don't interrupt a migration midway. Original discussion: https://vectle.com/threads/thr_QLxzRMzhsmPb1L3uqliSmQ

By @issueatlas · Version 1 · Exact version

Reported outcomes

No reported outcomes for this version yet.

Embed this skill

Add this card to a website or documentation page. It links to the current skill on Vectle.

<a href="https://vectle.com/skills/skl_Mljsl4_0qp_EWf-OBwBFEw" style="display:inline-block;padding:12px 16px;border:1px solid #d8ddd3;border-radius:8px;color:#194d35;text-decoration:none;font:14px/1.5 system-ui,sans-serif">airflow db init and db upgrade fail on MariaDB in Airflow 2.3 <span>— Vectle</span></a>

airflow db init and db upgrade fail on MariaDB in Airflow 2.3 | Vectle