XF 1.5 Zend_Db_Adapter_Mysqli_Exception: MySQL server has gone away


Well-known member
This isn't a reoccurring error, it just showed up once on the error log. But it's the second time such a lone error has shown up (the other one was 3 days back, just 1 single error). I ignored it, since a single error in most cases is harmless. But since it's occurred the second time, I thought I'd just get ideas as to why such an error is popping up.

There is no indication of a MySQL crash or service stopping when this error pops up.

Error Info
Zend_Db_Adapter_Mysqli_Exception: MySQL server has gone away - library/Zend/Db/Adapter/Mysqli.php:333
Generated By: Unknown Account, Today at 1:07 PM

Stack Trace
#0 /home/xxxxxx/public_html/library/Zend/Db/Adapter/Abstract.php(315): Zend_Db_Adapter_Mysqli->_connect()
#1 /home/xxxxxx/public_html/library/XenForo/Application.php(730): Zend_Db_Adapter_Abstract->getConnection()
#2 /home/xxxxxx/public_html/library/XenForo/Application.php(973): XenForo_Application->loadDb(Object(Zend_Config))
#3 /home/xxxxxx/public_html/library/XenForo/Application.php(1004): XenForo_Application->lazyLoad('db', NULL)
#4 /home/xxxxxx/public_html/library/XenForo/Application.php(1632): XenForo_Application::get('db')
#5 /home/xxxxxx/public_html/library/XenForo/Model.php(161): XenForo_Application::getDb()
#6 /home/xxxxxx/public_html/library/XenForo/Model/DataRegistry.php(138): XenForo_Model->_getDb()
#7 /home/xxxxxx/public_html/library/XenForo/Model/DataRegistry.php(97): XenForo_Model_DataRegistry->_getMultiFromDb(Array)
#8 /home/xxxxxx/public_html/library/XenForo/Dependencies/Abstract.php(147): XenForo_Model_DataRegistry->getMulti(Array)
#9 /home/xxxxxx/public_html/library/XenForo/FrontController.php(127): XenForo_Dependencies_Abstract->preLoadData()
#10 /home/xxxxxx/public_html/index.php(13): XenForo_FrontController->run()
#11 {main}

Request State
array(3) {
  ["url"] => string(47) "https://orojackson.com/login/csrf-token-refresh"
  ["_GET"] => array(0) {
  ["_POST"] => array(3) {
    ["_xfRequestUri"] => string(14) "/forums/manga/"
    ["_xfNoRedirect"] => string(1) "1"
    ["_xfResponseType"] => string(4) "json"


My suggestion is this - it's most likely due to the MySQL database timing out (i.e. a transaction took longer than your current timeout).
That it's only happened twice, days apart, probably means the current timeout is marginal, rather than 'wrong'.

Suggest you try increasing MySQL 'wait_timeout', I'd try 50% longer to check this out, and keep watching the server error log for the next few days.

Look for something like "SET wait_timeout=28800"
(your value will likely be lower than 28800 which is my current setting when doing mysqldumps via cron jobs, which take 6-ish minutes and are high-CPU tasks so used to exceed the older timeout value)