Job c26b373d-5847-c71e-1df0-5f1b95a3382c (Run Email Reminder Notifications) failed in CRON run

I just wanted set my Contract Renewal Reminder to send an email notification to the assigned Contract Manager, but I never get an email even once. I set Contract End Date to Tomorrow and I set Renewal Reminder Date to Today with a specific time in the future. But when the time passed I didn’t get the email. And below are what I’ve done with my system module setting:

Admin/Scheduler => Run Email Reminder Notifications (Last Successfully Run = Never)
Profile/Advanced => Notify on Assignment (Enabled)
Admin/Email Settings => Assignment Notifications (Enabled)
Admin/AOC Settings => Renewal Reminder period = 1 day

Test email with SMTP setting working fine.

Any ideas how to get this email reminder notification to work?

SuiteCRM 7.11.14/Sugar Version 6.5.25 (Build 344)
Ubuntu LTS 18.04 
PHP 7.2
PHP IMAP/CLI enabled.

The process hat you’ve gone through looks sane, so we now need to find out what went wrong.

  1. First thought is that you haven’t configured cron for your system (based on Last Successfully Run = Never). In order to ensure that this is occurs you need to add a record to your crontab. Read here for more information:

On an ubuntu system, I believe that the webserver is run as apache rather than www-data.

  1. Second possibility is that the scheduler is failing before it gets to the ‘Run Email Reminder Notifications’. In order to find out if this is the case, you can look at the scheduler tasks. Admin->Schedulers, and you’ll see the status of each task. (whether it is enabled or disabled) You can click on the status of each tab in turn and see when they last ran (Job log at the bottom). This will either show that none have ever run (indicating a that cron is incorrectly configured), or that some are running, and at some point on the scheduler list, cron fails, and scheduled tasks after that one are not run. At this point you need to start looking at the logs and correcting the cause of the fault.

  2. There is a setting in the config.php that dictates what ‘users’ are allowed to run the cron.php command (which runs your schedulers). Ensure that your web server user - apache? ia included in this, otherwise you will get an error in your suitecrm.log fail and the schedulers will fail to run.

hi

I have problems running crontab. Of course, I followed all the points in the instructions, but my schedule never starts.
Can I somehow run this manually?
I mean manually run cron.php file to synchronize Google calendar or for example clear the database

Yes it is possible to run manually. As a bonus, you get to see all the logging and progress in real time. In order to do this, you go to your suiteCRM folder (as an authorised user), and run the command:

php cron.php

Note that you must be a user with the correct permisisons for this. Ideally you should run as the webserver identity as otherwise you can end up with files created with the wrong permissions. It is not advisable to run as root as Administrator as it will cause you problems with file permissions later. The user that you are running as must be included in the config.php file or the cron.php script will quit with a fatal error.

For linux / *nix systems you can use su (or sudo) run as the appropriate user.

