2

Every morning we seem to have a problem where either the website (like right now) or the Admin panel are getting these "Exception printing is disabled" Errors. I looked up the number that this message refers to in public_html/var/report/163556439438 and it gives me the following: (would anyone know what the actual problem is?)

The hosting company says this:

There seems to be an issue with your Magento caching configuration. This is not a server issue but rather a scripting issue within your site. Please contact a web developer to assist you with this.

We can if you wish perform a restore if you have backups.


Error report:

a:4:{i:0;s:48:"SQLSTATE[HY000] [2002] No such file or directory";i:1;s:2950:"#0 /home/MYSHOP/public_html/lib/Zend/Db/Adapter/Pdo/Mysql.php(111): Zend_Db_Adapter_Pdo_Abstract->_connect() 
    #1 /home/ MYSHOP /public_html/lib/Varien/Db/Adapter/Pdo/Mysql.php(320): Zend_Db_Adapter_Pdo_Mysql->_connect()
    #2 /home/ MYSHOP /public_html/lib/Zend/Db/Adapter/Abstract.php(460): Varien_Db_Adapter_Pdo_Mysql->_connect()
    #3 /home/ MYSHOP /public_html/lib/Zend/Db/Adapter/Pdo/Abstract.php(238): Zend_Db_Adapter_Abstract->query('SET NAMES utf8', Array)
    #4 /home/ MYSHOP /public_html/lib/Varien/Db/Adapter/Pdo/Mysql.php(428): Zend_Db_Adapter_Pdo_Abstract->query('SET NAMES utf8', Array)
    #5 /home/ MYSHOP /public_html/app/code/core/Mage/Core/Model/Resource.php(179): Varien_Db_Adapter_Pdo_Mysql->query('SET NAMES utf8')
    #6 /home/ MYSHOP /public_html/app/code/core/Mage/Core/Model/Resource.php(110): Mage_Core_Model_Resource->_newConnection('pdo_mysql', Object(Mage_Core_Model_Config_Element))
    #7 /home/ MYSHOP/public_html/app/code/core/Mage/Core/Model/Resource/Db/Abstract.php(320): Mage_Core_Model_Resource->getConnection('core_write')
    #8 /home/ MYSHOP /public_html/app/code/core/Mage/Core/Model/Resource/Db/Abstract.php(350): Mage_Core_Model_Resource_Db_Abstract->_getConnection('write')
    #9 /home/ MYSHOP /public_html/app/code/core/Mage/Core/Model/Resource/Db/Abstract.php(335): Mage_Core_Model_Resource_Db_Abstract->_getWriteAdapter()
    #10 /home/ MYSHOP /public_html/app/code/core/Mage/Core/Model/Resource/Db/Abstract.php(360): Mage_Core_Model_Resource_Db_Abstract->_getReadAdapter()
    #11 /home/ MYSHOP /public_html/app/code/core/Mage/Core/Model/Resource/Db/Collection/Abstract.php(134): Mage_Core_Model_Resource_Db_Abstract->getReadConnection()
    #12 /home/ MYSHOP /public_html/app/code/core/Mage/Core/Model/Config.php(1348): Mage_Core_Model_Resource_Db_Collection_Abstract->__construct(Object(Mage_Core_Model_Resource_Website))
    #13 /home/ MYSHOP /public_html/app/code/core/Mage/Core/Model/Config.php(1380): Mage_Core_Model_Config->getModelInstance('core_resource/w...', Object(Mage_Core_Model_Resource_Website))
    #14 /home/ MYSHOP /public_html/app/Mage.php(491): Mage_Core_Model_Config->getResourceModelInstance('core/website_co...', Object(Mage_Core_Model_Resource_Website))
    #15 /home/ MYSHOP /public_html/app/code/core/Mage/Core/Model/Abstract.php(208): Mage::getResourceModel('core/website_co...', Object(Mage_Core_Model_Resource_Website))
    #16 /home/ MYSHOP /public_html/app/code/core/Mage/Core/Model/Abstract.php(213): Mage_Core_Model_Abstract->getResourceCollection()
    #17 /home/ MYSHOP /public_html/app/code/core/Mage/Core/Model/App.php(608): Mage_Core_Model_Abstract->getCollection()
    #18 /home/ MYSHOP /public_html/app/code/core/Mage/Core/Model/App.php(466): Mage_Core_Model_App->_initStores()
    #19 /home/ MYSHOP /public_html/app/code/core/Mage/Core/Model/App.php(349): Mage_Core_Model_App->_initCurrentStore('', 'store')
    #20 /home/ MYSHOP /public_html/app/Mage.php(684): Mage_Core_Model_App->run(Array)
    #21 /home/ MYSHOP /public_html/index.php(87): Mage::run('', 'store')
    #22 {main}";s:3:"url";s:1:"/";s:11:"script_name";s:10:"/index.php";}

Now it just shows the following Error on the front page of the Magento store:

here has been an error processing your request SQLSTATE[HY000] [2002] No such file or directory

Trace:

> #0 /home/ MYSHOP /public_html/lib/Zend/Db/Adapter/Pdo/Mysql.php(111): Zend_Db_Adapter_Pdo_Abstract->_connect()
> #1 /home/ MYSHOP /public_html/lib/Varien/Db/Adapter/Pdo/Mysql.php(320):
> Zend_Db_Adapter_Pdo_Mysql->_connect()
> #2 /home/ MYSHOP /public_html/lib/Zend/Db/Adapter/Abstract.php(460): Varien_Db_Adapter_Pdo_Mysql->_connect()
> #3 /home/ MYSHOP /public_html/lib/Zend/Db/Adapter/Pdo/Abstract.php(238):
> Zend_Db_Adapter_Abstract->query('SET NAMES utf8', Array)
> #4 /home/ MYSHOP /public_html/lib/Varien/Db/Adapter/Pdo/Mysql.php(428):
> Zend_Db_Adapter_Pdo_Abstract->query('SET NAMES utf8', Array)
> #5 /home/ MYSHOP /public_html/app/code/core/Mage/Core/Model/Resource.php(179):
> Varien_Db_Adapter_Pdo_Mysql->query('SET NAMES utf8')
> #6 /home/ MYSHOP /public_html/app/code/core/Mage/Core/Model/Resource.php(110):
> Mage_Core_Model_Resource->_newConnection('pdo_mysql',
> Object(Mage_Core_Model_Config_Element))
> #7 /home/ MYSHOP /public_html/app/code/core/Mage/Core/Model/Resource/Db/Abstract.php(320):
> Mage_Core_Model_Resource->getConnection('core_write')
> #8 /home/ MYSHOP /public_html/app/code/core/Mage/Core/Model/Resource/Db/Abstract.php(350):
> Mage_Core_Model_Resource_Db_Abstract->_getConnection('write')
> #9 /home/ MYSHOP /public_html/app/code/core/Mage/Core/Model/Resource/Db/Abstract.php(335):
> Mage_Core_Model_Resource_Db_Abstract->_getWriteAdapter()
> #10 /home/ MYSHOP /public_html/app/code/core/Mage/Core/Model/Resource/Db/Abstract.php(360):
> Mage_Core_Model_Resource_Db_Abstract->_getReadAdapter()
> #11 /home/ MYSHOP /public_html/app/code/core/Mage/Core/Model/Resource/Db/Collection/Abstract.php(134):
> Mage_Core_Model_Resource_Db_Abstract->getReadConnection()
> #12 /home/ MYSHOP /public_html/app/code/core/Mage/Core/Model/Config.php(1348):
> Mage_Core_Model_Resource_Db_Collection_Abstract->__construct(Object(Mage_Core_Model_Resource_Website))
> #13 /home/ MYSHOP /public_html/app/code/core/Mage/Core/Model/Config.php(1380):
> Mage_Core_Model_Config->getModelInstance('core_resource/w...',
> Object(Mage_Core_Model_Resource_Website))
> #14 /home/ MYSHOP /public_html/app/Mage.php(491): Mage_Core_Model_Config->getResourceModelInstance('core/website_co...',
> Object(Mage_Core_Model_Resource_Website))
> #15 /home/ MYSHOP /public_html/app/code/core/Mage/Core/Model/Abstract.php(208):
> Mage::getResourceModel('core/website_co...',
> Object(Mage_Core_Model_Resource_Website))
> #16 /home/ MYSHOP /public_html/app/code/core/Mage/Core/Model/Abstract.php(213):
> Mage_Core_Model_Abstract->getResourceCollection()
> #17 /home/ MYSHOP /public_html/app/code/core/Mage/Core/Model/App.php(608):
> Mage_Core_Model_Abstract->getCollection()
> #18 /home/ MYSHOP /public_html/app/code/core/Mage/Core/Model/App.php(466):
> Mage_Core_Model_App->_initStores()
> #19 /home/ MYSHOP /public_html/app/code/core/Mage/Core/Model/App.php(349):
> Mage_Core_Model_App->_initCurrentStore('', 'store')
> #20 /home/ MYSHOP /public_html/app/Mage.php(684): Mage_Core_Model_App->run(Array)
> #21 /home/ MYSHOP /public_html/index.php(87): Mage::run('', 'store')
> #22 {main}
> 
> Error log record number: 701571798971
  • Do you know that your server has the correct PDO MySQL extension installed correctly for PHP? This error looks a lot like that. – Robbie Averill Jun 19 '15 at 10:33
  • Now - the hosting company answered with the following (is that true you think?): this is a known issue with Magento installations, it is common that the Magento caching is not done on a temporary folder but the cached files get stuck creating errors in the log and increasing the load while other processes are being run, please follow the next steps: – Allysin Jun 19 '15 at 10:39
  • This looks very similar to another question you have posted. I also see that you recently considered upgrading your php version. It's likely that you forgot to install the extra PDO MySQL extension, and SOAP also, as well as the other php extensions that magneto requires – Robbie Averill Jun 19 '15 at 10:39
  • 1. Navigate to the "errors" folder. 2. Change local.xml.sample to local.xml You should now see a new list of crazy errors all over the Magento page - this is okay. 3. Open magento/lib/Zend/Cache/Backend/File.php and look for: protected $_options = array( 'cache_dir' => 'null', 4. Change it to: protected $_options = array( 'cache_dir' => 'tmp/', 5. Save it. Now the final step is to go create a tmp folder in the root Magento folder. – Allysin Jun 19 '15 at 10:40
  • That's only going to help you with logging. Useful, but not a fix. – Robbie Averill Jun 19 '15 at 10:41
5

If your server listed in app/etc/local.xml is localhost and this error appears in Magento's error log, but Magento still is running ok, then mysql was restarted and the socket /tmp/mysql.sock or whatever socket file is set up in my.cnf temporarily disappeared.

Because it's missing, the PDO mysql connector reports SQLSTATE[HY000] [2002] No such file or directory

If you are continually getting this error thrown and have no access to Magento aside from the Exception Error page, then mysql has crashed completely and you need your hosting provider to find out why and restart mysql.

Ref.

  • Hi Adarsh - thank you for your explanation - I think you are correct here - when the message comes up - it is on both - the front page of the store and also appears when trying to load or access the Admin panel. I restarted Apache and it did not help. Then - I restarted MySQL and it went away. BUT - this happens EVERY DAY around the same time of the day....Any ideas on how to fix this problem permanently? (restarting Apache or MySQL seems to be a temporary fix) THANK YOU! ;-) – Allysin Jun 19 '15 at 10:37
  • That means your mysql is not configured correctly. You should backup your database first and check mysql configuration thoroughly. – Adarsh Khatri Jun 19 '15 at 10:44
  • If this has helped, then please consider marking it right answer to help others. – Adarsh Khatri Jun 19 '15 at 12:25
  • This does seem like the right answer! The million dollar question though is - how to check if the MySQL is configured properly and what changes need to be made? I need specific steps to fix the problem. And yes - I agree with you - I think there are more people having this problem... – Allysin Jun 19 '15 at 13:15
  • That would be server question, I am afraid I don't have much experience with the mysql debug. – Adarsh Khatri Jun 20 '15 at 4:04

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.