With Scheduled tasks and jobs running in the background it can sometimes
be difficult to determine what is going on when things go wrong. If you
are debugging a scheduled task the the scheduled task page is a good
place to start. For both scheduled tasks and job queue tasks you can
also check the job_queue table. For example, in MySQL we can check the
last five scheduled jobs:
Example 13.7: Example MySQL query for listing jobs
SELECT * FROM job_queue ORDER BY date_entered DESC LIMIT 5
This will give us information on the last five jobs. Alternatively we
can check on specific jobs:
Example 13.8: Example MySQL query for listing BeanEmailJobs
SELECT * FROM job_queue WHERE target = 'class::BeanEmailJob'
In either case this will give details for the job(s):
Example 13.9: Example MySQL list of jobs
*************************** 1. row ***************************
name: Email job for Accounts 103c4c9b-336f-0e87-782e-5501defb5900
date_entered: 2015-03-14 14:58:15
date_modified: 2015-03-14 14:58:25
execute_time: 2015-03-14 14:58:00
1 row in set (0.00 sec)
Here we can check the status, resolution and message fields. If the
queued then either the scheduler has not yet run or it isn’t
running. Double check your Cron settings if this is the case.
It may be the case that the job has ran but failed for some reason. In
this case you will receive a message telling you to check the logs.
Checking the logs usually provides enough information, particularly if
you have made judicious use of logging (see the chapter on logging) in
It is possible that the job is failing outright, in which case your
logging may not receive output before the scheduler exits. In this case
you can usually check your PHP logs.
As a last resort you can manually run the scheduler from the SuiteCRM
Example 13.10: Running the scheduler manually
Using this in addition to outputting any useful information should track
down even the oddest of bugs.