Skip to content

Conversation

@vatsrahul1001
Copy link
Contributor

@vatsrahul1001 vatsrahul1001 commented Jul 7, 2025

This PR fixes an issue where downgrading from 3.0.3rc4 to 3.0.2 was failing

The current downgrade logic treats downgrading to 3.0.0 the same as downgrading below 3.0.0, which is incorrect.

ERROR

[2025-07-07T14:54:25.119+0000] {db.py:1210} INFO - Attempting downgrade to revision 29ce7909c52b
Traceback (most recent call last):
  File "/usr/local/bin/airflow", line 10, in <module>
    sys.exit(main())
             ^^^^^^
  File "/opt/airflow/airflow-core/src/airflow/__main__.py", line 55, in main
    args.func(args)
  File "/opt/airflow/airflow-core/src/airflow/cli/cli_config.py", line 48, in command
    return func(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^
  File "/opt/airflow/airflow-core/src/airflow/utils/cli.py", line 112, in wrapper
    return f(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^
  File "/opt/airflow/airflow-core/src/airflow/utils/providers_configuration_loader.py", line 55, in wrapped_function
    return func(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^
  File "/opt/airflow/airflow-core/src/airflow/cli/commands/db_command.py", line 204, in downgrade
    run_db_downgrade_command(args, db.downgrade, _REVISION_HEADS_MAP)
  File "/opt/airflow/airflow-core/src/airflow/cli/commands/db_command.py", line 179, in run_db_downgrade_command
    command(to_revision=to_revision, from_revision=from_revision, show_sql_only=args.show_sql_only)
  File "/opt/airflow/airflow-core/src/airflow/utils/session.py", line 101, in wrapper
    return func(*args, session=session, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/airflow/airflow-core/src/airflow/utils/db.py", line 1225, in downgrade
    raise AirflowException(
airflow.exceptions.AirflowException: Downgrade to revision less than 3.0.0 requires that `ab_user` table is present. Please add FabDBManager to [core] external_db_managers and run fab migrations before proceeding

^ Add meaningful description above
Read the Pull Request Guidelines for more information.
In case of fundamental code changes, an Airflow Improvement Proposal (AIP) is needed.
In case of a new dependency, check compliance with the ASF 3rd Party License Policy.
In case of backwards incompatible changes please leave a note in a newsfragment file, named {pr_number}.significant.rst or {issue_number}.significant.rst, in airflow-core/newsfragments.

@potiuk
Copy link
Member

potiuk commented Jul 7, 2025

Does it warrant rc5 @kaxil ?

@kaxil
Copy link
Member

kaxil commented Jul 7, 2025

Does it warrant rc5 @kaxil ?

Yes, there is another bug that @pierrejeambrun has found

@potiuk
Copy link
Member

potiuk commented Jul 7, 2025

Does it warrant rc5 @kaxil ?

Yes, there is another bug that @pierrejeambrun has found

Ok. I was just about to run the verification :D.. Will wait.

@vatsrahul1001 vatsrahul1001 requested a review from kaxil July 7, 2025 19:44
Copy link
Member

@jedcunningham jedcunningham left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Took us a bit to find the real culprit - thanks past Jed!

@vatsrahul1001 vatsrahul1001 added the backport-to-v3-1-test Mark PR with this label to backport to v3-1-test branch label Jul 8, 2025
Copy link
Contributor

@ephraimbuddy ephraimbuddy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think it should be 2.10.3 since we have 2.11.0

Copy link
Contributor

@ephraimbuddy ephraimbuddy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My bad. No migration for 2.11.0

@ephraimbuddy ephraimbuddy merged commit d458554 into apache:main Jul 8, 2025
58 checks passed
@ephraimbuddy ephraimbuddy deleted the fix-downgrade branch July 8, 2025 08:09
github-actions bot pushed a commit that referenced this pull request Jul 8, 2025
* fix rollback from airflow3

* use fab for test

* amend

* fix test

* revert condition fix and add shortcut if revisions are same

* updating revision to 2.10.3 in condition

* remove fab from tests
(cherry picked from commit d458554)

Co-authored-by: Rahul Vats <43964496+vatsrahul1001@users.noreply.github.com>
@github-actions
Copy link

github-actions bot commented Jul 8, 2025

Backport successfully created: v3-0-test

Status Branch Result
v3-0-test PR Link

potiuk pushed a commit that referenced this pull request Jul 8, 2025
* fix rollback from airflow3

* use fab for test

* amend

* fix test

* revert condition fix and add shortcut if revisions are same

* updating revision to 2.10.3 in condition

* remove fab from tests
(cherry picked from commit d458554)

Co-authored-by: Rahul Vats <43964496+vatsrahul1001@users.noreply.github.com>
kaxil pushed a commit that referenced this pull request Jul 9, 2025
* fix rollback from airflow3

* use fab for test

* amend

* fix test

* revert condition fix and add shortcut if revisions are same

* updating revision to 2.10.3 in condition

* remove fab from tests
(cherry picked from commit d458554)

Co-authored-by: Rahul Vats <43964496+vatsrahul1001@users.noreply.github.com>
HsiuChuanHsu pushed a commit to HsiuChuanHsu/airflow that referenced this pull request Jul 10, 2025
* fix rollback from airflow3

* use fab for test

* amend

* fix test

* revert condition fix and add shortcut if revisions are same

* updating revision to 2.10.3 in condition

* remove fab from tests
stephen-bracken pushed a commit to stephen-bracken/airflow that referenced this pull request Jul 15, 2025
* fix rollback from airflow3

* use fab for test

* amend

* fix test

* revert condition fix and add shortcut if revisions are same

* updating revision to 2.10.3 in condition

* remove fab from tests
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport-to-v3-1-test Mark PR with this label to backport to v3-1-test branch

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants