1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Mysqli Error When Trying to Send E-Mail

Discussion in 'Troubleshooting and Problems' started by yavuz, May 1, 2011.

  1. yavuz

    yavuz Well-Known Member


    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.

    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
    Perspektif likes this.
  2. Brogan

    Brogan XenForo Moderator Staff Member

    How many users are you trying to send to?
  3. yavuz

    yavuz Well-Known Member

    About 8000 members.
  4. Wuebit

    Wuebit Well-Known Member

    what php are you on?
  5. yavuz

    yavuz Well-Known Member

    PHP version 5.2.16
    MySQL version 5.0.92-community
  6. Mike

    Mike XenForo Developer Staff Member

    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.
  7. yavuz

    yavuz Well-Known Member

    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.
  8. Mike

    Mike XenForo Developer Staff Member

    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.
  9. yavuz

    yavuz Well-Known Member

    Yes, I upped the wait_timeout value to 900 and it sends now. Thanks Mike :)
  10. Ablac

    Ablac Active Member

    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.
  11. Walter

    Walter Well-Known Member

    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).
    yavuz likes this.

Share This Page