Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
The cron debug thread: my cron task keeps running
I've got a recurring salesorder task and a planned report task that keep running. No idea why but that's not really my intention of this thread. I'd like to use this thread to teach a man how to fish. What are the best ways to debug any cron task that exceeds the time limit? Maybe I'm missing some Apache or PHP modules? I've come across this problem before and think it would be very useful for any coreBOS admin to have a good debug toolbox for cron tasks since they are hard to debug and I never really found a peak under the hood.
This is what I do:

- open the command line and go to the coreBOS directory
- open or and add: error_reporting(E_ALL);ini_set('display_errors',1);
- reset the scheduled task in Settings
- manually launch the cron in question: php vtigercron.php ScheduleReports

that usually shows the error on screen and gives you the first steps to start debugging

When you have to launch the cron repeatedly I usually reduce the time directly in vtiger_crontask table

When it gets REALLY complicated you can activate the BACKGROUND log in log4php as that log gives you cron/workflow detailed information
Nice, got some error but I'll open another thread for that.

About the background log, I set my to log and set the log4php.logger.BACKGROUND to DEBUG,A8. I don't see a background.log file pop up when I do the testing. Am I missing something?

Ah, now I do have one. The javascript log was also set to A8, so it was written to the javascript.log file.

Forum Jump:

Users browsing this thread: 1 Guest(s)