Jim Moriarty
Jim Moriarty

Reputation: 301

Can't delete dag from airflow UI after deleting from dag_bag

I deleted dag from airflow dag_bag and corresponding .pyc file as well. When I try to delete the same dag from airflow UI it is showing this error: Dag id MY_DAG_ID is still in DagBag. Remove the DAG file first. The airflow version I am using is 1.10.4 Even after restarting airflow I'm not able to delete from UI. I was using 1.10.3 previously, but I never faced this issue. I was able to delete from UI after deleting from dags folder.

When I click on that dag in UI it is showing : DAG "MY_DAG_ID" seems to be missing.( this is expected as I deleted dag from folder)

Upvotes: 3

Views: 5729

Answers (2)

SergiyKolesnikov
SergiyKolesnikov

Reputation: 7815

Try stopping the scheduler and the webserver and then deleting the DAG from the command line:

airflow delete_dag 'MY_DAG_ID'

Upvotes: 2

SMDC
SMDC

Reputation: 717

I had the same issues after I upgraded to 1.10.6. Here's what I did:

  • Before removing the DAG, make sure no instance is on running, retry status. Then Pause it
  • Delete on UI or using the command airflow delete_dag dag_id
  • Restart the scheduler and webserver
  • Try to execute airflow list_dags to see if it really got deleted.

If it doesn't work, try to upgrade to the latest version.

Upvotes: 2

Related Questions