Mysqli Error When Trying to Send E-Mail

yavuz

Well-known member
Hi,

I'm getting an error when I try to send mass e-mail to users. Sending it to for example to an administrative usergroup does work. It happens when include all usergroups.

Code:
An exception occurred: Mysqli prepare error: MySQL server has gone away in /home/user/public_html/library/Zend/Db/Statement/Mysqli.php on line 77

  1. Zend_Db_Statement_Mysqli->_prepare() in Zend/Db/Statement.php at line 115
  2. Zend_Db_Statement->__construct() in Zend/Db/Adapter/Mysqli.php at line 381
  3. Zend_Db_Adapter_Mysqli->prepare() in Zend/Db/Adapter/Abstract.php at line 478
  4. Zend_Db_Adapter_Abstract->query() in XenForo/Model.php at line 218
  5. XenForo_Model->fetchAllKeyed() in XenForo/Model/RoutePrefix.php at line 24
  6. XenForo_Model_RoutePrefix->getPrefixesByRouteType() in XenForo/Model/RoutePrefix.php at line 37
  7. XenForo_Model_RoutePrefix->getPrefixesForRouteCache() in XenForo/Link.php at line 389
  8. XenForo_Link::_loadHandlerInfoForGroup() in XenForo/Link.php at line 306
  9. XenForo_Link::_getPrefixHandler() in XenForo/Link.php at line 272
  10. XenForo_Link::_buildLink() in XenForo/Link.php at line 81
  11. XenForo_Link::buildPublicLink() in XenForo/Dependencies/Admin.php at line 180
  12. XenForo_Dependencies_Admin->getEffectiveContainerParams() in XenForo/FrontController.php at line 563
  13. XenForo_FrontController->renderView() in XenForo/FrontController.php at line 156
  14. XenForo_FrontController->run() in /home/user/public_html/admin.php at line 13
 
Looks like it's taking longer than the MySQL time out to send the emails. Are you using SMTP or local email sending? I generally recommend local/PHP default emailing as it tends to be much faster.

The only workaround would be to drop the number of emails per page, though I'm not sure if we actually expose that through the interface.
 
Looks like it's taking longer than the MySQL time out to send the emails. Are you using SMTP or local email sending? I generally recommend local/PHP default emailing as it tends to be much faster.

The only workaround would be to drop the number of emails per page, though I'm not sure if we actually expose that through the interface.

It's the default one Mike, usally prefer it that way. The website is on a VPS and propably mysql can't handle it. It would be a nice to have an option to limit the instance. If I'm not mistaken it sends 50 e-mails per batch.
 
You could up the wait_timeout value in your MySQL config to workaround it. By default, it's 86400 which is ridiculously long. Right now, I'm guessing it's something like 30. 120 (ie, 2 minutes) would be reasonable and help avoid some issues such as this - even 900 (15 minutes) wouldn't have too much of an issue.
 
You could up the wait_timeout value in your MySQL config to workaround it. By default, it's 86400 which is ridiculously long. Right now, I'm guessing it's something like 30. 120 (ie, 2 minutes) would be reasonable and help avoid some issues such as this - even 900 (15 minutes) wouldn't have too much of an issue.

Yes, I upped the wait_timeout value to 900 and it sends now. Thanks Mike :)
 
I'm getting same error cept i get it even trying to send a Test Email... I'm am using Google SMTP Service, because the default service for me would only send to about 10 - 20 of my 200 users.
 
yavuz, as your member base grows you will definitely need to look for an other way to send mails :)
Use an email sending service or buy some newsletter software (either locally installed or on your server).
 
Top Bottom