2

I am using Magento ver. 1.9.1.0

The problem i am facing is whenever i am reindexing the data from magento admin it shows error like

There has been an error processing your request
SQLSTATE[HY000]: General error: 2006 MySQL server has gone away, query was: SELECT `core_flag`.* FROM `core_flag` WHERE (`core_flag`.`flag_code`='synchronize')

Trace:
#0 /home/ankitmidha02/public_html/lib/Varien/Db/Statement/Pdo/Mysql.php(110): Zend_Db_Statement_Pdo->_execute(Array)
#1 /home/ankitmidha02/public_html/app/code/core/Zend/Db/Statement.php(291): Varien_Db_Statement_Pdo_Mysql->_execute(Array)
#2 /home/ankitmidha02/public_html/lib/Zend/Db/Adapter/Abstract.php(480): Zend_Db_Statement->execute(Array)
#3 /home/ankitmidha02/public_html/lib/Zend/Db/Adapter/Pdo/Abstract.php(238): Zend_Db_Adapter_Abstract->query('SELECT `core_fl...', Array)
#4 /home/ankitmidha02/public_html/lib/Varien/Db/Adapter/Pdo/Mysql.php(428): Zend_Db_Adapter_Pdo_Abstract->query('SELECT `core_fl...', Array)
#5 /home/ankitmidha02/public_html/lib/Zend/Db/Adapter/Abstract.php(756): Varien_Db_Adapter_Pdo_Mysql->query(Object(Varien_Db_Select), Array)
#6 /home/ankitmidha02/public_html/app/code/core/Mage/Core/Model/Resource/Db/Abstract.php(380): Zend_Db_Adapter_Abstract->fetchRow(Object(Varien_Db_Select))
#7 /home/ankitmidha02/public_html/app/code/core/Mage/Core/Model/Abstract.php(225): Mage_Core_Model_Resource_Db_Abstract->load(Object(Mage_Core_Model_File_Storage_Flag), 'synchronize', 'flag_code')
#8 /home/ankitmidha02/public_html/app/code/core/Mage/Core/Model/Flag.php(119): Mage_Core_Model_Abstract->load('synchronize', 'flag_code')
#9 /home/ankitmidha02/public_html/app/code/core/Mage/Core/Model/File/Storage.php(84): Mage_Core_Model_Flag->loadSelf()
#10 /home/ankitmidha02/public_html/app/code/core/Mage/Core/Model/Observer.php(61): Mage_Core_Model_File_Storage->getSyncFlag()
#11 /home/ankitmidha02/public_html/app/code/core/Mage/Core/Model/App.php(1338): Mage_Core_Model_Observer->addSynchronizeNotification(Object(Varien_Event_Observer))
#12 /home/ankitmidha02/public_html/app/code/core/Mage/Core/Model/App.php(1317): Mage_Core_Model_App->_callObserverMethod(Object(Mage_Core_Model_Observer), 'addSynchronizeN...', Object(Varien_Event_Observer))
#13 /home/ankitmidha02/public_html/app/Mage.php(448): Mage_Core_Model_App->dispatchEvent('controller_acti...', Array)
#14 /home/ankitmidha02/public_html/app/code/core/Mage/Core/Controller/Varien/Action.php(529): Mage::dispatchEvent('controller_acti...', Array)
#15 /home/ankitmidha02/public_html/app/code/core/Mage/Adminhtml/Controller/Action.php(160): Mage_Core_Controller_Varien_Action->preDispatch()
#16 /home/ankitmidha02/public_html/app/code/core/Mage/Core/Controller/Varien/Action.php(407): Mage_Adminhtml_Controller_Action->preDispatch()
#17 /home/ankitmidha02/public_html/app/code/core/Mage/Core/Controller/Varien/Router/Standard.php(250): Mage_Core_Controller_Varien_Action->dispatch('index')
#18 /home/ankitmidha02/public_html/app/code/core/Mage/Core/Controller/Varien/Front.php(172): Mage_Core_Controller_Varien_Router_Standard->match(Object(Mage_Core_Controller_Request_Http))
#19 /home/ankitmidha02/public_html/app/code/core/Mage/Core/Model/App.php(354): Mage_Core_Controller_Varien_Front->dispatch()
#20 /home/ankitmidha02/public_html/app/Mage.php(684): Mage_Core_Model_App->run(Array)
#21 /home/ankitmidha02/public_html/index.php(87): Mage::run('', 'store')
#22 {main}

Due to this, site loads so slowly. What is the reason for this and how can I solve this?

Anthon
  • 69,918
  • 32
  • 186
  • 246
Prince
  • 401
  • 1
  • 7
  • 34
  • What kind of informative error is this `2006 MySQL server has gone away` ? – Abhinav Gauniyal May 30 '15 at 10:31
  • http://stackoverflow.com/questions/7942154/mysql-error-2006-mysql-server-has-gone-away – ekenman May 30 '15 at 10:35
  • check var/locks and remove all files and then try to reindex – Deepak Mankotia May 30 '15 at 11:06
  • There is no any locks folder exist in var folder – Prince May 30 '15 at 11:08
  • 1
    http://stackoverflow.com/questions/10474922/error-2006-hy000-mysql-server-has-gone-away - Always breaks down to a group of things, 1) max_allowed_packet set too low, 2) need to increase certain timeouts for MySQL, 3) inadequate server hardware can't keep up with the load, 4) not enough memory allocated to MySQL, 5) extreme misconfiguration of MySQL, 6) you're running on a shared server and your hosting provider is forcing Magento to play nice with others. In the end, basically, you have a MySQL query that's timing out. – Fiasco Labs May 30 '15 at 15:18

1 Answers1

0

I had this same problem, so I change this configuration to up of according to of my server capacity.

innodb_lock_wait_timeout
key_buffer 
max_allowed_packet  
thread_stack   
thread_cache_size
innodb_buffer_pool_size
Rafael Corrêa Gomes
  • 1,751
  • 1
  • 22
  • 31