Under Review

Better logging for failed schedulers

Currently the scheduler interface just shows if a job is done or not. It does not show if it failed and why.

It would be nice to have individual logs for scheduler jobs accessible from the Scheduler interface. At the very least the resolution and message fields from the job_queue should be included in the Job Log.

The two main messages I see in the database for failed jobs are "Forced failure on timeout" and "Unexpected failure, please check PHP logs and sugarcrm.log"

Whenever I get an "unexpected failure" there is never any indication of anything wrong in either the PHP or sugarcrm logs and it often leaves me wondering what caused it. I realize it's near impossible to catch everything under the sun but is there a way to give more information to the administrator than "unexpected failure"?

Thank you,


  • Thank you Angel,

    I do that regularly. Unfortunately my most problematic schedulers simply show "Unexpected failure, please check PHP logs and sugarcrm.log"

    and the logs show nothing further. The failures are not consistent and I'm looking for patterns such as do these particular schedulers fail when running in a job-run that includes others and which others may cause them to fail... it's quite the puzzle. More often than not, they are jobs that involve some kind of interaction with the email_addresses table and email_address_bean_rel table.

  • Another suggestion worth considering is to look at the records in the job_queue table. While not verbose, it does tend to have a bit more detail about the error/problem when processes fail.

  • I changed mine to:

    php -f cron.php >>logs/Cron/cron.log 2>>logs/Cron/cron.err

    so they append instead of clearing each time it runs.


    Now I need a way to timestamp the entries, any thoughts?




  • I always start the cron.php not as recommended with

    ... php -f cron.php > /dev/null 2>&1

    but with

    ... php -f cron.php >cron.log 2>cron.err

    So I get at least all php error messages in these two files in the Sugar root directory.