-
Notifications
You must be signed in to change notification settings - Fork 16.3k
Fix triggerer errors after Airflow 2 to 3 migration #55884
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
ephraimbuddy
merged 4 commits into
apache:main
from
astronomer:fix-failing-triggers-after-migration
Oct 22, 2025
Merged
Fix triggerer errors after Airflow 2 to 3 migration #55884
ephraimbuddy
merged 4 commits into
apache:main
from
astronomer:fix-failing-triggers-after-migration
Oct 22, 2025
+39
−1
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ashb
reviewed
Sep 19, 2025
Closed
2 tasks
|
We are having exactly the same issue, and it is causing the crash of the scheduler. Any plan to release it soon? |
45b6da9 to
9047086
Compare
ashb
approved these changes
Oct 22, 2025
9047086 to
43bca86
Compare
When upgrading from Airflow 2, existing deferred triggers can reference
TaskInstances without a dag_version_id and DagRuns with conf=None. This
caused errors when the triggerer tried to start those triggers and when
workers consumed ti_run responses.
This change:
1. Skips starting triggers whose TaskInstance lacks dag_version_id, logging
a warning instead of erroring
2. Coerces DagRun.conf from None to {} in the ti_run response for
compatibility with Airflow 2-era data
3. Adds unit tests covering both behaviors
This prevents triggerer crashes and makes deferred tasks resume reliably
after migration.
43bca86 to
fef8897
Compare
kaxil
pushed a commit
that referenced
this pull request
Oct 31, 2025
* Fix triggerer errors after Airflow 2 to 3 migration
When upgrading from Airflow 2, existing deferred triggers can reference
TaskInstances without a dag_version_id and DagRuns with conf=None. This
caused errors when the triggerer tried to start those triggers and when
workers consumed ti_run responses.
This change:
1. Skips starting triggers whose TaskInstance lacks dag_version_id, logging
a warning instead of erroring
2. Coerces DagRun.conf from None to {} in the ti_run response for
compatibility with Airflow 2-era data
3. Adds unit tests covering both behaviors
This prevents triggerer crashes and makes deferred tasks resume reliably
after migration.
* Remove config check as that has been addressed in a different PR
* Add comment on why we added this
* Remove null conf test
(cherry picked from commit 7cec2a7)
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
When upgrading from Airflow 2, existing deferred triggers can reference TaskInstances without a dag_version_id and DagRuns with conf=None. This caused errors when the triggerer tried to start those triggers and when workers consumed ti_run responses.
This change:
This prevents triggerer crashes and makes deferred tasks resume reliably after migration.
closes: #55713
How to test:
set a fernet key e.g:
export AIRFLOW__CORE__FERNET_KEY='8janSoQD86ALy_tnJjR-hcxNweHnUxhfDV61TBntr_4='
in both init.sh and environment_variables.env in airflow source.
AF2 uses init.sh for breeze but environment_variables.env is used in AF3.
Switch to airflow 2:
git switch apache/v2-11-stableAdd this dag with the target time adjusted to maybe 30mins in the future:
start breeze
breeze start-airflow --backend postgres --executor CeleryExecutorTrigger the dag above and stop breeze once the task is deferred.
Switch to Airflow 3:
git switch mainStart breeze:
breeze start-airflow --backend postgres --executor CeleryExecutorSee that when the target time reach, the dag would be successful