TriggerDagRunOperator
task fails with index out of range exception while trying to reset dag run
#27299
Closed
1 of 2 tasks
Labels
area:core-operators
Operators, Sensors and hooks within Core Airflow
good first issue
kind:bug
This is a clearly a bug
Apache Airflow version
2.4.2
What happened
List index out of range exception is raised when trying to trigger a DAG run of another DAG using the
TriggerDagRunOperator
withreset_dag_run=True
.Note that although the
TriggerDagRunOperator
task fails in the task that is trying to trigger the target DAG, the DAG run is actually cleared and triggered correctly.What you think should happen instead
The DAG run should be cleared since a run at the specifiedexecution_date
exists, or if something else actually is wrong this should probably be logged better so the user understands what's wrong their DAG.After some further testing I noticed that the DAG run is actually cleared and rerun at the specified
execution_date
, so the exception that occurs only causes theTriggerDagRunOperator
task to fail. But I still expect this not to fail since it's actually working.How to reproduce
To reproduce I used the following two DAGs
example-dag.py
trigger-example-dag.py
Steps
From the Airflow UI
example
DAG and let it catchupStarted
timestamp of theexample
DAG run withRUN_ID=scheduled__2022-10-24T00:00:00+00:00
trigger_example
DAGAfter this is done you should be able to see that the
trigger
task intrigger_exampe
fails with the list index out of bounds exception (see stacktrace above). You will also be able to see that theexample
DAG has correctly been rerun at the specifiedexecution_date
(the started timestamp should be different).Operating System
debian 11 bullseye
Versions of Apache Airflow Providers
Deployment
Official Apache Airflow Helm Chart
Deployment details
Using the Apache Airflow Helm Chart
1.6.0
but we have upgraded the airflow version to2.4.2
.Also using self deployed postgres with pgbouncer enabled. The postgres deployment has been working as expected.
Anything else
No response
Are you willing to submit PR?
Code of Conduct
The text was updated successfully, but these errors were encountered: