Reputation: 707
I write something wrong in my sql_test.py
,and run python sql_test.py
,the error is 'no module named xxx',and in web-ui it shows a red error - Broken DAG.
And then I run airflow list_dags
the same error occurs again .This is strange and I don't know what's happening.
I tried to run airflow delete_dags sql_test
but there is no such id.
How can I :
sql_test
out of list_dags
Upvotes: 2
Views: 4021
Reputation: 184
If you don't want to repair your DAG and ignore it, you can remove the unwanted DAG by specifying the DAG's underlying file in an .airflowignore file.
Upvotes: 1
Reputation: 11597
There's some syntactical mistake in your dag-definition file, resulting in failure in parsing the DAG. When Airflow fails to parse a DAG, several functionalities get broken (like list_dags
in your case)
Of course deleting the problematic dag-definition file would fix it, but that's not a solution. So here's how you can understand what's wrong and fix it
From linux shell, go to Airflow's logs folder
cd $AIRFLOW_HOME/logs/scheduler/latest/
Run tree
command to see directory structure
tree -I "__init__.py|__pycache__|*.pyc"
View the last few lines of the log file of your corresponding broken dag
tail -n 25 /path/to/my/broken-dag.py.log
This will give you the stack-trace that Airflow threw while trying to parse your broken dag file. That would hopefully help you diagnose the problem and patch it.
Once your dag-definition file is fixed
broken dag
message would disappear from UIlist_dags
command would also start workingUpvotes: 2