Scheduled Reports Failing

Hello,

I’ve read a few related threads about Scheduled Reports failing but can’t find an answer to my specific problem.

I’m getting the following errors when trying to run scheduled reports:

SuiteCRM Log:

[FATAL] Job bb6457b2-3078-3ab2-b6f5-5ed709519ccb (Run Report Generation Scheduled Tasks) failed in CRON run

PHP error_log

PHP Fatal error: Call to a member function modify() on boolean in /home/valuepak/public_html/crm/modules/AOR_Scheduled_Reports/AOR_Scheduled_Reports.php on line 211

AOR_Scheduled_Reports.php (where it’s failing)

/**
 * @param DateTime $date
 */
protected function handleTimeZone(DateTime $date)
{
    global $sugar_config;

    $timezone = !empty($sugar_config['default_timezone']) ? $sugar_config['default_timezone'] : date_default_timezone_get();
    $timezone = new DateTimeZone($timezone);
    $offset = $timezone->getOffset($date);
    $date->modify($offset . 'second');
}

}

Seems to be an issue with passing the time offset.

I’ve tried both entering in a manual email address for the scheduled report and selecting a user who I know has the correct timezone settings. No dice with either approaches.

Any help would be greatly appreciated.

In database, table aor_scheduled_reports, what does Job bb6457b2-3078-3ab2-b6f5-5ed709519ccb have in its last_run field? I am guessing it is empty, and the code needs to have a special case for that…

Weirdly enough it started working randomly the next day.

I checked that table and the last_run field now has an entry. But it’s completely different to the time I set for the scheduled report to run.

How odd.

1 Like

It’s a bug. You must have made the Report run somehow, manually, and once it has the last_run field filled, it works.