versions >= 1.10.0:
I have airflow version 1.10.2 and I tried executing airflow delete_dag command but the command throws following error:
bash-4.2# airflow delete_dag dag_id
[2019-03-16 15:37:20,804] {settings.py:174} INFO - settings.configure_orm(): Using pool settings. pool_size=5, pool_recycle=1800, pid=28224
/usr/lib64/python2.7/site-packages/psycopg2/init.py:144: UserWarning: The psycopg2 wheel package will be renamed from release 2.8; in order to keep installing from binary please use "pip install psycopg2-binary" instead. For details see: http://initd.org/psycopg/docs/install.html#binary-install-from-pypi.
""")
This will drop all existing records related to the specified DAG. Proceed? (y/n)y
Traceback (most recent call last):
File "/usr/bin/airflow", line 32, in
args.func(args)
File "/usr/lib/python2.7/site-packages/airflow/utils/cli.py", line 74, in wrapper
return f(*args, **kwargs)
File "/usr/lib/python2.7/site-packages/airflow/bin/cli.py", line 258, in delete_dag
raise AirflowException(err)
airflow.exceptions.AirflowException: Server error
Though I am able to delete through Curl command.
Please let me know if anyone have idea about this command's execution, is this known or I am doing something wrong.
versions <= 1.9.0:
There is not a command to delete a dag, so you need to first delete the dag file, and then delete all the references to the dag_id from the airflow metadata database.
WARNING
You can reset the airflow meta database, you will erase everything, including the dags, but remember that you will also erase the history, pools, variables, etc.
airflow resetdb
and then airflow initdb