Page MenuHomePhabricator

[logs-api,jobs-cli] `toolforge jobs logs` has inconsistent ordering
Closed, ResolvedPublicBUG REPORT

Description

Steps to replicate the issue (include links if applicable):

  • Run toolforge jobs logs <job name>
  • Run toolforge jobs logs --follow <job name>

What happens?:

toolforge jobs logs <job name> does not return the logs in time order:

tools.cluebotng-review@tools-bastion-12:~$ toolforge jobs logs migrate-database
2025-08-10T14:24:30+00:00 [migrate-database-445fh] [job] /usr/bin/env: 'python': No such file or directory
2025-08-10T15:06:24+00:00 [migrate-database-4fhfq] [job] Operations to perform:
2025-08-10T14:53:44+00:00 [migrate-database-c76fl] [job] /usr/bin/env: 'python': No such file or directory

However --follow does:

tools.cluebotng-review@tools-bastion-12:~$ toolforge jobs logs --follow migrate-database
2025-08-10T14:24:30+00:00 [migrate-database-445fh] [job] /usr/bin/env: 'python': No such file or directory
2025-08-10T14:53:44+00:00 [migrate-database-c76fl] [job] /usr/bin/env: 'python': No such file or directory
2025-08-10T15:06:24+00:00 [migrate-database-4fhfq] [job] Operations to perform:
^C
Aborted!

What should have happened instead?:
toolforge jobs logs should return the logs in time order, with the oldest entry been shown first and the newest entry being shown last.

This is consistent with the old behaviour (backed by kubectl logs) and filelog.

Without access to specify the LogQL directly (at least to me) this would be expected behaviour.

Event Timeline

Restricted Application added a subscriber: Aklapper. · View Herald Transcript
taavi triaged this task as High priority.Aug 15 2025, 1:10 PM
taavi moved this task from Backlog to Ready to be worked on on the Toolforge board.
dcaro renamed this task from `toolforge jobs logs` has inconsistent ordering to [logs-api,jobs-cli] `toolforge jobs logs` has inconsistent ordering.Nov 13 2025, 3:18 PM
aputhin subscribed.

TODO: double check if it's still reproducible - if it is, we'll work on a fix

group_203_bot_3c0afd0d9fd9529f3b7bc7e69a4a3bce opened https://gitlab.wikimedia.org/repos/cloud/toolforge/toolforge-deploy/-/merge_requests/1262

logs-api: bump to 0.0.24-20260520233418-6d096df8

Raymond_Ndibe moved this task from In review to Done on the tools-platform-team board.