Magento SQL error from Admin Uncaught exception 'PDOException' with message 'SQLSTATE[HY000] - mysql

Dear guys I'm getting this error in Magento 1.7.0.2 from the admin page when the page takes too long to load, it never happened before this week could you help me troubleshooting this?
Fatal error: Uncaught exception 'PDOException' with message
'SQLSTATE[HY000]: General error: 1205 Lock wait timeout
exceeded; try restarting transaction' in
/home/erboris1/public_html/lib/Zend/Db/Statement/Pdo.php:228 Stack
trace: #0
/home/erboris1/public_html/lib/Zend/Db/Statement/Pdo.php(228):
PDOStatement->execute(Array)
/home/erboris1/public_html/lib/Varien/Db/Statement/Pdo/Mysql.php(110):
Zend_Db_Statement_Pdo->_execute(Array)
/home/erboris1/public_html/lib/Zend/Db/Statement.php(300):
Varien_Db_Statement_Pdo_Mysql->_execute(Array)
/home/erboris1/public_html/lib/Zend/Db/Adapter/Abstract.php(479):
Zend_Db_Statement->execute(Array)
/home/erboris1/public_html/lib/Zend/Db/Adapter/Pdo/Abstract.php(238):
Zend_Db_Adapter_Abstract->query('UPDATE mg_core...', Array)
/home/erboris1/public_html/lib/Varien/Db/Adapter/Pdo/Mysql.php(419):
Zend_Db_Adapter_Pdo_Abstract->query('UPDATEmg_core...', Array)
/home/erboris1/public_html/lib/Zend/Db/Adapter/Abstract.php(632):
Varien_Db_Adapter_Pdo_Mysql->query('UPDATE `mg in
/home/erboris1/public_html/lib/Zend/Db/Statement/Pdo.php on line 234

We had the same issue and it it was related to this non-bug: http://www.magentocommerce.com/bug-tracking/issue/?issue=10966 With a lot of categories, the refresh of the top-menu can use a lot of mysql ressources, because it is cached for each unique page. Our fix was to invalidate the cache only under certain circumstances.

Related

SES SMTP mail giving openssl :EVP_CIPHER_CTX_set_key_length:invalid key length Error

We are creating Yii2 Rest API. We are implementing SES SMTP. Email is working fine but With API Response, We are getting 500 Internal Server Error with below Fetal Error:
"Uncaught exception 'yii\base\ErrorException' with message 'fgets(): SSL operation failed with code 1. OpenSSL Error messages: error:0607A082:digital envelope routines:EVP_CIPHER_CTX_set_key_length:invalid key length"
Complete Error Message coming as below:
Fatal error: Uncaught exception 'yii\base\ErrorException'
with message 'fgets(): SSL operation failed with code 1. OpenSSL Error
messages:
error:0607A082:digital envelope
routines:EVP_CIPHER_CTX_set_key_length:invalid key length' in
/var/www/html/rington/advanced/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Transport/StreamBuffer.php:163
Stack trace:
#0 [internal function]: yii\base\ErrorHandler->handleError(2, 'fgets(): SSL op...', '/var/www/html/r...', 163, Array)
#1 /var/www/html/rington/advanced/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Transport/StreamBuffer.php(163):
fgets(Resource id #31)
#2 /var/www/html/rington/advanced/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Transport/AbstractSmtpTransport.php(397):
Swift_Transport_StreamBuffer->readLine(40)
#3 /var/www/html/rington/advanced/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Transport/AbstractSmtpTransport.php(277):
Swift_Transport_AbstractSmtpTransport->_getFullResponse(40)
#4 /var/www/html/rington/advanced/vendor/swiftmailer/swiftmailer/lib/c in
/var/www/html/rington/advanced/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Transport/StreamBuffer.php
on line 163
I have tried different Solution given on Google Search but nothing works.
Please help.
Thanks in advance.

mediawiki 500 internal error when visit the home page

MediaWiki suddenly came with 500 internal error
Fatal error: Uncaught Error: Call to a member function getCode() on
null in /var/www/wiki/includes/user/User.php:1578 Stack trace: #0
/var/www/wiki/includes/user/User.php(5243): User::getDefaultOptions()
#1 /var/www/wiki/includes/user/User.php(2859): User->loadOptions() #2 /var/www/wiki/includes/context/RequestContext.php(364):
User->getOption('language') #3
/var/www/wiki/includes/Message.php(380): RequestContext->getLanguage()
#4 /var/www/wiki/includes/Message.php(1257): Message->getLanguage() #5 /var/www/wiki/includes/Message.php(842): Message->fetchMessage() #6
/var/www/wiki/includes/Message.php(934): Message->toString('text') #7
/var/www/wiki/includes/exception/MWExceptionRenderer.php(254):
Message->text() #8
/var/www/wiki/includes/exception/MWExceptionRenderer.php(358):
MWExceptionRenderer::msg('dberr-again', 'Try waiting a f...') #9
/var/www/wiki/includes/exception/MWExceptionRenderer.php(52):
MWExceptionRenderer::reportOutageHTML(Object(Wikimedia\Rdbms\DBConnectionError))
#10 /var/www/wiki/includes/exception/MWExce in /var/www/wiki/includes/user/User.php on line 1578
I assume this is a bug that might happen if you have multiple install attempts and the mysql.user is still there. I had the same problem today.
I have filed the bug as:
https://phabricator.wikimedia.org/T177768
the Problem went away after reinstalling with the following steps:
dropping database
removing user from mysql.users
strangely the "user exists" error still appeared on installation
granting access rights was therefore necessary on the mysql database.

Fatal error: Uncaught exception 'PDFlibException' with message 'Unknown option 'naxtparagraph''

I have moved a website to a new server but pdflib has stopped working and it is giving us:
Fatal error: Uncaught exception 'PDFlibException' with message 'Unknown option 'naxtparagraph'' in /www/pdfGeneration.php:222 Stack trace: #0 /www/pdfGeneration.php(222): pdf_create_textflow(Resource id #39, '
Any suggestions ?
Thanks.
Its ok. Upon further investigation I found that there was a typo in tag name. It started work when I change it to .
Can't believe that it was working with this bad tag for past 4 years.
Thanks.

Reindexing error in 1.6 (PHP exception in indexer.php)

Recently I upgraded from 1.4.2 to 1.6.2. Things actually went fairly smoothly, which was relatively surprising. Until I tried to reindex my store. Using the GUI backend gives me the typical no help "Cannot Initialize the indexer process" message. So I tried running indexer.php from the command line (php shell/indexer.php reindexall) which gives me this error:
Fatal error: Uncaught exception 'PDOException' with message 'SQLSTATE[HY000] [2002] Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2)' in /home/shopchau/public_html/stage/lib/Zend/Db/Adapter/Pdo/Abstract.php:129
Stack trace:
0 /home/shopchau/public_html/stage/lib/Zend/Db/Adapter/Pdo/Abstract.php(129): PDO->__construct('mysql:model=mys...', 'shopchau_stage', 'gr8target', Array)
1 /home/shopchau/public_html/stage/lib/Zend/Db/Adapter/Pdo/Mysql.php(96): Zend_Db_Adapter_Pdo_Abstract->_connect()
2 /home/shopchau/public_html/stage/lib/Varien/Db/Adapter/Pdo/Mysql.php(300): Zend_Db_Adapter_Pdo_Mysql->_connect()
3 /home/shopchau/public_html/stage/lib/Zend/Db/Adapter/Abstract.php(459): Varien_Db_Adapter_Pdo_Mysql->_connect()
4 /home/shopchau/public_html/stage/lib/Zend/Db/Adapter/Pdo/Abstract.php(238): Zend_Db_Adapter_Abstract->query('SET NAMES utf8', Array)
5 /home/shopchau/public_html/stage/lib/Varien/Db/Adapter/Pdo/Mysql.php(389): Zend_Db_Adapter_Pdo_Abstract->query('SET NAMES utf8', Array)
in /home/shopchau/public_html/stage/lib/Zend/Db/Adapter/Pdo/Abstract.php on line 144
Now I've tried the various fixes here: delete the locks, delete cache, fixing file permissions, and running checks to see if my DB is corrupt. Far as I can tell, everything else is working. Nothing so far, has helped this issue.
Anyone have any ideas/fixes?
That exception tells about connection problem. Are you sure MySQL uses /var/lib/mysql/mysql.sock socket? Try changing it to /tmp/mysql.sock. You can adjust this in your local.xml

Error Database connection with user and password info

I have a connection to a data base and every time there is a problem connecting I get this error.
Fatal error: Uncaught exception 'PDOException' with message 'SQLSTATE[HY000] [2003] Can't connect to MySQL server on '205.178.146.104' (4)' in /data/18/2/77/115/2566441/user/2813515/htdocs/ZendFramework-1.11.5/library/Zend/Db/Adapter/Pdo/Abstract.php:129
Stack trace:
#0 .../ZendFramework-1.11.5/library/Zend/Db/Adapter/Pdo/Abstract.php(129): PDO->__construct('mysql:dbname=si...', 'xxx', 'xxx', Array)
#1 .../ZendFramework-1.11.5/library/Zend/Db/Adapter/Pdo/Mysql.php(96): Zend_Db_Adapter_Pdo_Abstract->_connect()
#2 .../ZendFramework-1.11.5/library/Zend/Db/Adapter/Abstract.php(459): Zend_Db_Adapter_Pdo_Mysql->_connect()
#3 .../ZendFramework-1.11.5/library/Zend/Db/Adapter/Pdo/Abstract.php(238): Zend_Db_Adapter_Abstract->query('DESCRIBE `user`', Array)
#4 .../ZendFramework-1.11.5/library/Zend/Db/Adapter/Pdo/Mysq in .../ZendFramework-1.11.5/library/Zend/Db/Adapter/Pdo/Abstract.php on line 144
The thing is that the database user and password are visible on the page in the error message. Is there a way that I can prevent PHP from showing that info? Or is this happening because I am set up a a developing instead of production?
It is a combination of both. In development, your showing your errors. Which is the primary reason your seeing that.
However, you can catch the exception by testing the connection before the query. Allowing you to handle your own connection failures.
try {
Zend_Db_Table::getDefaultAdapter()->getConnection();
} catch (Zend_Exception $e) {
throw new Zend_Exception("A different error");
}
It is because you are on "developing" (exceptions are shown in browser)
Solution 1: Use Production Environment ;)
Solution 2: Change settings in application.ini
Solution 3: Use an try/catch block for database connect