-
Notifications
You must be signed in to change notification settings - Fork 14.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
UI shows Foreign Key Error when deleting a dag #23206
Comments
See also #22967. |
Does this only happen on Grid view? Not graph or other DAG views? |
@bbovenzi Sorry i didn't test multiple, but based on the traceback I kind of doubt it's specific to the view. It's kind of tricky because it came up in a dag that itself deploys other airflows and runs other dags in them (i.e. a framework, not a test). It was so unwieldly that I've since broken it up in to smaller pieces. I can recreate the monster and see if it it breaks again. I'll dump scheduler, webserver, and postgres logs while I do--should I be on the look out for anything else? |
I ran into this, it's irregular because after I stopped my airflow instance and restarted it, it didn't happen again. Looking at the code, I feel we should add Line 2684 in 7c9852f
So it becomes: tags = relationship('DagTag', cascade='all, delete, delete-orphan', backref=backref('dag')) We have both airflow/airflow/models/dagrun.py Line 160 in 7c9852f
From SQLAlchemy: delete cascade on one-to-many relationships is often combined with delete-orphan cascade, which will emit a DELETE for the related row if the “child” object is deassociated from the parent. The combination of delete and delete-orphan cascade covers both situations where SQLAlchemy has to decide between setting a foreign key column to NULL versus deleting the row entirely. I feel we should add it, but I'm not sure how to test the change since the issue is hard to reproduce cc: @ashb |
Apache Airflow version
2.3.0b1 (pre-release)
What happened
I tried to delete a dag from the grid view, and I saw this instead
Also, here are the database pod logs:
What you think should happen instead
The dag gets deleted, no error
How to reproduce
I'm not sure if I can replicate it, but I'll report back here if I can. So far as I remember the steps were:
Operating System
kubernetes/debian
Versions of Apache Airflow Providers
n/a
Deployment
Official Apache Airflow Helm Chart
Deployment details
Deployed via helm into a microk8s cluster, which was running in a VM, which was deployed by CircleCI.
Anything else
No response
Are you willing to submit PR?
Code of Conduct
The text was updated successfully, but these errors were encountered: