TJaniF opened a new issue, #48538:
URL: https://github.com/apache/airflow/issues/48538
### Apache Airflow version
3.0.0
### If "Other Airflow 2 version" selected, which one?
current main
### What happened?
Clearing a previous (successful) run of the following dag from the UI causes
a 409 error in the api-server:
```
from airflow.decorators import dag, task
@dag
def simple_dynamic_task_mapping():
@task
def get_nums():
return [1,2,3] #A
@task
def times_2(num): #B
return num * 2
_get_nums = get_nums()
_times_2 = times_2.expand(num=_get_nums) #D
simple_dynamic_task_mapping()
```
The error is a 409 in the API server, then the scheduler, I think responding
to that:

The scheduler and API server end up fine but the dag run fails without an
error log, the logs stop at filling up dagbag:
```
[2025-03-30, 00:41:25] INFO - DAG bundles loaded: dags-folder:
source="airflow.dag_processing.bundles.manager.DagBundlesManager"
[2025-0[3](http://localhost:28080/dags/simple_dynamic_task_mapping/runs/manual__2025-03-30T00:41:15.805919+00:00_U2AisQsa/tasks/get_nums?try_number=2#3)-30,
00:41:25] INFO - Filling up the DagBag from /files/dags/dtm.py:
source="airflow.models.dagbag.DagBag"
```
This does not happen with a dag that does not contain a dynamic task.
### What you think should happen instead?
The dag should clear and rerun successfully.
### How to reproduce
Run the dag above. Then clear it from the UI and see the error in the
api-server and scheduler.
### Operating System
MacOS
### Versions of Apache Airflow Providers
None
### Deployment
Other
### Deployment details
breeze
### 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]