0

About the problem: I have problems with magento cron jobs not working properly using default Magento cron settings on Configuration -> System. I have reverted most of the files to previous version because it used to be fine (i just added few comments on files). This problem occured after successfully running for two weeks and it stopped before two ~ three days. This problem is from demo server version while in other hand i have no problem running this on my localhost development version by calling cron jobs manually via 'demoshop.com/cron.php' url. Differences between dev/demo environments is Win/Linux OS.

How it should work On demo server Magento cron job file 'cron.php' executes every minute(by server admin info). It populates cron_schedule table without any problem. It starts by executing its default jobs but it feels like ''laggy''. For testing purpose I used to delete all default jobs and leave only my jobs and it just happen to pick up in no time without any problem. Now it sits there and nothing happens. I haved checked cron file permissions, added logging when cron file gets executed, added logging when my fuction is called. Cron file gets executed, table is populated, some of the default magento jobs starts but my tasks is never called. I sometimes get 'Too late for the schedule.' error, i tried to increase 'Missed if Not Run Within' Value on magento cron job settings but it sits there anyway and nothing.

On my localhost server as i mentioned it just starts probably instantly when i run cron.php file and goes through without any problems, warnings, errors. Im starting it by running cron.php file. Same code, same database.

My functions takes about 5-10 minutes to execute. It is basically product data update/send functions. Can it be that i have a typo error or something somewhere ? Can it be that Win/Linux OS understand my config files differently(like upper-lower case) and cant find my functions to execute or something ? I do not have any problems on windows. I currently dont have access to demo server SSH and OS processes of course.

Cron settings:

enter image description here

cron_schedule table:

enter image description here

It would be very nice if i get any reference where should i start looking. I will repeat myself that i have no trouble by running it on localhost by executing cron.php file. Magento is community edition.

1

First off, Magento's default cron handling is (nicely put) a little strange. Please have a look at the Aoe_Scheduler (https://github.com/AOEpeople/Aoe_Scheduler), which provides a very convenient user interface and helps you find possible errors in your setup more easily. In addition, it comes with a custom shell script that you can extend to your needs.

I mention the Aoe_Scheduler as it handles potential deadlocks that might occur in vanilla Magento cron setup better. We've experienced deadlocks with cron jobs in Magento in the past for commands that might exceed defined timeouts. Aoe_Scheduler fixed these issues.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.