josegabrielrivera opened a new issue, #54134: URL: https://github.com/apache/airflow/issues/54134
### Apache Airflow version 3.0.3 ### If "Other Airflow 2 version" selected, which one? _No response_ ### What happened? https://github.com/apache/airflow/pull/47036 included a validation that raises an exception when a clear instance call is made with the dag_run_id defined. The problem comes when you try to do one of the most common re-run scenario using the web UI: Clear Task Instance for future and/or downstream. You can't, because selecting the task automatically adds a dag_run_id to the request if I'm not wrong. The [re-run tasks documentation](https://airflow.apache.org/docs/apache-airflow/stable/core-concepts/dag-run.html#re-run-tasks) says that this is the way to proceed for re-running tasks: > Past - All the instances of the task in the runs before the DAG’s most recent data interval > Future - All the instances of the task in the runs after the DAG’s most recent data interval Now it forces you to clear the dags one by one, instead of let airflow calculate all the necessary tasks to be cleared. ### What you think should happen instead? The moment you click on the Past or Future buttons on the Clear Task Instance dialog, it says "Non Task Instances found.", digging into the network requests, I can see the following error on the endpoint api/v2/dags/my_dag_name/clearTaskInstances: ``` { "detail": "Cannot use include_past or include_future when dag_run_id is provided because logical_date is not applicable." } ``` I would expect to behave as it does on Airflow 2 versions, populating the list with the future/past affected tasks to be able to clear and re-run them. ### How to reproduce Using the [basic DAG from the documentation](https://airflow.apache.org/docs/apache-airflow/stable/core-concepts/dags.html#declaring-a-dag), do a backfill for a few days or wait until you have some runs. 1. Go to the web UI and open the DAG 2. Click on a task from which we want to rerun 3. Click on Clear Task Instance 4. Click on Future or Past (depending if you have future or pasts tasks to be cleared, doesn't matter both generates the same issue) ### Operating System Debian GNU/Linux 12 (bookworm) ### Versions of Apache Airflow Providers _No response_ ### Deployment Docker-Compose ### Deployment details _No response_ ### Anything else? _No response_ ### Are you willing to submit PR? - [ ] Yes I am willing to submit a PR! ### Code of Conduct - [x] I agree to follow this project's [Code of Conduct](https://github.com/apache/airflow/blob/main/CODE_OF_CONDUCT.md) -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
