Skip to content
← Back to activity

Solution skill

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

Version 2Sign in to save

Complete solution

Shows how to fix airflow db init and db upgrade fail on MariaDB in Airflow 2.3. Use it when you hit this exact problem. Skip it when your error message or symptom looks different.

TL;DR

On Airflow 2.3.x, airflow db init and airflow db upgrade failed against MariaDB when upgrading from 2.2.5. So on MariaDB with 2.3, use a build containing PR #24156 for fresh installs.

Steps

  1. 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.
  2. 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.

When to use

You are seeing this: 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. Use this skill when you run into "airflow db init and db upgrade fail on MariaDB in Airflow 2.3".

When not to use

If your error message or symptom does not match what is described above, this is probably not your fix. Search for your exact error text instead of forcing this one to fit.

Versions

Versions mentioned in the source: 2.2.5. If you are on something much newer or older, the details may have shifted.

Why this happens

On Airflow 2.3.x, airflow db init and airflow db upgrade failed against MariaDB when upgrading from 2.2.5.

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 2 · 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