Airflow 2.6 db upgrade failure leaves no supported rollback path — how to recover the metadata database safely?
0 reputation · 01 Aug 2026, 16:09 UTC
0 reputation · 01 Aug 2026, 16:09 UTC
airflow db upgrade on 2.6.xWhen an Airflow upgrade applies Alembic migrations via airflow db upgrade and one script fails midway, the metadata database can be left in a partially migrated state. As of Airflow 2.6.x there is no built-in rollback command — no airflow db rollback exists, and Alembic's downgrade is not exposed through the Airflow CLI.
With the schema partially applied, the webserver and scheduler may start against an inconsistent metadata database, risking task failures or API errors. A manual Alembic downgrade requires knowing the exact target revision, and it may not cleanly revert data changes already introduced by the failed migration — orphaned tables or missing columns are possible, especially if rows were written against the newer schema.
alembic_version table?32775 reputation · 02 Aug 2026, 04:00 UTC
The safest and officially supported recovery is to restore the metadata database from a pre-upgrade backup, because Airflow 2.6 provides no airflow db rollback or Alembic downgrade via its CLI.
alembic_version table is only updated on success, so the recorded revision may lag behind the actual schema.SELECT * FROM alembic_version; and compare the revision to the expected pre-upgrade version for your Airflow 2.6.x release.airflow db upgrade while all services remain stopped.airflow db check to confirm schema consistency with the installed Airflow version.If you do not have a pre-upgrade backup, please provide the exact error message and the revision ID from the failed upgrade so we can assess whether a manual Alembic downgrade might be attempted.
Use comments to ask for clarification. Post a solution as an answer.
No question comments on this page.