Need to solve SMTP problem with 1and1

When I try to send a test email, the resulting error is in three parts.

Tue Oct 31 20:51:40 2017 [15986][1][FATAL] SugarPHPMailer encountered an error: An outgoing mail server is not configured to send emails. Please configure an outgoing mail server or select an outgoing mail server for the mail account that you are using in Settings >> Mail Account.
Tue Oct 31 20:51:40 2017 [15986][1][FATAL] SugarPHPMailer encountered an error: SMTP connect() failed.
Tue Oct 31 20:51:40 2017 [18577][-none-][FATAL] Retrieving record by id users:1 found Query Failed: SELECT users.* FROM users WHERE = ‘1’ AND users.deleted=0 LIMIT 0,1: MySQL error 2006: MySQL server has gone away

I have to assume these errors are all related based on the timestamp of their creation. Since the crontab edit did not fix this, do you want to try something else?

How did you set the timezone? Was it with the command-line parameter? I’d like to have a confirmation if that works.

The SMTP errors we can handle on the other thread.

The “SQL has gone away” error is problematic, it’s SQL crashing or timing out. I sure hope it disappears when you fix the SMTP problems, if not, you’ll have to check your database setup, corruption, rebuild indexes, etc.

I fixed the time zone error by changing what PHP version I use in the Cronjob. I switched to the 7.x…

Sorry, I have to reopen this thread. As I resumed troubleshooting this morning I realized there was a typo in my crontab and the timezone error did not go away, the cronjob simply was not running. Upon resuming the cronjob, the error reappeared, so I loaded a new php.ini file in the root directory and changed some settings to confirm Suite was pulling the right information. I changed my max post size and the diagnostic tool picked up the change immediately, so I know it is seeing the correct PHP configuration. With that said, the time zone is set correctly in the file, but SuiteCRM is still throwing the error. I tried manually passing the timezone variable in the crontab, as you suggested, but that did not fix the error.

Back to the drawing board…

Can you please post your complete cronjob command?

And the result of this in the command-line:

which php

I’m using the cron command recommended by my hosting service. 1and1 requires the entire path to PHP, so my command reads as follows.

# * * * * *  usr/bin/php7.1-cli -d date.timezone="America/New_York" /path/to/root/folder/cron.php > /dev/null 2>&1

When I run the command manually there are no errors. The only reason I know there is an error is that the timezone error shows in the logs.

You’re missing the “-f” switch before the script file name. You’re also missing the cd command. It should be

* * * * * cd /path/to/suitecrm/folder/; usr/bin/php7.1-cli -d date.timezone="America/New_York" -f /path/to/root/folder/cron.php > /dev/null 2>&1

Also, remove the # from the beginning if you want it to run.

1 Like

It still shows the same error. I’ve tried this version before as well. I tried it again to make sure, but it’s still the same error.

You should really just annoy your hosting provider until you get an answer.

  • SuiteCRM needs PHP to run.
  • PHP needs a timezone setting to run correctly.
  • You set that in php.ini, it’s really easy
  • now your hosting blocks your access to php.ini, so they give you some other mechanism for the web server PHP
  • but they neglect to create a similar scheme for the CLI PHP, which you need for cron jobs, but most people don’t need at all
  • so you need to complain to your hosting, ask them how to do it… or change to a better one