You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When I'm inspecting a DAG grid, by going to /dag/<dag_id>/grid, and I click on a grid square representing a DAG mapped task, then an XHR call is performed to /api/v1/dags/<dag_id>/dagRuns/<run_id>/taskInstances/<task_id>, which returns a 404 with the following error:
{
"detail": "Task instance is mapped, add the map_index value to the URL",
"status": 404,
"title": "Task instance not found",
"type": "https://airflow.apache.org/docs/apache-airflow/2.10.3/stable-rest-api-ref.html#section/Errors/NotFound"
}
When that happens, the page turns white and empty, with a console error linked to Axios crashing to the 404 response.
However, when performing the exact same behavior when located on URL /dags/<dag_id>/grid?dag_run_id=<run_id>&task_id=<task_id> (for example by refreshing the page after the crash) then no such XHR call is being sent, and the task panel loads just fine.
What you think should happen instead?
I'm guessing that when located on /dags/<dag_id>/grid with no prior query arg, the UI does not "know" that the task is itself composed of mapped tasks, and thus is calling the wrong API path to inspect it.
How to reproduce
Here's a screen recording of the crash.
Screen.Recording.2024-12-04.at.14.50.05.mov
The webserver logs associated with the crash are
x.x.x.x - - [05/Dec/2024:08:58:05 +0000] "GET /api/v1/dags/refine_to_hive_hourly/dagRuns/scheduled__2024-12-05T04:00:00+00:00/taskInstances/refine_hive_dataset.wait_for_gobblin_export/dependencies HTTP/1.1" 404 323 "https://airflow-analytics.wikimedia.org/dags/refine_to_hive_hourly/grid?dag_run_id=scheduled__2024-12-05T04%3A00%3A00%2B00%3A00&task_id=refine_hive_dataset.wait_for_gobblin_export" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:133.0) Gecko/20100101 Firefox/133.0"
x.x.x.x - - [05/Dec/2024:08:58:05 +0000] "GET /api/v1/dags/refine_to_hive_hourly/tasks/refine_hive_dataset.wait_for_gobblin_export HTTP/1.1" 200 1117 "https://airflow-analytics.wikimedia.org/dags/refine_to_hive_hourly/grid?dag_run_id=scheduled__2024-12-05T04%3A00%3A00%2B00%3A00&task_id=refine_hive_dataset.wait_for_gobblin_export" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:133.0) Gecko/20100101 Firefox/133.0"
x.x.x.x - - [05/Dec/2024:08:58:05 +0000] "GET /api/v1/dags/refine_to_hive_hourly/dagRuns/scheduled__2024-12-05T04:00:00+00:00/taskInstances/refine_hive_dataset.wait_for_gobblin_export HTTP/1.1" 404 249 "https://airflow-analytics.wikimedia.org/dags/refine_to_hive_hourly/grid?dag_run_id=scheduled__2024-12-05T04%3A00%3A00%2B00%3A00&task_id=refine_hive_dataset.wait_for_gobblin_export" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:133.0) Gecko/20100101 Firefox/133.0"
x.x.x.x - - [05/Dec/2024:08:58:06 +0000] "GET /object/grid_data?dag_id=refine_to_hive_hourly&num_runs=25 HTTP/1.1" 200 105027 "https://airflow-analytics.wikimedia.org/dags/refine_to_hive_hourly/grid?dag_run_id=scheduled__2024-12-05T04%3A00%3A00%2B00%3A00&task_id=refine_hive_dataset.wait_for_gobblin_export" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:133.0) Gecko/20100101 Firefox/133.0"
x.x.x.x - - [05/Dec/2024:08:58:06 +0000] "GET /api/v1/dags/refine_to_hive_hourly/dagRuns/scheduled__2024-12-05T04:00:00+00:00/taskInstances/refine_hive_dataset.wait_for_gobblin_export/dependencies HTTP/1.1" 404 323 "https://airflow-analytics.wikimedia.org/dags/refine_to_hive_hourly/grid?dag_run_id=scheduled__2024-12-05T04%3A00%3A00%2B00%3A00&task_id=refine_hive_dataset.wait_for_gobblin_export" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:133.0) Gecko/20100101 Firefox/133.0"
x.x.x.x - - [05/Dec/2024:08:58:06 +0000] "GET /api/v1/dags/refine_to_hive_hourly/dagRuns/scheduled__2024-12-05T04:00:00+00:00/taskInstances/refine_hive_dataset.wait_for_gobblin_export HTTP/1.1" 404 249 "https://airflow-analytics.wikimedia.org/dags/refine_to_hive_hourly/grid?dag_run_id=scheduled__2024-12-05T04%3A00%3A00%2B00%3A00&task_id=refine_hive_dataset.wait_for_gobblin_export" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:133.0) Gecko/20100101 Firefox/133.0"
Apache Airflow version
2.10.3
If "Other Airflow 2 version" selected, which one?
No response
What happened?
When I'm inspecting a DAG grid, by going to
/dag/<dag_id>/grid, and I click on a grid square representing a DAG mapped task, then an XHR call is performed to/api/v1/dags/<dag_id>/dagRuns/<run_id>/taskInstances/<task_id>, which returns a 404 with the following error:{ "detail": "Task instance is mapped, add the map_index value to the URL", "status": 404, "title": "Task instance not found", "type": "https://airflow.apache.org/docs/apache-airflow/2.10.3/stable-rest-api-ref.html#section/Errors/NotFound" }When that happens, the page turns white and empty, with a console error linked to Axios crashing to the 404 response.

However, when performing the exact same behavior when located on URL
/dags/<dag_id>/grid?dag_run_id=<run_id>&task_id=<task_id>(for example by refreshing the page after the crash) then no such XHR call is being sent, and the task panel loads just fine.What you think should happen instead?
I'm guessing that when located on
/dags/<dag_id>/gridwith no prior query arg, the UI does not "know" that the task is itself composed of mapped tasks, and thus is calling the wrong API path to inspect it.How to reproduce
Here's a screen recording of the crash.
Screen.Recording.2024-12-04.at.14.50.05.mov
The webserver logs associated with the crash are
Operating System
Debian Bullseye
Versions of Apache Airflow Providers
Deployment
Other
Deployment details
We're seeing this bug with 2 types of deployments:
Anything else?
This bug is reproducible every time. There does not seem to be a random element to ot.
Are you willing to submit PR?
Code of Conduct