skip to Main Content

We have a Magento website that works as expected. We are at the optimization point and are trying to run our caches. We navigate to the index manager and receive the following:

SQLSTATE[HY000]: General error: 2006 MySQL server has gone away, query was: SELECT main_table.*, process_event.status AS process_event_status FROM index_event AS main_table
INNER JOIN index_process_event AS process_event ON process_event.event_id=main_table.event_id WHERE (process_event.process_id = ‘5’) AND (process_event.status = ‘new’)

#0 /var/www/html/blue/lib/Varien/Db/Statement/Pdo/Mysql.php(110): Zend_Db_Statement_Pdo->_execute(Array)
#1 /var/www/html/blue/app/code/core/Zend/Db/Statement.php(291): Varien_Db_Statement_Pdo_Mysql->_execute(Array)
#2 /var/www/html/blue/lib/Zend/Db/Adapter/Abstract.php(480): Zend_Db_Statement->execute(Array)
#3 /var/www/html/blue/lib/Zend/Db/Adapter/Pdo/Abstract.php(238): Zend_Db_Adapter_Abstract->query('SELECT `main_ta...', Array)
#4 /var/www/html/blue/lib/Varien/Db/Adapter/Pdo/Mysql.php(504): Zend_Db_Adapter_Pdo_Abstract->query('SELECT `main_ta...', Array)
#5 /var/www/html/blue/lib/Zend/Db/Adapter/Abstract.php(737): Varien_Db_Adapter_Pdo_Mysql->query('SELECT `main_ta...', Array)
#6 /var/www/html/blue/lib/Varien/Data/Collection/Db.php(740): Zend_Db_Adapter_Abstract->fetchAll('SELECT `main_ta...', Array)
#7 /var/www/html/blue/app/code/core/Mage/Core/Model/Resource/Db/Collection/Abstract.php(521): Varien_Data_Collection_Db->_fetchAll('SELECT `main_ta...', Array)
#8 /var/www/html/blue/lib/Varien/Data/Collection/Db.php(572): Mage_Core_Model_Resource_Db_Collection_Abstract->getData()
#9 /var/www/html/blue/lib/Varien/Data/Collection.php(752): Varien_Data_Collection_Db->load()
#10 /var/www/html/blue/app/code/core/Mage/Index/Block/Adminhtml/Process/Grid.php(84): Varien_Data_Collection->count()
#11 /var/www/html/blue/app/code/core/Mage/Adminhtml/Block/Widget/Grid.php(551): Mage_Index_Block_Adminhtml_Process_Grid->_afterLoadCollection()
#12 /var/www/html/blue/app/code/core/Mage/Index/Block/Adminhtml/Process/Grid.php(64): Mage_Adminhtml_Block_Widget_Grid->_prepareCollection()
#13 /var/www/html/blue/app/code/core/Mage/Adminhtml/Block/Widget/Grid.php(643): Mage_Index_Block_Adminhtml_Process_Grid->_prepareCollection()
#14 /var/www/html/blue/app/code/core/Mage/Adminhtml/Block/Widget/Grid.php(649): Mage_Adminhtml_Block_Widget_Grid->_prepareGrid()
#15 /var/www/html/blue/app/code/core/Mage/Core/Block/Abstract.php(922): Mage_Adminhtml_Block_Widget_Grid->_beforeToHtml()
#16 /var/www/html/blue/app/code/core/Mage/Core/Block/Abstract.php(641): Mage_Core_Block_Abstract->toHtml()
#17 /var/www/html/blue/app/code/core/Mage/Core/Block/Abstract.php(585): Mage_Core_Block_Abstract->_getChildHtml('grid', true)
#18 /var/www/html/blue/app/code/core/Mage/Adminhtml/Block/Widget/Grid/Container.php(77): Mage_Core_Block_Abstract->getChildHtml('grid')
#19 /var/www/html/blue/app/design/adminhtml/default/default/template/widget/grid/container.phtml(36): Mage_Adminhtml_Block_Widget_Grid_Container->getGridHtml()
#20 /var/www/html/blue/app/code/core/Mage/Core/Block/Template.php(241): include('/var/www/html/b...')
#21 /var/www/html/blue/app/code/core/Mage/Core/Block/Template.php(272): Mage_Core_Block_Template->fetchView('adminhtml/defau...')
#22 /var/www/html/blue/app/code/core/Mage/Core/Block/Template.php(286): Mage_Core_Block_Template->renderView()
#23 /var/www/html/blue/app/code/core/Mage/Adminhtml/Block/Template.php(81): Mage_Core_Block_Template->_toHtml()
#24 /var/www/html/blue/app/code/core/Mage/Adminhtml/Block/Widget/Container.php(308): Mage_Adminhtml_Block_Template->_toHtml()
#25 /var/www/html/blue/app/code/core/Mage/Core/Block/Abstract.php(923): Mage_Adminhtml_Block_Widget_Container->_toHtml()
#26 /var/www/html/blue/app/code/core/Mage/Core/Block/Text/List.php(43): Mage_Core_Block_Abstract->toHtml()
#27 /var/www/html/blue/app/code/core/Mage/Core/Block/Abstract.php(923): Mage_Core_Block_Text_List->_toHtml()
#28 /var/www/html/blue/app/code/core/Mage/Core/Block/Abstract.php(641): Mage_Core_Block_Abstract->toHtml()
#29 /var/www/html/blue/app/code/core/Mage/Core/Block/Abstract.php(585): Mage_Core_Block_Abstract->_getChildHtml('content', true)
#30 /var/www/html/blue/app/design/adminhtml/default/default/template/page.phtml(74): Mage_Core_Block_Abstract->getChildHtml('content')
#31 /var/www/html/blue/app/code/core/Mage/Core/Block/Template.php(241): include('/var/www/html/b...')
#32 /var/www/html/blue/app/code/core/Mage/Core/Block/Template.php(272): Mage_Core_Block_Template->fetchView('adminhtml/defau...')
#33 /var/www/html/blue/app/code/core/Mage/Core/Block/Template.php(286): Mage_Core_Block_Template->renderView()
#34 /var/www/html/blue/app/code/core/Mage/Adminhtml/Block/Template.php(81): Mage_Core_Block_Template->_toHtml()
#35 /var/www/html/blue/app/code/core/Mage/Core/Block/Abstract.php(923): Mage_Adminhtml_Block_Template->_toHtml()
#36 /var/www/html/blue/app/code/core/Mage/Core/Model/Layout.php(555): Mage_Core_Block_Abstract->toHtml()
#37 /var/www/html/blue/app/code/core/Mage/Core/Controller/Varien/Action.php(390): Mage_Core_Model_Layout->getOutput()
#38 /var/www/html/blue/app/code/core/Mage/Index/controllers/Adminhtml/ProcessController.php(55): Mage_Core_Controller_Varien_Action->renderLayout()
#39 /var/www/html/blue/app/code/core/Mage/Core/Controller/Varien/Action.php(418): Mage_Index_Adminhtml_ProcessController->listAction()
#40 /var/www/html/blue/app/code/core/Mage/Core/Controller/Varien/Router/Standard.php(254): Mage_Core_Controller_Varien_Action->dispatch('list')
#41 /var/www/html/blue/app/code/core/Mage/Core/Controller/Varien/Front.php(172): Mage_Core_Controller_Varien_Router_Standard->match(Object(Mage_Core_Controller_Request_Http))
#42 /var/www/html/blue/app/code/core/Mage/Core/Model/App.php(365): Mage_Core_Controller_Varien_Front->dispatch()
#43 /var/www/html/blue/app/Mage.php(683): Mage_Core_Model_App->run(Array)
#44 /var/www/html/blue/index.php(84): Mage::run('', 'store')
#45 {main}

To resolve, we’ve attempted fiddling with the my.cnf settings. The latest iteration:

max_allowed_packet = 8G

connect_timeout = 120

I’ve tried updating MySQL, restarting the server, restarting MySQL. Thoughts?

2

Answers


  1. We too had exact issue during indexing. After changing the values as below,

    max_allowed_packet=4000M
    wait_timeout=6000
    table_open_cache=250
    innodb-log-file-size = 2047M
    innodb-log-buffer-size = 32M
    

    in my.cnf, we were able to resolve this issue.

    References:

    1. http://www.magentoformat.com/magento-2-mysql-server-has-gone-away-fix/
    2. https://magento.stackexchange.com/questions/93835/magento-2-migration-tool-mysql-server-has-gone-away
    Login or Signup to reply.
  2. Please add settings given below in your server’s my.cnf file.
    sql_mode=NO_ENGINE_SUBSTITUTION,STRICT_TRANS_TABLES

    auto_increment_increment = 3

    table_open_cache = 250

    wait_timeout = 7200

    reconnect = 1

    max_allowed_packet=4000M

    innodb_file_per_table = off

    innodb-log-file-size = 2047M

    innodb-log-buffer-size = 32M

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search