jweiland/reset-scheduler

In certain scenarios, a TYPO3 scheduler task may continuously run without errors. This can occur if the task exceeds the configured :php:max_execution_time or consumes more memory than the defined :php:memory_limit. As a result, the task is unable to complete execution properly and cannot provide any feedback on whether it was successfully executed.

Tasks that can no longer provide feedback will not be executed again by the TYPO3 scheduler. This is where the TYPO3 extension reset_scheduler comes into play. As a scheduler task itself, it detects indefinitely running tasks and notifies you via email about failures or timeouts. Additionally, it can reset failing tasks, ensuring they are executed again in the next scheduled run.

Installation

Explains how to install this extension in Composer-based and Classic TYPO3 installations.

Configuration

Learn how to configure this extension.

Frequently Asked Questions (FAQ)

These questions have been frequently asked.

How to get help

Learn where to get help and how to report issues you found.

Installation

Install jweiland/reset-scheduler with Composer

Install the extension via Composer:

composer req jweiland/reset-scheduler
Copied!

See also Installing extensions, TYPO3 Getting started.

Install jweiland/reset-scheduler in Classic Mode

Or download the extension from TYPO3 TER and install it in the Extension Manager.

Configuration

reset_scheduler comes with a schedulable command scheduler:reset. That way you can execute it via CLI (cron) and as a TYPO3 scheduler task.

Scheduler Task

Create a new scheduler task of type: Execute console command.

Choose schedulable command: scheduler:reset.

Define a fequency

Press Save to reload the form with new options.

Set the options to your needs.

CLI Command

Composer

vendor/bin/typo3 scheduler:reset [OPTIONS]
Copied!

DDEV

ddev typo3 scheduler:reset [OPTIONS]
Copied!

Classic

typo3/sysext/core/bin/typo3 scheduler:reset [OPTIONS]
Copied!

Options

Name Type Default
bool false
string 1
int 3600
bool false

info (-i)

info (-i)
Type
bool
Default
false

Using the info option, you can first check for any failing tasks that need to be reset or reported via email. This helps prevent an excessive number of notification emails. Using this option will not process any other options and will not reset any task nor send any mail.

vendor/bin/typo3 scheduler:reset -i
Copied!

email (-m)

email (-m)
Type
string
Default
1

Specify the recipient's email address here. Notifications will only be sent if any failing tasks are detected. The task also verifies whether the TYPO3 mail system is correctly configured. If any issues are found, they will be reported via the CLI.

vendor/bin/typo3 scheduler:reset -m admin@example.com
Copied!

execution-timeout (-t)

execution-timeout (-t)
Type
int
Default
3600

Specify a timeout (in seconds) after which indefinitely running tasks should be reset. Using the execution-timeout option without the reset or email option will show an error.

vendor/bin/typo3 scheduler:reset -t 900 -r
Copied!

reset (-r)

reset (-r)
Type
bool
Default
false

Resets all tasks that have exceeded the defined execution timeout (default: 3600 seconds). After the reset, the task will be executed again in the next scheduler run.

vendor/bin/typo3 scheduler:reset -t 1800 -r
Copied!

Reset and Mail

It is also possible to sent info mail and reset failing tasks in one run:

vendor/bin/typo3 scheduler:reset -t 1800 -r -m admin@example.com
Copied!

Frequently Asked Questions (FAQ)

Currently 3 kinds of task errors are supported:

  1. Invalid tasks: Tasks which cannot be unserialized from tx_scheduler_task record or tasks which do not extend the scheduler AbstractTask class or tasks containing invalid information about execution times or task classis not registered in task repository.
  2. Running tasks exceeding the defined execution-timeout option
  3. Failing tasks: Tasks which are throwing an exception. Also tasks which results in a return value greater than 0 results in an exception internally in scheduler.

You have to setup the mail FROM and NAME in extension settings of reset_scheduler. If not defined the values will be retrieved from $GLOBALS['TYPO3_CONF_VARS']['MAIL']['defaultMailFromAddress'] and $GLOBALS['TYPO3_CONF_VARS']['MAIL']['defaultMailFromName'] in TYPO3 installtool. Please make sure you have configured these values. Please test mail system in TYPO3 installtool. Further you have to activate mailing with Option: email.

The Option: reset will only reset running scheduler tasks after Option: execution timeout has been exceeded.

All return values of our command are set to 0 (SUCCESS). So, it can not fail. Further we have wrapped all API calls into try-catch clauses to prevent suddendy failors. Sure, also our task may result into PHP limitations. To be really sure that our task is running we prefer executing our command scheduler:reset via an additional cronjob from shell.

All running tasks whicn exceeds the defined Option: execution timeout

Failing tasks will not be reset.

Currently, this is not possible. Failing or exceeding tasks are only available via mail.