Email reminders not sending

Good afternoon,

I installed the Bitnami SuiteCRM package on Azure yesterday. The installation and setup went fine, and most of it seems to be running OK. However, I’ve noticed that e-mail reminders are not being sent.

I’ve got SuiteCRM set up with my Office365 SMTP details, and I do receive e-mails when scheduling a meeting for instance. I just can’t get the reminders to send.

So far I’ve tried adding the following line to crontab in the ./etc folder, but it doesn’t seem to have worked:

          • cd /opt/bitnami/apps/suitecrm/htdocs; php -f cron.php > /dev/null 2>&1
            

I also tried this:

          • root cd /opt/bitnami/apps/suitecrm/htdocs; php -f cron.php > /dev/null 2>&1
            

I then tried performing the above steps manually, i.e. changed directory to “/opt/bitnami/apps/suitecrm/htdocs” and then ran “php -f cron.php > /dev/null 2>&1”, to no avail.

Does anybody know where the relevant logs might be stored (if any), in order to troubleshoot this issue? Or if I’ve missed a step somewhere?

Thanks,
Adriaan

Turns out the cron command is pretty complex/long winded for Bitnami.

We worked with them, and the command we got working was as follows:

          • su daemon -c “cd /opt/bitnami/apps/suitecrm/htdocs; /opt/bitnami/php/bin/php -f cron.php > /dev/null 2>&1”

Thanks,

Will.

1 Like

Hi Will,

Thank you very much for the suggested solution. I replaced the line in /etc/crontab with what you sent me, rebooted, but reminders were still not sending. So I considered whether the server hardening steps I applied earlier might be affecting things.

Therefore I fired up a brand new vanilla SuiteCRM install on Azure. I logged on, updated everything with apt-get, added the crontab info, rebooted. I then logged on to SuiteCRM, configured e-mail settings, created a contact and scheduled a call. The e-mail invitation was sent and received just fine, but again the e-mail reminder wasn’t sent. I checked the “Run Email Reminder Notifications” scheduled task, and it again stated “Last successful run: Never”.

Are there any other steps that I might have missed?

Thanks,
Adriaan

Sorry Will, ignore my last post. The reminders from the replacement install just started coming through!

Thanks again for your help,
Adriaan

I also have the Bitnami Install, and I found there is a difference between editing /etc/crontab, or using

sudo crontab -e

which is what really works.

The two things take me to two different files. The line that I add is the one given by Will above, and so far, it seems to be working.

Hi guys,

Sorry to have to come back to this post, but it seems that e-mails are actually not sending. I ran the following command:

sudo crontab -e

and added this line (the one mentioned earlier in this posting didn’t seem to work):

* * * * *  su daemon -s /bin/sh -c "cd /opt/bitnami/apps/suitecrm/htdocs; /opt/bitnami/php/bin/php -f cron.php > /dev/null 2>&1"

Since then the “Run Email Reminder Notifications” scheduled task seems to run according to the Job Log, however you’ll see that the “Last Successful Run” field still states “Never”.

I am still able to send meeting/call invitation emails OK, and the Accept/Decline actions are registered OK. Just the e-mail reminders refuse to send. Are there any specific logs that anybody knows of, where I can check what the cause might be?

Thanks,
Adriaan

I think I’m making some progress with this issue. I went to Admin > System Settings > View Log > All, and then searched for the word CRON.

This has revealed the following error messages:

Thu Apr  7 03:25:09 2016 [4145][1][FATAL] Job aaaefd64-bd60-3e16-5fad-57063574169d (Run Email Reminder Notifications) failed in CRON run

I suspect this may be a permissions issue, and will post my findings here later.

Getting worse! I tried to change permissions on the cron.php file, which didn’t work. Changed the permissions back to the way they were, but I now also get these:

Thu Apr  7 06:23:02 2016 [3005][1][FATAL] Scheduler cannot write PID file.  Please check permissions on cache/modules/Schedulers/lastrun

Ensure you’ve properly configured an SMTP Server. Send a Test Mail inside the SMTP Server configuration setup screen. Make a note of any error that is returned from the test.
Check your JIRA application log files and the application server log files for Out of Memory errors. Typically, the log file will show java.lang.OutOfMemoryError: Java heap space. This has been known to cause the service responsible for sending emails out to fail until JIRA applications are restarted. You should further troubleshoot your memory issues using this guide.
Check and ensure the Mail Queue Service is installed. Click Admininstration > Services to inspect that the service exists, and is set at a reasonable interval. This interval controls how frequently the mail queue is processed. You can flush the mail queue to send out pending messages immediately to your mail server.
Inspect your Mail Queue under Administration > Mail Queue. See if you are given the option to Bypass currently sending mail. A stuck email or trackback ping can hold up the queue.
Check that your Base URL is set to a domain / IP which your SMTP server will accept. Example: Google apps accounts must have a matching base url to their Google Apps domain.
Enable additional logging in Administration > System > Troubleshooting and Support > Logging and Profiling by setting the following to DEBUG to see more robust logging about services running at the background:
com.atlassian.jira.service
com.atlassian.jira.service.services.DebugService

Java training in chennai |
Android training in chennai |
Oracle dba Training in Chennai |
Python Training in chennai

Good morning Dwarak, and thank you very much for your suggestions. I’ve worked through them as follows:

  1. Test e-mail sends without problems. Also, I can send meeting requests via e-mail. (no errors)

  2. I was unable to find any logs with JIRA in the file name, however I did find logs in the following locations:


./var/cache/pollinate/log
./var/opt/microsoft/scx/log
./var/opt/omi/log
./var/log
./opt/bitnami/var/log
./opt/bitnami/php/var/log
./dev/log

Which one(s) should I be looking at?

  1. The Email queue is present and appears to be working (Admin > Email Queue). Nothing stuck in it though.

  2. The Base URL is a proper FQDN.

  3. In Admin > System Settings I’ve now set the Log Level to Debug and increased the maximum log size to 50MB

I’ll look through it again to see if anything sticks out.

Thanks,
Adriaan

PS: After setting the logging level to Debug, I took a copy of the log. I then tried to set it back to FATAL, but it wont budge. It remains stuck at Debug level. Any way to manually change it back to FATAL?

I did a restore of yesterday’s backup, and now the “Scheduler cannot write PID file” error is no longer there. However, the e-mail reminders job and “Run Report Generation Scheduled Tasks” jobs still fail. Having set the logging level to Debug has revealed a bit more information. Here is what I see now for the email reminders (we can ignore the Report Generation issue for now):


Fri Apr  8 05:38:02 2016 [35391][1][INFO] Query:UPDATE job_queue SET status='running', date_modified='2016-04-08 12:38:01', client='CRON05b962ae12ba2dc45cc0a100c22bab99:35391' WHERE id='ae45f783-59dd-c8f5-862a-5707a6286487' AND status='queued'