If the scheduler never starts, then you need to ensure that cron (or equivalent is installed and running on the system concerned. Also the crontab format actually varies between systems. The format given in the docs is for a centralised crontab for all users. Most linux systems have a separate crontab for each each user, so you don’t include the user name in the crontab entry. Check your crontab entry carefully against your system cron format and make sure you understand it completely. If that doesn’t work, then time to start checking and increasing the verbosity of logs.

When i go to cd /var/www/suitecrm and type php cron.php
I got this

PHP Fatal error: Allowed memory size of 2097152 bytes exhausted (tried to allocate 2161293 bytes) in /var/www/suitecrm/vendor/composer/autoload_real.php on line 28

Sure I’ve changed my php.ini so memory_limit was configured.

Note that there are two different php.ini files, one for web server, one for CLI, which is what cron uses.

Type

php -i | grep php.ini

to see the path of your file. Then edit that one.

For @Bunna make sure in your CLI php.ini you have the correct date.timezone set.

Did that resolve the problem. My memory settings in php.ini are:

memory_limit = 256M (originally 128M)

What are yours after configuring memory_limit?

He has only 2M, it says so in his error message. No wonder it breaks…

@Lyk37858 make sure you specify with the correct notation 512M, not 512MB which won’t be correctly recognized.

thanks for your all your suggestions though, and sorry for late responding back because I wasn’t near my pc during my weekend holiday off work.

about the Job Log it shows “Done” every minute it ran, and all other Schedulers have “Last Successfully Run” except Run Email Reminder Notifications

I checked my CLI php.ini and my date.timezone = [blank]
So what should I set it to?

And sorry for late responding, because I wasn’t near my pc during my weekend holiday break.

As the Run Email Reminder Notifications is the only one that’s failed, then it implies that there is something setup incorrectly for that particular task. I presume that you’ve tested Admin->Email settings and confirmed that the test emails can be sent correctly? (and obviously this particular task is enabled in the scheduler

I’d expect to see an error in the log relating to this particular in the suitecrm.log file

If nothing shows up there, then you may need to alter the suiteCRM logging levels:

Admin->System settings->Logger settings.

to a higher level in order to get more information. Don’t forget to change the logging level back once done, as logs can consume a significant amount of drive space in a short time…especially if you get to the ‘debug’ level! Warn is probably the highest level that you should be using unless you know what you’re looking for.

@pgr
thanks
I’ve changed and now when I run php cron.php

cron.php running with user that is not in allowed_cron_users in config.phpPHP Fatal error:  Uncaught Exception: cron.php running with user that is not in allowed_cron_users in config.php in /var/www/suitecrm/include/utils.php:1882
Stack trace:
#0 /var/www/suitecrm/cron.php(70): sugar_die()
#1 {main}
  thrown in /var/www/suitecrm/include/utils.php on line 1882

my config.php

'cron' => 
  array (
    'max_cron_jobs' => 10,
    'max_cron_runtime' => 30,
    'min_cron_interval' => 30,
    'allowed_cron_users' => 
    array (
      0 => 'www-data',
      1 => 'daemon',
    ),

okay,
now I have the only one way how I can start cron I add user ‘ubuntu’ in suitecrm/config.php
but i think this is a bad way
any way how I can setting two-way google-suitecrm calendar sync?
Right now I can see only siutecrm calendar record in google but how I can see google calendar records in suitecrm calendar?

@ Lyk37858

It’s worthwhile opening a new problem in order to separate out issues and make them easier to search, and avoid hijacking someone elses thread.

However, generally, you only ever want to give the minimum of permissions to a process running on your system without supervision. I guess that running as ubuntu is OKfor testing, but personally I’d have run it as the web server (www-data?) As you’ve chosen to run the cron.php process as the user ubuntu, you may wish to check that it hasn’t created any files owned by the user ubuntu that will cause problems later on:

find /path/to/webroot -user ubuntu

will list them for you. I’m guessing that you’re running your web server (apache?) as the user www-data? In which case, your scheduler should be running correctly now?

wrt calendar synchronisation - 2 way synchronisation requires additional logic as to which calendar has authority in the event of a conflict. Generally a more sane approach is to have a central ‘viewing calendar’ that displays all calendars that you are interested in overlaid with each other. e.g. the calendar capabilities of a suitable productivity client such as Thunderbird/Outlook etc SuiteCRM does not support this directly, but there are 3rd party modules that will do some of it for you. e.g. RT GSync:

https://store.suitecrm.com/docs/gmail-sync/rt-gsync-documentation

Here are what I got from my suitecrm.log file

Tue Jul 28 09:13:07 2020 [2759][1][FATAL] Job 2c000494-2444-6289-3643-5f1f7b020030 (Run Email Reminder Notifications) failed in CRON run
Tue Jul 28 09:14:06 2020 [3194][1][FATAL] Job b1e7c9ee-c9dd-a6e8-cbea-5f1f7b728a7c (Run Email Reminder Notifications) failed in CRON run
Tue Jul 28 09:15:09 2020 [3571][1][FATAL] Job f25d0f95-980f-7e65-9483-5f1f7cbe08b5 (Run Email Reminder Notifications) failed in CRON run
Tue Jul 28 09:16:04 2020 [4270][1][FATAL] Job 6d0417e3-ec33-7950-8882-5f1f7c22d9cf (Run Email Reminder Notifications) failed in CRON run
Tue Jul 28 09:17:06 2020 [4320][1][FATAL] Job 6c0981de-5bc8-ad55-042e-5f1f7c686e10 (Run Email Reminder Notifications) failed in CRON run
Tue Jul 28 09:18:05 2020 [6269][1][FATAL] Job cbbb82cf-c9b7-091e-ffa4-5f1f7c315170 (Run Email Reminder Notifications) failed in CRON run
Tue Jul 28 09:19:06 2020 [6672][1][FATAL] Job 8c82fea1-720d-2ba9-66a1-5f1f7dd432eb (Run Email Reminder Notifications) failed in CRON run
Tue Jul 28 09:20:11 2020 [7065][1][FATAL] Job cc40e97f-d0d1-01a7-6264-5f1f7d3d65a5 (Run Email Reminder Notifications) failed in CRON run
Tue Jul 28 09:21:06 2020 [7802][1][FATAL] Job dd5151b4-3235-8624-9ea1-5f1f7d2f3c57 (Run Email Reminder Notifications) failed in CRON run
Tue Jul 28 09:22:06 2020 [7844][1][FATAL] Job d71673e9-04b5-614f-6480-5f1f7d9aef77 (Run Email Reminder Notifications) failed in CRON run
Tue Jul 28 09:23:04 2020 [9786][1][FATAL] Job 7714f1ba-f52e-112d-c6b0-5f1f7d8b52b8 (Run Email Reminder Notifications) failed in CRON run
Tue Jul 28 09:24:09 2020 [9909][1][FATAL] Job 659a7e1b-82ee-6fec-feb8-5f1f7e8b3585 (Run Email Reminder Notifications) failed in CRON run
Tue Jul 28 09:25:09 2020 [10601][1][FATAL] Job 691b910a-a5f8-d57b-f70d-5f1f7e972e10 (Run Email Reminder Notifications) failed in CRON run
Tue Jul 28 09:26:06 2020 [11316][1][FATAL] Job a98ccc5b-717b-83e8-b9b1-5f1f7e7173bf (Run Email Reminder Notifications) failed in CRON run
Tue Jul 28 09:28:04 2020 [13320][1][FATAL] Job 9f397372-16b9-08d0-0e75-5f1f7e3a0c7a (Run Email Reminder Notifications) failed in CRON run
Tue Jul 28 09:29:07 2020 [13688][1][FATAL] Job 728f7533-2683-4a9f-41c7-5f1f7f095836 (Run Email Reminder Notifications) failed in CRON run
Tue Jul 28 09:30:08 2020 [14118][1][FATAL] Job e73e0b83-4b01-056e-5fc3-5f1f7f4a9087 (Run Email Reminder Notifications) failed in CRON run

And here are what I got after changed my logging level to WARN

Tue Jul 28 10:10:04 2020 [10178][-none-][WARN] Configuration variable date.timezone is not set, guessed timezone Asia/Shanghai. Please set date.timezone=“Asia/Shanghai” in php.ini!
Tue Jul 28 10:10:05 2020 [10178][1][WARN] There is no any workflow to run
Tue Jul 28 10:10:05 2020 [10178][1][WARN] Request ssl value not found.
Tue Jul 28 10:10:05 2020 [10178][1][WARN] Requested folder is not defined
Tue Jul 28 10:10:05 2020 [10178][1][ERROR] ImapHandler trying to use a non valid resource stream.
Tue Jul 28 10:10:05 2020 [10178][1][ERROR] ImapHandler trying to use a non valid resource stream.
Tue Jul 28 10:10:07 2020 [10178][1][WARN] An Imap error detected: “IMAP expunge error”

Non of those errors/warnings indicate a failure mechanism. If you only changed the logging level to WARN, then you should still be receiving the log entries of the form:

Tue Jul 28 09:13:07 2020 [2759][1][FATAL] Job 2c000494-2444-6289-3643-5f1f7b020030 (Run Email Reminder Notifications) failed in CRON run

Therefore could you check that you are giving all the necessary information. from the suitecrm.log

Also you could try running php cron.php as the webserver user and see what you get.

Here are what I got from suitecrm.log file again

Wed Jul 29 09:45:04 2020 [20856][-none-][WARN] Configuration variable date.timezone is not set, guessed timezone Asia/Shanghai. Please set date.timezone=“Asia/Shanghai” in php.ini!
Wed Jul 29 09:45:05 2020 [20856][1][WARN] There is no any workflow to run
Wed Jul 29 09:45:08 2020 [20856][1][FATAL] Job d9ae0422-5870-df70-f4ee-5f20d4251326 (Run Email Reminder Notifications) failed in CRON run
Wed Jul 29 09:45:22 2020 [17759][9b05e3f9-cc6e-4de6-683c-5d390b3270c9][DEPRECATED] Array

And this is what I got when I run php cron.php

PHP Warning: Module ‘imap’ already loaded in Unknown on line 0
PHP Fatal error: Uncaught TypeError: Argument 2 passed to Reminder::isDecline() must be an instance of SugarBean, boolean given, called in /home/sitename/domains/subdomain/public_html/crm/modules/Reminders/Reminder.php on line 241 and defined in /home/sitename/domains/subdomain/public_html/crm/modules/Reminders/Reminder.php:471
Stack trace:
#0 /home/sitename/domains/subdomian/public_html/crm/modules/Reminders/Reminder.php(241): Reminder::isDecline(Object(Call), false)
#1 /home/sitename/domains/subdomain/public_html/crm/modules/Reminders/Reminder.php(217): Reminder::getEmailReminderInviteesRecipients(‘452b60b5-04db-c…’, true)
#2 /home/sitename/domains/subdomain/public_html/crm/modules/Activities/EmailReminder.php(97): Reminder::sendEmailReminders(Object(EmailReminder), Object(Administration))
#3 /home/sitename/domains/subdomain/public_html/crm/modules/Schedulers/_AddJobsHere.php(435): EmailReminder->process()
#4 /home/sitename/domains/subdomain in /home/sitename/domains/subdomain/public_html/crm/modules/Reminders/Reminder.php on line 471
PHP Notice: Unknown: SECURITY PROBLEM: insecure server advertised AUTH=PLAIN (errflg=1) in Unknown on line 0

You have a “Call” record which references an invitee that has a pending reminder. But that invitee doesn’t seem to exist (maybe you deleted it after the call was created). The code should handle this situation better, it’s a bug, but this might give you a clue to solve your FATAL

… or I could be wrong, I am really just throwing a quick guess here

That Invitee is me (I am also one of the System Administrator) I assigned it because I want to know that that Invitee will get the email reminder of the Call record or not, but I also didn’t receive email reminder as well.