Skip to content

Add missing dag_id filter on DagRun query#62750

Merged
bbovenzi merged 1 commit into
apache:mainfrom
jvstein:fix_task_group_ui_404_from_wrong_dag_id
Mar 6, 2026
Merged

Add missing dag_id filter on DagRun query#62750
bbovenzi merged 1 commit into
apache:mainfrom
jvstein:fix_task_group_ui_404_from_wrong_dag_id

Conversation

@jvstein

@jvstein jvstein commented Mar 3, 2026

Copy link
Copy Markdown
Contributor

We are upgrading an Airflow 2.11.0 system to 3.1.7 and encountered a problem where clicking a Task Group in the grid UI was giving a 404 response in the Task Instance detail pane.

taskgroup_404

I traced it back to a missing dag_id filter when building the list of task instances. The initial query on dag_run happens without a dag_id filter, which is very likely to return a different DAG sharing a similar schedule (e.g. run_id scheduled__2026-02-03T04:00:00+00:00). That DagRun is then subsequently used for later filtering and the relevant downstream logic can't find the task group being used for filtering.

This change adds the dag_id filter when querying and rejects inputs that don't include a valid dag_id to filter when dag_run_id is specified.


Was generative AI tooling used to co-author this PR?
  • Yes (please specify the tool below)

Generated-by: Claude Code (Opus 4.5 model)

@boring-cyborg boring-cyborg Bot added the area:API Airflow's REST/HTTP API label Mar 3, 2026
@jvstein jvstein force-pushed the fix_task_group_ui_404_from_wrong_dag_id branch 2 times, most recently from a951cb7 to aabbb61 Compare March 3, 2026 01:34

@pierrejeambrun pierrejeambrun left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice looking good overall, just one adjustment needed.

@jvstein jvstein force-pushed the fix_task_group_ui_404_from_wrong_dag_id branch from aabbb61 to dab3a45 Compare March 5, 2026 19:46
@jvstein jvstein force-pushed the fix_task_group_ui_404_from_wrong_dag_id branch from dab3a45 to 438d82d Compare March 5, 2026 21:50
@waltervillarreal

Copy link
Copy Markdown

Thank you very much for the quick fix! I'm impressed by how fast this issue was addressed and how quickly the PR was created.

(Apologies if this isn't the standard place for thanks—I'm still getting familiar with the workflow, so please let me know if I should use a different channel next time).

Thanks again for the amazing work!

@bbovenzi bbovenzi merged commit ec75118 into apache:main Mar 6, 2026
128 of 129 checks passed
@jvstein

jvstein commented Mar 6, 2026

Copy link
Copy Markdown
Contributor Author

Thank you very much for the quick fix! I'm impressed by how fast this issue was addressed and how quickly the PR was created.

I just happened to be running into the same problem around the same time as you. Great job documenting the problem on your issue! I had forgotten to look for open issues before just diving into a PR, but yours was very easy to find and confirm all the details on.

dominikhei pushed a commit to dominikhei/airflow that referenced this pull request Mar 11, 2026
@jvstein jvstein deleted the fix_task_group_ui_404_from_wrong_dag_id branch March 23, 2026 21:34
@Enzzo657

Copy link
Copy Markdown

@jvstein Hello, please tell me in which version this problem is fixed. Just yesterday we updated to 3.1.7 from 3.0.0, and some tasks were completed successfully, but this error is still present and the logs cannot be viewed.

@jvstein

jvstein commented May 14, 2026

Copy link
Copy Markdown
Contributor Author

@jvstein Hello, please tell me in which version this problem is fixed. Just yesterday we updated to 3.1.7 from 3.0.0, and some tasks were completed successfully, but this error is still present and the logs cannot be viewed.

If you click on the merged commit to main (ec75118) from the GitHub log and look at the tags at the top it will show you the version of the release. Backports sometimes have a different commit, but that doesn't apply here.

In this case, the fix was first included in 3.2.0.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:API Airflow's REST/HTTP API

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug][Airflow 3 API] TaskGroup UI 404 Not Found due to missing dag_id filter when querying identical run_ids

7 participants