NofPlan
NofPlan

Reputation: 33

Cron Error Magento - Too late for the schedule

hi im trying to set up a cronjob for magento.. have installed the AOE Scheduler and im getting the following errors while trying to run the .../cron.php:

Cron error while executing catalogrule_apply_all:

exception 'Mage_Core_Exception' with message 'Too late for the schedule.' in /home/www/web74/html/app/Mage.php:594
Stack trace:
#0 /home/www/web74/html/app/code/community/Aoe/Scheduler/Model/Observer.php(47): Mage::throwException('Too late for th...')
#1 /home/www/web74/html/app/code/core/Mage/Core/Model/App.php(1338): Aoe_Scheduler_Model_Observer->dispatch(Object(Varien_Event_Observer))
#2 /home/www/web74/html/app/code/core/Mage/Core/Model/App.php(1317): Mage_Core_Model_App->_callObserverMethod(Object(Aoe_Scheduler_Model_Observer), 'dispatch', Object(Varien_Event_Observer))
#3 /home/www/web74/html/app/Mage.php(447): Mage_Core_Model_App->dispatchEvent('default', Array)
#4 /home/www/web74/html/cron.php(46): Mage::dispatchEvent('default')
#5 {main} 

thx

Upvotes: 3

Views: 6245

Answers (3)

Stefan
Stefan

Reputation: 9224

If its not a timezone issue it is may caused by another corrupted cronjob. Check the cron_schedule table and look for jobs where the starting time (executed_at) is set but the finished_at column stays NULL. These jobs may throw an error which "crash" the cron chain and prevent other jobs to get executed.

To find the error, just create a little script to trigger the suspicious cron jobs directly. Place it in webroot and run it. For example

error_reporting(E_ALL | E_STRICT);
$mageFilename = 'app/Mage.php';
require_once $mageFilename;
Mage::setIsDeveloperMode(true);
ini_set('display_errors', 1);
umask(0);
Mage::app();

$a = new TheCron_Module_Model_Observer();

$a->triggerTheJob();

echo "\nDone\n";

Upvotes: 1

JaseC
JaseC

Reputation: 3209

Check configuration > system > cron. Make sure that your "schedule ahead" is far out enough in front of your actual system cron frequency. Tweak those numbers to resolve. etc.

Upvotes: 1

Afroz Alam
Afroz Alam

Reputation: 874

It is probably due to time zone difference and time mismatch. The time you are assigning in for a cron pocess has already crossed according to server.

Upvotes: 2

Related Questions