I am getting the error below:
a:4:{i:0;s:48:"SQLSTATE[HY000] [2002] No such file or directory";i:1;s:2322:"#0 /home/blahblahblah/public_html/lib/Zend/Db/Adapter/Pdo/Mysql.php(96): Zend_Db_Adapter_Pdo_Abstract->_connect()
#1 /home/blahblahblah/public_html/lib/Varien/Db/Adapter/Pdo/Mysql.php(300): Zend_Db_Adapter_Pdo_Mysql->_connect()
#2 /home/blahblahblah/public_html/lib/Zend/Db/Adapter/Abstract.php(459): Varien_Db_Adapter_Pdo_Mysql->_connect()
#3 /home/blahblahblah/public_html/lib/Zend/Db/Adapter/Pdo/Abstract.php(238): Zend_Db_Adapter_Abstract->query('SET NAMES utf8', Array)
#4 /home/blahblahblah/public_html/lib/Varien/Db/Adapter/Pdo/Mysql.php(389): Zend_Db_Adapter_Pdo_Abstract->query('SET NAMES utf8', Array)
#5 /home/blahblahblah/public_html/app/code/core/Mage/Core/Model/Resource.php(169): Varien_Db_Adapter_Pdo_Mysql->query('SET NAMES utf8')
#6 /home/blahblahblah/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/blahblahblah/public_html/app/code/core/Mage/Core/Model/Resource/Db/Abstract.php(320): Mage_Core_Model_Resource->getConnection('core_read')
#8 /home/blahblahblah/public_html/app/code/core/Mage/Core/Model/Resource/Db/Abstract.php(335): Mage_Core_Model_Resource_Db_Abstract->_getConnection('read')
#9 /home/blahblahblah/public_html/app/code/core/Mage/Core/Model/Resource/Cache.php(53): Mage_Core_Model_Resource_Db_Abstract->_getReadAdapter()
#10 /home/blahblahblah/public_html/app/code/core/Mage/Core/Model/Cache.php(449): Mage_Core_Model_Resource_Cache->getAllOptions()
#11 /home/blahblahblah/public_html/app/code/core/Mage/Core/Model/Cache.php(491): Mage_Core_Model_Cache->_initOptions()
#12 /home/blahblahblah/public_html/app/code/core/Mage/Core/Model/App.php(1175): Mage_Core_Model_Cache->canUse('config')
#13 /home/blahblahblah/public_html/app/code/core/Mage/Core/Model/Config.php(414): Mage_Core_Model_App->useCache('config')
#14 /home/blahblahblah/public_html/app/code/core/Mage/Core/Model/Config.php(294): Mage_Core_Model_Config->_canUseCacheForInit()
#15 /home/blahblahblah/public_html/app/code/core/Mage/Core/Model/App.php(408): Mage_Core_Model_Config->loadModulesCache()
#16 /home/blahblahblah/public_html/app/code/core/Mage/Core/Model/App.php(338): Mage_Core_Model_App->_initModules()
#17 /home/blahblahblah/public_html/app/Mage.php(640): Mage_Core_Model_App->run(Array)
#18 /home/blahblahblah/public_html/index.php(128): Mage::run('', 'store')
#19 {main}";s:3:"url";s:1:"/";s:11:"script_name";s:10:"/index.php";}
I have checked that /home/blahblahblah/public_html/lib/Zend/Db/Adapter/Pdo/Mysql.php exists and the permissions to all directories leading up to it are 755 with the file being set at 644.
I have done everything I can think of maybe someone else has a clue on what else would cause this?
I also forgot to mention that file ownership belongs to the correct user also. I used rSync to move the entire directory over to a new server. The installation on the server I pulled it from is working fine.
It seems you try to connect to mysql via a socket and that fails. Is Mysql running right and is your configuration right.
The error is coming from the file you did mention, so that isn't the problem, Magento does see that file.
Solution
Try using an IP to connect to Mysql. Or check if your mysql-socket is right.
Related
I am having an issue with a Magento migration, I was developing a theme and uploading some products, everything works normal.
The problem is when I try to move the ecosystem from dev to prod, I cloned an Amazon EC2 Instance and an Amazon RDS db, then in the prod instance I point the database to the prod instance and it stops working. I change the db details on app/etc/local.xml, I removed cache and session, and it keeps showing
a:4:{i:0;s:43:"SQLSTATE[HY000] [2002] Connection timed out";i:1;s:2493:"#0 /opt/bitnami/apache2/htdocs/lib/Zend/Db/Adapter/Pdo/Mysql.php(111): Zend_Db_Adapter_Pdo_Abstract->_connect()
#1 /opt/bitnami/apache2/htdocs/lib/Varien/Db/Adapter/Pdo/Mysql.php(396): Zend_Db_Adapter_Pdo_Mysql->_connect()
#2 /opt/bitnami/apache2/htdocs/lib/Zend/Db/Adapter/Abstract.php(460): Varien_Db_Adapter_Pdo_Mysql->_connect()
#3 /opt/bitnami/apache2/htdocs/lib/Zend/Db/Adapter/Pdo/Abstract.php(238): Zend_Db_Adapter_Abstract->query('SET NAMES utf8', Array)
#4 /opt/bitnami/apache2/htdocs/lib/Varien/Db/Adapter/Pdo/Mysql.php(504): Zend_Db_Adapter_Pdo_Abstract->query('SET NAMES utf8', Array)
#5 /opt/bitnami/apache2/htdocs/app/code/core/Mage/Core/Model/Resource.php(179): Varien_Db_Adapter_Pdo_Mysql->query('SET NAMES utf8')
#6 /opt/bitnami/apache2/htdocs/app/code/core/Mage/Core/Model/Resource.php(110): Mage_Core_Model_Resource->_newConnection('pdo_mysql', Object(Mage_Core_Model_Config_Element))
#7 /opt/bitnami/apache2/htdocs/app/code/core/Mage/Core/Model/Resource/Db/Abstract.php(320): Mage_Core_Model_Resource->getConnection('core_write')
#8 /opt/bitnami/apache2/htdocs/app/code/core/Mage/Core/Model/Resource/Db/Abstract.php(350): Mage_Core_Model_Resource_Db_Abstract->_getConnection('write')
#9 /opt/bitnami/apache2/htdocs/app/code/core/Mage/Core/Model/Resource/Db/Abstract.php(335): Mage_Core_Model_Resource_Db_Abstract->_getWriteAdapter()
#10 /opt/bitnami/apache2/htdocs/app/code/core/Mage/Core/Model/Resource/Cache.php(53): Mage_Core_Model_Resource_Db_Abstract->_getReadAdapter()
#11 /opt/bitnami/apache2/htdocs/app/code/core/Mage/Core/Model/Cache.php(478): Mage_Core_Model_Resource_Cache->getAllOptions()
#12 /opt/bitnami/apache2/htdocs/app/code/core/Mage/Core/Model/Cache.php(520): Mage_Core_Model_Cache->_initOptions()
#13 /opt/bitnami/apache2/htdocs/app/code/core/Mage/Core/Model/App.php(1202): Mage_Core_Model_Cache->canUse('config')
#14 /opt/bitnami/apache2/htdocs/app/code/core/Mage/Core/Model/Config.php(414): Mage_Core_Model_App->useCache('config')
#15 /opt/bitnami/apache2/htdocs/app/code/core/Mage/Core/Model/Config.php(294): Mage_Core_Model_Config->_canUseCacheForInit()
#16 /opt/bitnami/apache2/htdocs/app/code/core/Mage/Core/Model/App.php(424): Mage_Core_Model_Config->loadModulesCache()
#17 /opt/bitnami/apache2/htdocs/app/code/core/Mage/Core/Model/App.php(354): Mage_Core_Model_App->_initModules()
#18 /opt/bitnami/apache2/htdocs/app/Mage.php(684): Mage_Core_Model_App->run(Array)
#19 /opt/bitnami/apache2/htdocs/index.php(83): Mage::run('', 'store')
#20 {main}";s:3:"url";s:1:"/";s:11:"script_name";s:10:"/index.php";}
Everything works normal with the prod instance pointing to dev db instance
PROD Bitnami is a copy of DEV Bitnami
PROD RDS DB is a restored snapshot of DEV RDS DB
I uploaded an already working database to Google Cloud SQL and I changed config.xml and local.xml. The connection data I filled in is working. I also tried the connection to the Google Cloud SQL database with a wordpress testversion. It has to be something else.
config.xml like:
<host>google cloud server ip</host>
<username>root</username>
<password>mypassword</password>
<dbname>magento</dbname>
<model>mysql4</model>
<initStatements>SET NAMES utf8</initStatements>
<type>pdo_mysql</type>
<active>0</active>
local.xml like:
<host><![CDATA[google cloud server ip]]></host>
<username><![CDATA[root]]></username>
<password><![CDATA[mypassword]]></password>
<dbname><![CDATA[magento<]]></dbname>
<initStatements><![CDATA[SET NAMES utf8]]></initStatements>
<model><![CDATA[mysql4]]></model>
<type><![CDATA[pdo_mysql]]></type>
<active>1</active>
I get 2 different errors:
SQLSTATE[HY000] [2002] Connection refused
SQLSTATE[HY000] [2002] Connection timeout
with this message:
#0 /html/copy_hzlbio/var/www/vhosts/live_magento/htdocs/lib/Zend/Db/Adapter/Pdo/Mysql.php(96): Zend_Db_Adapter_Pdo_Abstract->_connect()
#1 /html/copy_hzlbio/var/www/vhosts/live_magento/htdocs/lib/Varien/Db/Adapter/Pdo/Mysql.php(320): Zend_Db_Adapter_Pdo_Mysql->_connect()
#2 /html/copy_hzlbio/var/www/vhosts/live_magento/htdocs/lib/Zend/Db/Adapter/Abstract.php(459): Varien_Db_Adapter_Pdo_Mysql->_connect()
#3 /html/copy_hzlbio/var/www/vhosts/live_magento/htdocs/lib/Zend/Db/Adapter/Pdo/Abstract.php(238): Zend_Db_Adapter_Abstract->query('SET NAMES utf8', Array)
#4 /html/copy_hzlbio/var/www/vhosts/live_magento/htdocs/lib/Varien/Db/Adapter/Pdo/Mysql.php(428): Zend_Db_Adapter_Pdo_Abstract->query('SET NAMES utf8', Array)
#5 /html/copy_hzlbio/var/www/vhosts/live_magento/htdocs/app/code/core/Mage/Core/Model/Resource.php(169): Varien_Db_Adapter_Pdo_Mysql->query('SET NAMES utf8')
#6 /html/copy_hzlbio/var/www/vhosts/live_magento/htdocs/app/code/core/Mage/Core/Model/Resource.php(110): Mage_Core_Model_Resource->_newConnection('pdo_mysql', Object(Mage_Core_Model_Config_Element))
#7 /html/copy_hzlbio/var/www/vhosts/live_magento/htdocs/app/code/core/Mage/Core/Model/Resource/Db/Abstract.php(320): Mage_Core_Model_Resource->getConnection('core_write')
#8 /html/copy_hzlbio/var/www/vhosts/live_magento/htdocs/app/code/core/Mage/Core/Model/Resource/Db/Abstract.php(350): Mage_Core_Model_Resource_Db_Abstract->_getConnection('write')
#9 /html/copy_hzlbio/var/www/vhosts/live_magento/htdocs/app/code/core/Mage/Core/Model/Resource/Db/Abstract.php(335): Mage_Core_Model_Resource_Db_Abstract->_getWriteAdapter()
#10 /html/copy_hzlbio/var/www/vhosts/live_magento/htdocs/app/code/core/Mage/Core/Model/Resource/Cache.php(53): Mage_Core_Model_Resource_Db_Abstract->_getReadAdapter()
#11 /html/copy_hzlbio/var/www/vhosts/live_magento/htdocs/var/cache/ew/files/7a/3e/Mage/Core/Model/Cache.php(497): Mage_Core_Model_Resource_Cache->getAllOptions()
#12 /html/copy_hzlbio/var/www/vhosts/live_magento/htdocs/var/cache/ew/files/7a/3e/Mage/Core/Model/Cache.php(539): Mage_Core_Model_CacheOverriddenClass->_initOptions()
#13 /html/copy_hzlbio/var/www/vhosts/live_magento/htdocs/app/code/core/Mage/Core/Model/App.php(1183): Mage_Core_Model_CacheOverriddenClass->canUse('config')
#14 /html/copy_hzlbio/var/www/vhosts/live_magento/htdocs/app/code/core/Mage/Core/Model/Config.php(414): Mage_Core_Model_App->useCache('config')
#15 /html/copy_hzlbio/var/www/vhosts/live_magento/htdocs/app/code/core/Mage/Core/Model/Config.php(294): Mage_Core_Model_Config->_canUseCacheForInit()
#16 /html/copy_hzlbio/var/www/vhosts/live_magento/htdocs/app/code/core/Mage/Core/Model/App.php(413): Mage_Core_Model_Config->loadModulesCache()
#17 /html/copy_hzlbio/var/www/vhosts/live_magento/htdocs/app/code/core/Mage/Core/Model/App.php(343): Mage_Core_Model_App->_initModules()
#18 /html/copy_hzlbio/var/www/vhosts/live_magento/htdocs/app/Mage.php(684): Mage_Core_Model_App->run(Array)
#19 /html/copy_hzlbio/var/www/vhosts/live_magento/htdocs/index.php(89): Mage::run('', 'store')
#20 {main}
It was not about magento or google cloud sql. It was about the server on which the htdocs are. The server does not allow this outgoing connection.
I have installed extension from magento connect from website and logged out but when I tried to access admin panel but now I am getting error.
"There has been an error processing your request
Exception printing is disabled by default for security reasons.
Error log record number: 1303816771146"
when i traced error file under var/report i found following error report.
"a:5:{i:0;s:71:"Mage registry key "_singleton/emailattachments/observer" already exists";i:1;s:2604:"
#0 /home/globaltrimming12/public_html/app/Mage.php(223): Mage::throwException('Mage registry k...')
#1 /home/globaltrimming12/public_html/app/Mage.php(477): Mage::register('_singleton/emai...', false)
#2 /home/globaltrimming12/public_html/includes/src/__default.php(21770): Mage::getSingleton('emailattachment...')
#3 /home/globaltrimming12/public_html/app/Mage.php(448): Mage_Core_Model_App->dispatchEvent('core_block_abst...', Array)
#4 /home/globaltrimming12/public_html/includes/src/__default.php(1988): Mage::dispatchEvent('core_block_abst...', Array)
#5 /home/globaltrimming12/public_html/includes/src/__default.php(28179): Mage_Core_Block_Abstract->setLayout(Object(Codnitive_Extifcon_Model_Core_Layout))
#6 /home/globaltrimming12/public_html/includes/src/__default.php(28195): Mage_Core_Model_Layout->createBlock('adminhtml/page_...', 'head')
#7 /home/globaltrimming12/public_html/includes/src/__default.php(27962): Mage_Core_Model_Layout->addBlock('adminhtml/page_...', 'head')
#8 /home/globaltrimming12/public_html/includes/src/__default.php(27928): Mage_Core_Model_Layout->_generateBlock(Object(Mage_Core_Model_Layout_Element), Object(Mage_Core_Model_Layout_Element))
#9 /home/globaltrimming12/public_html/includes/src/__default.php(27929): Mage_Core_Model_Layout->generateBlocks(Object(Mage_Core_Model_Layout_Element))
#10 /home/globaltrimming12/public_html/includes/src/__default.php(14024): Mage_Core_Model_Layout->generateBlocks()
#11 /home/globaltrimming12/public_html/includes/src/__default.php(13949): Mage_Core_Controller_Varien_Action->generateLayoutBlocks()
#12 /home/globaltrimming12/public_html/includes/src/Mage_Adminhtml_Controller_Action.php(275): Mage_Core_Controller_Varien_Action->loadLayout(NULL, true, true)
#13 /home/globaltrimming12/public_html/app/code/core/Mage/Adminhtml/controllers/IndexController.php(81): Mage_Adminhtml_Controller_Action->loadLayout()
#14 /home/globaltrimming12/public_html/includes/src/__default.php(14098): Mage_Adminhtml_IndexController->loginAction()
#15 /home/globaltrimming12/public_html/includes/src/__default.php(18482): Mage_Core_Controller_Varien_Action->dispatch('login')
#16 /home/globaltrimming12/public_html/includes/src/__default.php(18016): Mage_Core_Controller_Varien_Router_Standard->match(Object(Mage_Core_Controller_Request_Http))
#17 /home/globaltrimming12/public_html/includes/src/__default.php(20808): Mage_Core_Controller_Varien_Front->dispatch()
#18 /home/globaltrimming12/public_html/app/Mage.php(684): Mage_Core_Model_App->run(Array)
#19 /home/globaltrimming12/public_html/index.php(87): Mage::run('', 'store')
#20 {main}";s:3:"url";s:7:"/admin/";s:11:"script_name";s:10:"/index.php";s:4:"skin";s:5:"admin";}"
please let me know where to do changes so I can be able to login to admin panel.
Seems like, your magento compilation is on. Always turn compilation off before installing an extension, and of course disable cache. Find more info on compilation here.
My website uses Magento and is hosted on Godaddy. It was working fine till yesterday but today, it is showing the following error :
There has been an error processing your request
SQLSTATE[HY000] [2002] Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2)
Trace:
#0 /home/greenveggy/public_html/lib/Zend/Db/Adapter/Pdo/Mysql.php(109): Zend_Db_Adapter_Pdo_Abstract->_connect()
#1 /home/greenveggy/public_html/lib/Varien/Db/Adapter/Pdo/Mysql.php(320): Zend_Db_Adapter_Pdo_Mysql->_connect()
#2 /home/greenveggy/public_html/lib/Zend/Db/Adapter/Abstract.php(460): Varien_Db_Adapter_Pdo_Mysql->_connect()
#3 /home/greenveggy/public_html/lib/Zend/Db/Adapter/Pdo/Abstract.php(238): Zend_Db_Adapter_Abstract->query('SET NAMES utf8', Array)
#4 /home/greenveggy/public_html/lib/Varien/Db/Adapter/Pdo/Mysql.php(428): Zend_Db_Adapter_Pdo_Abstract->query('SET NAMES utf8', Array)
#5 /home/greenveggy/public_html/app/code/core/Mage/Core/Model/Resource.php(169): Varien_Db_Adapter_Pdo_Mysql->query('SET NAMES utf8')
#6 /home/greenveggy/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/greenveggy/public_html/app/code/core/Mage/Core/Model/Resource/Db/Abstract.php(320): Mage_Core_Model_Resource->getConnection('core_write')
#8 /home/greenveggy/public_html/app/code/core/Mage/Core/Model/Resource/Db/Abstract.php(350): Mage_Core_Model_Resource_Db_Abstract->_getConnection('write')
#9 /home/greenveggy/public_html/app/code/core/Mage/Core/Model/Resource/Db/Abstract.php(335): Mage_Core_Model_Resource_Db_Abstract->_getWriteAdapter()
#10 /home/greenveggy/public_html/app/code/core/Mage/Core/Model/Resource/Db/Abstract.php(360): Mage_Core_Model_Resource_Db_Abstract->_getReadAdapter()
#11 /home/greenveggy/public_html/app/code/core/Mage/Core/Model/Resource/Db/Collection/Abstract.php(134): Mage_Core_Model_Resource_Db_Abstract->getReadConnection()
#12 /home/greenveggy/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/greenveggy/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/greenveggy/public_html/app/Mage.php(491): Mage_Core_Model_Config->getResourceModelInstance('core/website_co...', Object(Mage_Core_Model_Resource_Website))
#15 /home/greenveggy/public_html/app/code/core/Mage/Core/Model/Abstract.php(208): Mage::getResourceModel('core/website_co...', Object(Mage_Core_Model_Resource_Website))
#16 /home/greenveggy/public_html/app/code/core/Mage/Core/Model/Abstract.php(213): Mage_Core_Model_Abstract->getResourceCollection()
#17 /home/greenveggy/public_html/app/code/core/Mage/Core/Model/App.php(608): Mage_Core_Model_Abstract->getCollection()
#18 /home/greenveggy/public_html/app/code/core/Mage/Core/Model/App.php(466): Mage_Core_Model_App->_initStores()
#19 /home/greenveggy/public_html/app/code/core/Mage/Core/Model/App.php(349): Mage_Core_Model_App->_initCurrentStore('', 'store')
#20 /home/greenveggy/public_html/app/Mage.php(684): Mage_Core_Model_App->run(Array)
#21 /home/greenveggy/public_html/index.php(87): Mage::run('', 'store')
#22 {main}
How do i resolve this ?
you can use the tool n98-magerun.phar (link) with task sys:check to test yout db-connection
you have to copy the file to path /home/greenveggy/public_html/ and make it executable
then cd to this path and execute ./n98-magerun.phar sys:check
if the connection fails check your properties in /home/greenveggy/public_html/app/etc/local.xml
Pressing the "check" button for the Database solved the problem. Site is functional again. Can anyone explain what just happened?
I update from Magento 1.6.2 to 1.8.1 and now I get this on my page:
Warning: session_module_name(): Cannot find named PHP session module (memcache) in /app/code/core/Mage/Core/Model/Session/Abstract/Varien.php on line 73
#0 [internal function]: mageCoreErrorHandler(2, 'session_module_...', '/var/www/vhosts...', 73, Array)
#1 /app/code/core/Mage/Core/Model/Session/Abstract/Varien.php(73): session_module_name('memcache')
#2 /app/code/core/Mage/Core/Model/Session/Abstract/Varien.php(168): Mage_Core_Model_Session_Abstract_Varien->start('adminhtml')
#3 /app/code/core/Mage/Core/Model/Session/Abstract.php(84): Mage_Core_Model_Session_Abstract_Varien->init('core', 'adminhtml')
#4 /app/code/core/Mage/Core/Model/Session.php(42): Mage_Core_Model_Session_Abstract->init('core', 'adminhtml')
#5 /app/code/core/Mage/Core/Model/Config.php(1353): Mage_Core_Model_Session->__construct(Array)
#6 /app/Mage.php(463): Mage_Core_Model_Config->getModelInstance('core/session', Array)
#7 /app/Mage.php(477): Mage::getModel('core/session', Array)
#8 /app/code/core/Mage/Core/Controller/Varien/Action.php(493): Mage::getSingleton('core/session', Array)
#9 /app/code/core/Mage/Adminhtml/Controller/Action.php(160): Mage_Core_Controller_Varien_Action->preDispatch()
#10 /app/code/core/Mage/Core/Controller/Varien/Action.php(407): Mage_Adminhtml_Controller_Action->preDispatch()
#11 /app/code/core/Mage/Core/Controller/Varien/Router/Standard.php(250): Mage_Core_Controller_Varien_Action->dispatch('index')
#12 /app/code/core/Mage/Core/Controller/Varien/Front.php(172): Mage_Core_Controller_Varien_Router_Standard->match(Object(Mage_Core_Controller_Request_Http))
#13 /app/code/local/Mage/Core/Model/App.php(349): Mage_Core_Controller_Varien_Front->dispatch()
#14 /app/Mage.php(684): Mage_Core_Model_App->run(Array)
#15 index.php(87): Mage::run('', 'store')
#16 {main}
I have checked everything I could find on the net, but can't seem to solve this one?
I don't know what session module it is looking for? PHP? memcache?
I have been locked out for 3 days now!!!
It looks like your app/etc/local.xml file is configured to use the PHP memcache session storage handler. When Magento reads this configuration value in and tries to set the session handler with the session_module_name function it finds the version of PHP you're using doesn't have the memcache session hander installed and/or enabled.
You'll need to disable this configuration value in your app/etc/local.xml file and use the standard file/database session storage method, or you'll need to install/enable the session handler on the server you've installed Magento on.