Scheduled reports inactivated unexpectedly

Hello all,

We have an on premise instance in which we are receiving this email from a scheduled report:

Il report pianificato "Selir: Estrazione Ritiro POS (ID: aad37264-a8d8-11eb-9fec-0295aa324bdc)" è stato disattivato inaspettatamente. Per ulteriori informazioni, contattare l'amministratore.

It's basically saying that a specific report schedule was inactivated unexpectedly.

We reactivated the scheduled report 3 times, every time restart working as expected for a couple of days, then after it inactivates unexpectedly again.

Do you know a possible reason to it?

Thanks

  • It looks like you are seeing the error:

      'ERR_REPORT_DEACTIVATED' => 'Scheduled report "{0} (ID: {1})" has been unexpectedly deactivated. Please contact your administrator for more information.',

    This error is used in modules/Reports/utils.php in the function "sendNotificationOfDisabledReport"

    which in turn is used by the "handleFailedReports" function in modules/ReportSchedules/ReportSchedule.php

    which in turn is used in process_queue.php which is found in the sugar root folder.

    If you look at function handleFailedReports() you will see that it is basically deactivating any scheduler for which the report run failed.

    So the question is, what is failing in that specific report that is not failing all the time but only sometimes?

    In bocca al lupo.

    FrancescaS

  • Hello  , 

    Sugar is set in a way that any error during report generation deactivates the scheduled report. This was done in order to maintain Server integrity where customers in Sugar Cloud were scheduling exceptionally large reports, consuming substantial resources, leading to frequent failures and adversely affecting server performance for all customers sharing the same server stack.

    So you could chase your PHP error log to see what's the error that is being thrown that caused the report to be inactivated, it could be something like memory exhausted for specific conditions on that report. 

    As the customer is on prem, you could also consider disabling the disabler altogether, for that you could look at overriding the modules/ReportSchedules/ReportSchedule.php file and update the \ReportSchedule::getSchedulesToDeactivate method to set the first line of the method to be "return array() to avoid the report to be set to inactive even if there is a PHP error. 

    I hope this helps. 

    André