airflow.exceptions.AirflowException: Cycle detected in DAG. Faulty task
Asked Answered
M

3

13

i am running the airflow pipeline but codes looks seems good but actually i'm getting the airflow.exceptions.AirflowException: Cycle detected in DAG. Faulty task: can u please help to resolve this issue

Monzon answered 17/8, 2017 at 9:51 Comment(0)
M
28

This can happen due to duplicate task_id'a in multiple tasks.

Marianelamariani answered 25/2, 2019 at 10:45 Comment(0)
S
7

Without the code, it's kind of hard to help you. However, this means that you have a loop in your DAG. Generally, thie error happens when one of your task has a downstream task whose own downstream chain includes it again (A calls B calls C calls D calls A again, for example). That's not permitted by Airflow (and DAGs in general).

Staphylo answered 25/8, 2017 at 7:17 Comment(0)
D
0

On top of the two flags mentioned above, this could also be due to a newly added task that has a trigger rule associated to it (maybe even refers an upstream task using .output)

Examples that could lead to airflow.exceptions.AirflowException: Cycle detected in DAG: trigger_rule=TriggerRule.ALL_DONE or TASK_MAP[EMR_SERVERLESS_APP_TASK].output

Dorice answered 9/3, 2023 at 15:57 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.