Fri Apr  8 05:38:02 2016 [35391][1][FATAL] Job ae45f783-59dd-c8f5-862a-5707a6286487 (Run Email Reminder Notifications) failed in CRON run
					SET `assigned_user_id`='1',`name`='Run Email Reminder Notifications',`date_modified`='2016-04-08 12:38:01',`scheduler_id`='31bd4130-c996-c891-823d-56c56757a640',`execute_time`='2016-04-08 12:38:00',`status`='done',`resolution`='failure',`message`='Recoverable Error [4096]: Argument 1 passed to Reminder::isDecline() must be an instance of SugarBean, boolean given, called in /opt/bitnami/apps/suitecrm/htdocs/modules/Reminders/Reminder.php on line 212 and defined in /opt/bitnami/apps/suitecrm/htdocs/modules/Reminders/Reminder.php on line 374\nRecoverable Error [4096]: Argument 1 passed to Reminder::testEventPersonAcceptStatus() must be an instance of SugarBean, boolean given, called in /opt/bitnami/apps/suitecrm/htdocs/modules/Reminders/Reminder.php on line 375 and defined in /opt/bitnami/apps/suitecrm/htdocs/modules/Reminders/Reminder.php on line 378\nRecoverable Error [4096]: Argument 1 passed to Reminder::getEventPersonAcceptStatus() must be an instance of SugarBean, boolean given, called in /opt/bitnami/apps/suitecrm/htdocs/modules/Reminders/Reminder.php on line 379 and defined in /opt/bitnami/apps/suitecrm/htdocs/modules/Reminders/Reminder.php on line 390\nRecoverable Error [4096]: Argument 1 passed to Reminder::isDecline() must be an instance of SugarBean, boolean given, called in /opt/bitnami/apps/suitecrm/htdocs/modules/Reminders/Reminder.php on line 212 and defined in /opt/bitnami/apps/suitecrm/htdocs/modules/Reminders/Reminder.php on line 374\nRecoverable Error [4096]: Argument 2 passed to Reminder::isDecline() must be an instance of SugarBean, boolean given, called in /opt/bitnami/apps/suitecrm/htdocs/modules/Reminders/Reminder.php on line 212 and defined in /opt/bitnami/apps/suitecrm/htdocs/modules/Reminders/Reminder.php on line 374\nRecoverable Error [4096]: Argument 1 passed to Reminder::testEventPersonAcceptStatus() must be an instance of SugarBean, boolean given, called in /opt/bitnami/apps/suitecrm/htdocs/modules/Reminders/Reminder.php on line 375 and defined in /opt/bitnami/apps/suitecrm/htdocs/modules/Reminders/Reminder.php on line 378\nRecoverable Error [4096]: Argument 2 passed to Reminder::testEventPersonAcceptStatus() must be an instance of SugarBean, boolean given, called in /opt/bitnami/apps/suitecrm/htdocs/modules/Reminders/Reminder.php on line 375 and defined in /opt/bitnami/apps/suitecrm/htdocs/modules/Reminders/Reminder.php on line 378\nRecoverable Error [4096]: Argument 1 passed to Reminder::getEventPersonAcceptStatus() must be an instance of SugarBean, boolean given, called in /opt/bitnami/apps/suitecrm/htdocs/modules/Reminders/Reminder.php on line 379 and defined in /opt/bitnami/apps/suitecrm/htdocs/modules/Reminders/Reminder.php on line 390\nRecoverable Error [4096]: Argument 2 passed to Reminder::getEventPersonAcceptStatus() must be an instance of SugarBean, boolean given, called in /opt/bitnami/apps/suitecrm/htdocs/modules/Reminders/Reminder.php on line 379 and defined in /opt/bitnami/apps/suitecrm/htdocs/modules/Reminders/Reminder.php on line 390\nRecoverable Error [4096]: Argument 1 passed to EmailReminder::sendReminders() must be an instance of SugarBean, boolean given, called in /opt/bitnami/apps/suitecrm/htdocs/modules/Reminders/Reminder.php on line 191 and defined in /opt/bitnami/apps/suitecrm/htdocs/modules/Activities/EmailReminder.php on line 128\nRecoverable Error [4096]: Argument 2 passed to EmailReminder::setReminderBody() must be an instance of SugarBean, boolean given, called in /opt/bitnami/apps/suitecrm/htdocs/modules/Activities/EmailReminder.php on line 167 and defined in /opt/bitnami/apps/suitecrm/htdocs/modules/Activities/EmailReminder.php on line 202\nRecoverable Error [4096]: Argument 1 passed to TimeDate::asUser() must be an instance of DateTime, null given, called in /opt/bitnami/apps/suitecrm/htdocs/modules/Activities/EmailReminder.php on line 209 and defined in /opt/bitnami/apps/suitecrm/htdocs/include/TimeDate.php on line 579\nRecoverable Error [4096]: Argument 1 passed to TimeDate::tzUser() must be an instance of DateTime, null given, called in /opt/bitnami/apps/suitecrm/htdocs/include/TimeDate.php on line 581 and defined in /opt/bitnami/apps/suitecrm/htdocs/include/TimeDate.php on line 880\nUnexpected failure, please check PHP logs and suitecrm.log\n',`target`='function::sendEmailReminders',`data`=NULL,`requeue`=0,`retry_count`=NULL,`failure_count`=1,`job_delay`=0,`client`='CRON05b962ae12ba2dc45cc0a100c22bab99:35391',`percent_complete`=NULL
					 WHERE  job_queue.id = 'ae45f783-59dd-c8f5-862a-5707a6286487' AND deleted=0

There’s a lot of talk in there about “SugarBean”, but I just don’t know how to troubleshoot this any further. Any suggestions please?

Thanks,
Adriaan

I can’t help with your specific issue, but since you ask about how to further troubleshoot this, the generic answer would be to set up a debugging environment and step through the code to see where it breaks, and why.

I often start with the error message found in the logs, search for it inside the SuiteCRM code base, then take up debugging from there.

If you don’t already have this, be warned, it might not be a very easy task to set it up. But the rewards are enormous and I’m sure you won’t regret it because, throughout your project, you’re going to get a LOT of answers and solutions from this.

You can look for tutorials on the net. My set up is with Eclipse on Windows, debugging remotely through XDEBUG into my Linux SuiteCRM server which lives inside a VM, so I can back it up and clone it as I wish. I use SSH Tunnels with putty to get the two machines to talk with each other. I map the remote files as a local drive using SFTP Net Drive Free.