Good day!
I’m having a problem with suitecrm to generate automatic reports and email them to me.
I have installed a fresh suitecrm using cpanel hostgator
I only setup SMTP email and it’s working,
I added one account and opportunity.
The corn was setup automatically when I installed it in corn jobs but not working.
I generated a report and scheduled it.
Please advise on how to solve the automatic reporting issue and on the other errors that I’m receiving from diagnostic tool since this is a fresh installation.
John
6 August 2020 13:15
2
Hey,
Looks like there might be an issue with the Crontab, if the Scheduled Job isn’t running
If you go to Admin->Schedulers, how does the line appear at the bottom?
It’ll show something like:
“* * * * * cd /var/www; php -f cron.php > /dev/null 2>&1”
If this differs from what appears in the Hostgator panel, it might be worth adding the line into Hostgator as a Cron job
Otherwise, I found a previous Forum thread in which users discussed Hostgator Cron issues, perhaps something here may be of help?:
Hi,
I have installed SuteCRM on my Hostgator Shared server.
im unable to setup the Cron jobs and get the Schedulers running.
Im not sure what i have to enter exactly.
This is what the Schedulers Admin panel shows:
cd /home/{username}/public_html/CRM; php -f cron.php > /dev/null 2>&1
i entered this in the Cron Jobs in CPanel but it doesnt work. the schedulers do not run.
Any help would be appreciated.
I also get this when i upload a logo:
$mod_strings.LBL_LOGO
Thanks …
Thank you so much for your support, I really appreciate it.
I have contacted hostgator, and it looks like they only allow corn jobs to be executed every 15+ minutes.
I have already set it to 15 minutes but still not working. Please find the attached screenshots
.
Also, cron will send an email every time it runs a command which produces output, and I have received this output,
Also, I tried to set the interval on the CRM to be every 15 minutes but still not working
@John Hello, after setting corn to be executed every 15 minutes in hostgator,
I started to receive this error
cron.php: running as epse is not allowed in allowed_cron_users in config.php. Exiting.
I managed to fix it by adding the user manually and I don’t receive it anymore. However, I now get this error
(Run Report Generation Scheduled Tasks) failed in CRON run
I looked for posts that have the same issue, but no luck in in finding a solution, can you please support.
Please find the attached log.
Thank you
John
12 August 2020 11:07
6
Hey,
Glad to hear you’ve made some progress!
I vaguely remembered seeing that error before, and found an older thread where I’d spoken about it previously:
Hi,
If you have Database access, you should be able to change the “last_run” value in the “aor_scheduled_reports” table.
If you don’t, then you could perhaps create a Workflow to set “last_run” = “date_created” on the creation of Scheduled Reports records, that should ensure that “last_run” is not NULL for any new scheduled reports records
If you do the above, do the reports run?
It seems as though it is a currently open bug in SuiteCRM:
opened 12:08PM - 24 Apr 20 UTC
closed 10:59PM - 28 Apr 21 UTC
Type: Bug
Priority:Important
Area: Reports
#### Issue
Newly created Schedule for a report , does not work . No email is … sent. I get an error in suite log.
#### Expected Behavior
An email with the Report attached to be sent on specific Hour and Minute.
#### Actual Behavior
Get in php.log the followind lines when cron executes.
```
[24-Apr-2020 14:39:44 Europe/Athens] PHP Fatal error: Uncaught TypeError: Argument 1 passed to AOR_Scheduled_Reports::handleTimeZone() must be an instance of DateTime, bool given, called in C:\Apache24\htdocs\modules\AOR_Scheduled_Reports\AOR_Scheduled_Reports.php on line 195 and defined in C:\web\Apache24\htdocs\modules\AOR_Scheduled_Reports\AOR_Scheduled_Reports.php:204
Stack trace:
#0 C:\Apache24\htdocs\modules\AOR_Scheduled_Reports\AOR_Scheduled_Reports.php(195): AOR_Scheduled_Reports->handleTimeZone(false)
#1 C:\Apache24\htdocs\modules\Schedulers\_AddJobsHere.php(786): AOR_Scheduled_Reports->shouldRun(Object(DateTime))
#2 C:\Apache24\htdocs\modules\SchedulersJobs\SchedulersJob.php(540): aorRunScheduledReports(Object(SchedulersJob))
#3 C:\Apache24\htdocs\include\SugarQueue\SugarCronJobs.php(191): SchedulersJob->runJob()
#4 C:\Apache24\htdocs\include\SugarQueue\SugarCronJobs.php(231): SugarCronJobs->executeJob(Object(SchedulersJob))
#5 C:\Apache24\htdocs\cron.php(100): SugarCronJobs->runCycle()
#6 {main}
thrown in C:\Apache24\htdocs\modules\AOR_Scheduled_Reports\AOR_Scheduled_Reports.php on line 204
```
#### Possible Fix
In AOR_Scheduled_Reports.php(195) there is a handleTimeZone($lastRun);
lastRun is null in Database, because the job is a new one.
#### Steps to Reproduce
1. https://community.suitecrm.com/t/help-run-report-generation-scheduled-tasks-failed-in-cron-run/72435/9
2. https://github.com/salesagility/SuiteCRM/pull/8181
3.
4.
#### Context
It seems to be a high priority, because affects all new Scheduled Reports .
#### Your Environment
Windows Server
Suite CRM Version 7.11.13 - Sugar Version 6.5.25 (Build 344)
PHP Version 7.3.17
Apache/2.4.43 (Win64) OpenSSL/1.1.1f PHP/7.3.17
Setting in php.ini for timezone :
date.timezone = “Europe/Athens”
If you have created a Scheduled Report record, is the “Last Run” value Empty/Blank/NULL?
If so, could you follow the steps I suggested in the thread linked above, and see if it resolve your issue?
(ie: Set the “Last Run” value on your Scheduled Report record to anything other than “NULL”, either by a Workflow or via Database Access)
Let me know if you need any assistance!