Project

General

Profile

Actions

Feature #100946

open

Scheduler: More details via mail on failed task

Added by Philipp Kitzberger over 1 year ago. Updated about 22 hours ago.

Status:
Under Review
Priority:
Should have
Assignee:
-
Category:
scheduler
Target version:
-
Start date:
Due date:
% Done:

0%

Estimated time:
PHP Version:
Tags:
Complexity:
easy
Sprint Focus:
On Location Sprint

Description

In the mail received on a failed scheduler task it would be helpful to have more information available that helps identifying the problematic task. Currently there's only the stack trace but e.g. not the id of the scheduler task itself. Other informations might be helpful too.

Sure, the failed task is marked as failed in the BE, but that's not a persistent information we can rely on. The subsequent run of that task might have ran smoothly again. And still I might wanna look into that one that failed.


Files


Related issues 1 (0 open1 closed)

Follows TYPO3 Core - Feature #87806: Scheduler: Send email on errorClosed2019-02-27

Actions
Actions #1

Updated by Philipp Kitzberger over 1 year ago

  • Due date set to 2019-02-28
  • Start date changed from 2023-06-02 to 2019-02-28
  • Follows Feature #87806: Scheduler: Send email on error added
Actions #2

Updated by Philipp Kitzberger over 1 year ago

  • Description updated (diff)
  • Start date deleted (2019-02-28)
  • Complexity set to easy
Actions #3

Updated by Georg Ringer 5 months ago

  • Due date deleted (2019-02-28)
  • Sprint Focus set to On Location Sprint
Actions #4

Updated by Garvin Hicking 5 months ago

  • Status changed from New to Needs Feedback

Might https://review.typo3.org/84152 be related and solved it for you?

Actions #5

Updated by Philipp Kitzberger 5 months ago

@Garvin Hicking, yes, that is kinda related, but not changing the contents of the cronjob MAILTO mail. I'd like to have ID and name of the failed scheduler task included in that mail.

Actions #6

Updated by Garvin Hicking 5 months ago

Philipp Kitzberger wrote in #note-5:

@Garvin Hicking, yes, that is kinda related, but not changing the contents of the cronjob MAILTO mail. I'd like to have ID and name of the failed scheduler task included in that mail.

Do you have an example mail you get and how it looks with the patch above applied? I thought that the stdterr would contain the contents of the error logger, but this is not the case? I don't have a setup where I could easily investigate this, do you happen to know an easy way to make a scheduler task fail and generate the output that is used for a MAILTO command?

Actions #7

Updated by Philipp Kitzberger 4 months ago

Hm, simply add this to EXT:scheduler/Classes/Example/TestTask.php->execute():

throw new \Exception('Boom!');

Then add a task of that class to the scheduler and call it via:

$ bin/typo3cms scheduler:run --task=1 --force

 [ERROR] Boom!                         

That message is what's been sent as mail content. Which is not exactly helpful at all.

Your patch doesn't change that. But I guess modifying SchedulerCommand.php would do the trick:

                try {
                    $this->executeOrStopTask($task);
                } catch (\Exception $e) {
                    $this->io->getErrorStyle()->error($e->getMessage());
                    ...

Maybe just output a bit more than just the exceptions message. A 2nd line with scheduler id and title would already be an improvement.

Actions #8

Updated by Garvin Hicking 4 months ago

Ah, I see - if Exceptions are involved that's another thing.

Your patch idea looks promising, would you like to implement/propose that as a core patch, or should I?!

Actions #9

Updated by Gerrit Code Review 5 days ago

  • Status changed from Needs Feedback to Under Review

Patch set 1 for branch main of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/87001

Actions #12

Updated by Gerrit Code Review 3 days ago

Patch set 2 for branch main of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/87001

Actions #13

Updated by Gerrit Code Review 2 days ago

Patch set 3 for branch main of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/87001

Actions #14

Updated by Gerrit Code Review 2 days ago

Patch set 4 for branch main of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/87001

Actions #15

Updated by Gerrit Code Review 2 days ago

Patch set 5 for branch main of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/87001

Actions #16

Updated by Gerrit Code Review 2 days ago

Patch set 6 for branch main of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/87001

Actions #17

Updated by Gerrit Code Review 2 days ago

Patch set 1 for branch 13.4 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/87089

Actions #18

Updated by Gerrit Code Review about 22 hours ago

Patch set 7 for branch main of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/87001

Actions

Also available in: Atom PDF