77936[BUGFIX] Output errors to CLI in scheduler:run command
Commit message
Review
-
Code review CR +2 Done
- Benjamin Franzke +2
- Stephan Großberndt +1
- Markus Klein +1
- Christian Kuhn +1
- Christoph Lehmann +1
-
Verified V +2 Done
- Benjamin Franzke +2
- Christian Kuhn +1
- core-ci +1 CI
Issues 1
Files 3
Review log 3639
Show 1214 earlier messages
-
Markus Klein uploaded patch set 1 02/23/23, 12:07
-
core-ci voted on patch set 1 V +1 02/23/23, 12:14 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/38013
-
Thomas Hohn voted on patch set 1 CR +1 02/23/23, 12:16
-
Mathias Brodala commented on patch set 1 02/23/23, 12:22
Could we make these proper error()'s while we're at it? It seemingly doesn't make sense to have errors/exceptions outputted as warnings/plain text. -
Markus Klein commented on patch set 2
CR +1V +102/23/23, 13:03Published edit on patch set 1. -
Markus Klein commented on patch set 2 02/23/23, 13:03
Reply
Done -
Mathias Brodala voted on patch set 2 CR +1 02/23/23, 13:06
-
core-ci voted on patch set 2 V +1 02/23/23, 13:09 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/38018
-
Benni Mack voted on patch set 2 V +1 CR +1 03/06/23, 15:14
-
Stephan Großberndt voted on patch set 2 CR +1 03/21/23, 13:44
-
Benjamin Franzke voted on patch set 2 CR +2 03/21/23, 14:26
-
Benjamin Franzke voted on patch set 2 CR +1 03/21/23, 14:26
-
Benjamin Franzke commented on patch set 2 03/21/23, 14:36
I'd love if we'd also use io->getErrorStyle() (which uses io->getErrorOuput() underneath), in order to send all these message to stderr, instead of stdout. Which is helpful in case someone sends scheduler stdout to /dev/null, so stderr would then still cause error messages to be sent via cronjob-MAITLO or whatever. But that's probably better for a main-only patch(?) -
Markus Klein commented on patch set 2 03/21/23, 14:43
Reply
I'd opt for main-only, yes!
-
Markus Klein voted on patch set 2 V +1 CR +1 03/21/23, 14:44
-
Christian Kuhn commented on patch set 2 03/21/23, 15:09
Reply
so we pick this patch for main & v11, and then have another one for main-only that moved error output to stderr, plus then changes script return to non-zero? that's the plan? -
Oliver Klee voted on patch set 2 CR +1 03/21/23, 15:10
-
Markus Klein commented on patch set 2 03/21/23, 15:14
Reply
Sounds good, to me at least. -
Christian Kuhn commented on patch set 2 03/21/23, 15:36
Reply
ok, last question here from my side: typically, when something is called via cron, *any* output of the command is mailed to the owner of that cron. admins thus often silence cron commands using `whatever-command >/dev/null`, sometimes even `whatever-command >dev/null 2>&1`. when we now add more output to those commands and don't suppress them when 'verbose' is given anymore, this *may* create a lot of emails in a rather short timeframe (scheduler crons are often called every such minute). i'm not worried about v12 here, but the v11 backport: do you really think we should accept this for a v11 bugfix level release? if so, should we maybe go with an important.rst? maybe it's more easy to skip the v11 backport und just be more error-aware with v12 only? -
Markus Klein commented on patch set 2 03/21/23, 15:40
Reply
Well, that's the whole point. Currently you do not get any info, that things went nuts. That's even worse than getting to many mails. Yes, I expect some mails, but that's good. And yes, I desperately need this for v11. ;-) (Btw: hiding error messages behind a verbose-flag is wrong anyways) -
Stephan Großberndt commented on patch set 2 03/21/23, 15:45
I agree to Markus view. They were visible in earlier versions. Hiding the error messages is a "side effect" of https://review.typo3.org/c/Packages/TYPO3.CMS/+/59452 -
Christian Kuhn commented on patch set 2 03/21/23, 16:01
Reply
'desperately need this for v11': you could simply add -vvv if you really need this in v11, couldn't you? not really nice, but would solve your issue in v11. i'm only pushing here to avoid "admin called us, typo3 suddenly pollutes mails with v11 with latest patch level. this is a regression." cases. i totally agree we shouldn't suppress such error messages, it's just that i'm worried about v11 in this regard, considering that v11 will be old-stable, soon ... -
Stephan Großberndt commented on patch set 2 03/21/23, 16:03
No, using -vvv will create output on each run specifying which tasks were run successfully, thus an email on each scheduler run. -
Stephan Großberndt commented on patch set 2 03/21/23, 16:05
And yes, it may happen people suddenly get emails they did not before, but that will be because something is broken. Don't kill the messenger. -
Christian Kuhn commented on patch set 2 V +1 CR +1 03/22/23, 12:03
Reply
ok, i'll vote this up, but someone else has to merge and backport. -
Benjamin Franzke commented on patch set 2 03/22/23, 12:38
Reply
Also ack for v11 from my side, for the mentioned reasons (errors were hidden, which we want to be fixed in v11, and -vvv is no option). (Can do the merge/backport later, if no one else does) I'd even have done stderr for v11, but as I have no real need myself, I'm only fine with main-only, so that this patch can go in as-is. -
Markus Klein commented on patch set 2 V 0 CR 0 03/22/23, 15:02
Removing my votes, 'cause I just realized, I voted my own patch. I already forgot it's mine ^^. -
Benjamin Franzke commented on patch set 2 V -1 03/22/23, 20:48
-1 for now Getting "No (more) tasks available for execution" for *every* run of bin/typo3 scheduler:run So this would always produce error mails in cronjobs. Seems like we'd need to keep the \OutOfBoundsException + isVeryVerbose() condition, but I'll check whether only my verification-procedure or my setup was wrong. -
Benjamin Franzke uploaded patch set 3
CR +1V +103/22/23, 22:57 -
Benjamin Franzke commented on patch set 3 03/22/23, 22:57
Reply
After some testing and thoughts I don't see a reason not to use stderr and non-zero-exit codes for v11. These are all unix standard and I don't come across a usecase where this breaks existing behaviors. (besides if someone used 2>/dev/null – but well, then error-silencing was really asked for) So I've adapted the patch to a) avoid OutOfBounds for control-flow b) use stderr for these error messages c) use return code 1 in case an error happended -
core-ci voted on patch set 3 V +1 03/22/23, 23:05 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/39426
-
Markus Klein commented on patch set 3 CR +1 03/23/23, 08:55
Thank you Benjamin! -
Mathias Brodala commented on patch set 3 03/23/23, 08:58
Just as a small reminder: in the v11 backport a feature flag could be added which is disabled by default. This way people can smoothly prepare for the new default behavior in v12. -
Stephan Großberndt voted on patch set 3 CR +1 03/23/23, 09:04
-
Markus Klein commented on patch set 3 03/23/23, 09:10
Reply
Strict no from my side. I except proper error output from a system. What is there now is just useless. If anyone in v11 now suddenly receives mails, they can easily disable the failing tasks, which should be done anyways probably, because it's obviously defective. -
Christoph Lehmann commented on patch set 3 CR +1 04/20/23, 17:52
Very good job! Thanks for implementing the UNIX-style Cron handling! I am in favor of a backport to v11 -
Christian Kuhn voted on patch set 3 V +1 CR +1 04/21/23, 06:04
-
Benjamin Franzke voted on patch set 3 V +2 CR +2 04/21/23, 06:42
-
Benjamin Franzke merged patch set 4 04/21/23, 06:42