apache / airflow

Apache Airflow - A platform to programmatically author, schedule, and monitor workflows
https://airflow.apache.org/
Apache License 2.0
37.26k stars 14.33k forks source link

Failed to clear task instances in "List Task Instance Page" #44274

Open helenyi-stripe opened 11 hours ago

helenyi-stripe commented 11 hours ago

Apache Airflow version

Other Airflow 2 version (please specify below)

If "Other Airflow 2 version" selected, which one?

2.8.4

What happened?

I am trying to bulk clear a list of task instances returned by taskinstance/list page.

However, the clearing was not successful due to the following error

Failed to clear task instances: "'NoneType' object has no attribute 'partial_subset'"

I think the issue was some of the task instances returned in that page (along with their associated dags) no longer exist. Therefore, when we try to call partial_subset on these dags (code), the code fails and the exception is caught here this.

The result of this is that the task instances I want to clear and do still exist ended up not getting cleared.

What you think should happen instead?

I think we should add a try catch block in _clear_task_instances here

How to reproduce

You can try to clear a task instance whose dag no longer exist in the List Task Instance UI page.

Operating System

NAME="Ubuntu" VERSION="20.04.6 LTS (Focal Fossa)"

Versions of Apache Airflow Providers

No response

Deployment

Other

Deployment details

No response

Anything else?

No response

Are you willing to submit PR?

Code of Conduct

boring-cyborg[bot] commented 11 hours ago

Thanks for opening your first issue here! Be sure to follow the issue template! If you are willing to raise PR to address this issue please do so, no need to wait for approval.