Skip to content

Conversation

@pierrejeambrun
Copy link
Member

@pierrejeambrun pierrejeambrun commented Jul 8, 2025

closes: #53002

Following: #51592 we are now filtering on the try_number.

Skipped task have a try number of 0 and UI was defaulting to 1, the skipped task couldn't be found and this cause the 404. Before that related PR, we would find the TI, and request to fetch logs with try_number 1 for a Skipped tasks, that would end up in an invalid url, without hostname, which wasn't great either something like this:
Screenshot 2025-07-08 at 13 49 42

Only the Empty Operator had a special case handling:
Screenshot 2025-07-08 at 13 50 36

Now the UI tries to fetch the TaskInstance.try_number, even if this means that try_number is 0 because the TaskInstance.state is 'skipped'. Allow the backend to take 0 as a value. The TI will be found and the log_readerwill then try to read log and return early with a validation check:
Screenshot 2025-07-08 at 13 40 39

This is enough to not make the UI not crash. And display a useful message. That's for core log reader. Other log reader will fail with a simple "Error fetching the logs. Try number {try_number} is invalid." (google cloud logs) or any other check implemented in the provider.

We could probably also do this in the google provider, to give a better message. (Separate PR because it's provider related)

@boring-cyborg boring-cyborg bot added area:API Airflow's REST/HTTP API area:logging area:UI Related to UI/UX. For Frontend Developers. labels Jul 8, 2025
@pierrejeambrun pierrejeambrun added the backport-to-v3-1-test Mark PR with this label to backport to v3-1-test branch label Jul 8, 2025
@kaxil kaxil changed the title Fix log for skipped taks Fix log for skipped tasks Jul 8, 2025
@pierrejeambrun pierrejeambrun merged commit 0d6e417 into apache:main Jul 8, 2025
106 checks passed
@pierrejeambrun pierrejeambrun deleted the fix-logs-for-skipped-tasks branch July 8, 2025 13:04
github-actions bot pushed a commit that referenced this pull request Jul 8, 2025
(cherry picked from commit 0d6e417)

Co-authored-by: Pierre Jeambrun <pierrejbrun@gmail.com>
@github-actions
Copy link

github-actions bot commented Jul 8, 2025

Backport successfully created: v3-0-test

Status Branch Result
v3-0-test PR Link

github-actions bot pushed a commit to aws-mwaa/upstream-to-airflow that referenced this pull request Jul 8, 2025
(cherry picked from commit 0d6e417)

Co-authored-by: Pierre Jeambrun <pierrejbrun@gmail.com>
bbovenzi pushed a commit that referenced this pull request Jul 8, 2025
* [v3-0-test] Fix log for skipped taks (#53024)
(cherry picked from commit 0d6e417)

Co-authored-by: Pierre Jeambrun <pierrejbrun@gmail.com>

* Fix CI

---------

Co-authored-by: Pierre Jeambrun <pierrejbrun@gmail.com>
kaxil pushed a commit that referenced this pull request Jul 9, 2025
* [v3-0-test] Fix log for skipped taks (#53024)
(cherry picked from commit 0d6e417)

Co-authored-by: Pierre Jeambrun <pierrejbrun@gmail.com>

* Fix CI

---------

Co-authored-by: Pierre Jeambrun <pierrejbrun@gmail.com>
HsiuChuanHsu pushed a commit to HsiuChuanHsu/airflow that referenced this pull request Jul 10, 2025
stephen-bracken pushed a commit to stephen-bracken/airflow that referenced this pull request Jul 15, 2025
@jscheffl
Copy link
Contributor

@pierrejeambrun Besides the implementation in case of "skip" just realized that the same yields for "upstream failed" (and are there more states which will not execute a task?). Also in "upstream failed" no logs are produced and showing them presents an error:
image

Cases where logs are also missing:

  • none
  • scheduled
  • queued
  • removed

@pierrejeambrun
Copy link
Member Author

Yes it would be cool to improve that and take all other states into consideration. At least it's not crashing the UI anymore, that could be a nice follow up indeed.

@pierrejeambrun
Copy link
Member Author

I'll create an issue for that for tracking purpose

@pierrejeambrun
Copy link
Member Author

Issue there #53633

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 area:logging area:UI Related to UI/UX. For Frontend Developers. backport-to-v3-1-test Mark PR with this label to backport to v3-1-test branch

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Skipped EmptyOperator task logs are giving 404 error

3 participants