Posts: 855
Threads: 238
Joined: Nov 2015
Reputation:
96
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.
Posts: 3,565
Threads: 36
Joined: Apr 2014
Reputation:
49
This is what I do:
- open the command line and go to the coreBOS directory
- open config.inc.php or config-dev.inc.php 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
Joe
TSolucio
Posts: 855
Threads: 238
Joined: Nov 2015
Reputation:
96
09-24-2018, 07:07 PM
(This post was last modified: 09-24-2018, 07:35 PM by Guido1982.)
Nice, got some error but I'll open another thread for that.
About the background log, I set my config.inc.php 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.