Unexpected Error

Submitted by cliffi on 2012-08-10

I keep getting an Unexpected Error upon submission of an issue or when I try to view an issue:

The event log has the following entry:

Type: Errors
Severity: Error Error
Date: 10/08/2012 21:56
Message: Unhandled System_Db_Exception: Prepared statement needs to be re-prepared in /home/internal/public_html/webissues/system/db/mysqli/engine.inc.php on line 264
Stack trace:
#0 /home/internal/public_html/webissues/system/db/mysqli/engine.inc.php(129): System_Db_Mysqli_Engine->handleError(Object(mysqli_stmt))
#1 /home/internal/public_html/webissues/system/db/mysqli/engine.inc.php(90): System_Db_Mysqli_Engine->executeStatement('SELECT ch.chang...', Array)
#2 /home/internal/public_html/webissues/system/db/connection.inc.php(248): System_Db_Mysqli_Engine->query('SELECT ch.chang...', Array)
#3 /home/internal/public_html/webissues/system/db/connection.inc.php(390): System_Db_Connection->queryArgs('SELECT ch.chang...', Array)
#4 /home/internal/public_html/webissues/client/issuedetails.inc.php(100): System_Db_Connection->queryPageArgs('SELECT ch.chang...', 'ch.change_id AS...', '50', 0, Array)
#5 /home/internal/public_html/webissues/system/web/component.inc.php(100): Client_IssueDetails->execute()
#6 /home/internal/public_html/webissues/system/web/view.inc.php(247): System_Web_Component->run()
#7 /home/internal/public_html/webissues/client/index.html.php(6): System_Web_View->insertComponent('Client_IssueDet...')
#8 /home/internal/public_html/webissues/system/web/view.inc.php(284): include('/home/internal/...')
#9 /home/internal/public_html/webissues/system/web/view.inc.php(217): System_Web_View->executeTemplate()
#10 /home/internal/public_html/webissues/system/web/component.inc.php(102): System_Web_View->render()
#11 /home/internal/public_html/webissues/system/web/application.inc.php(77): System_Web_Component->run()
#12 /home/internal/public_html/webissues/system/core/application.inc.php(210): System_Web_Application->execute()
#13 /home/internal/public_html/webissues/system/bootstrap.inc.php(124): System_Core_Application->run()
#14 /home/internal/public_html/webissues/client/index.php(60): System_Bootstrap::run('Common_Applicat...', 'Client_Index')
#15 {main}

Any ideas as to what the problem is as the above does not make much sense to me. I have no other information in the PHP logs either.

Running PHP 5.3.8 with mod_fcgi with mysql v5.1.61

This problem was already reported in this thread. It is related to a strange bug / configuration problem in MySQL descibed here. I hope that helps.

Regards,
Michał

Thanks to the above post I was able to fix this error by changing the following values in the my.cnf file:

table_open_cache 128=>16384
table_definition_cache 1024=>16384
tmp_table_size 32M=>64M
join_buffer_size 256k=>512k

It would appear some of the default buffer sizes are too small. I believe this has been fixed in higher versions of mysql. If you are using CentOs 6.x with the EPEL repos. The above should fix the issue described above.