This may not be Craft related of course but I’m getting the following error:
Internal Server Error CDbCommand failed to execute the SQL statement: SQLSTATE[HY000]: General error: 1205 Lock wait timeout executed; try restarting transaction
Any leads to likely causes very much appreciated.
EDIT:
Updated Craft and cleared caches but still got the error. A temporary workaround was to remove the cache tag in the site’s templates.
For reference, here’s what the error looks like in the log:
2014/07/02 15:23:31 [error] [system.db.CDbCommand] CDbCommand::execute() failed: SQLSTATE[HY000]: General error: 1205 Lock wait timeout exceeded; try restarting transaction. The SQL statement executed was: DELETE FROM `craft_templatecaches`.
2014/07/02 15:23:31 [error] [exception.Twig_Error_Runtime] exception 'CDbException' with message 'CDbCommand failed to execute the SQL statement: SQLSTATE[HY000]: General error: 1205 Lock wait timeout exceeded; try restarting transaction' in /craft/app/framework/db/CDbCommand.php:358
Stack trace:
#0 /craft/app/framework/db/CDbCommand.php(1302): CDbCommand->execute(Array)
#1 /craft/app/etc/db/DbCommand.php(404): CDbCommand->delete('craft_templatec...', Array, Array)
#2 /craft/app/services/TemplateCacheService.php(380): Craft\DbCommand->delete('templatecaches', Array, Array)
#3 /craft/app/services/TemplateCacheService.php(406): Craft\TemplateCacheService->deleteExpiredCaches()
#4 /craft/app/services/TemplateCacheService.php(37): Craft\TemplateCacheService->deleteExpiredCachesIfOverdue()
#5 /craft/storage/runtime/compiled_templates/4e/63/XXXXX.php(54): Craft\TemplateCacheService->getTemplateCache('XXXXX...', false)
#6 /craft/app/vendor/twig/twig/lib/Twig/Template.php(144): __TwigTemplate_XXXXX->block_content(Array, Array)
#7 /craft/storage/runtime/compiled_templates/4e/7f/XXXXX.php(260): Twig_Template->displayBlock('content', Array, Array)
#8 /craft/app/vendor/twig/twig/lib/Twig/Template.php(278): __TwigTemplate_XXXXX->doDisplay(Array, Array)
#9 /craft/app/vendor/twig/twig/lib/Twig/Template.php(252): Twig_Template->displayWithErrorHandling(Array, Array)
#10 /craft/storage/runtime/compiled_templates/4e/63/XXXXX.php(41): Twig_Template->display(Array, Array)
#11 /craft/app/vendor/twig/twig/lib/Twig/Template.php(278): __TwigTemplate_XXXXX->doDisplay(Array, Array)
#12 /craft/app/vendor/twig/twig/lib/Twig/Template.php(252): Twig_Template->displayWithErrorHandling(Array, Array)
#13 /craft/app/vendor/twig/twig/lib/Twig/Template.php(263): Twig_Template->display(Array)
#14 /craft/app/vendor/twig/twig/lib/Twig/Environment.php(292): Twig_Template->render(Array)
#15 /craft/app/services/TemplatesService.php(158): Twig_Environment->render('_views/_section', Array)
#16 /craft/app/controllers/BaseController.php(75): Craft\TemplatesService->render('_views/_section', Array)
#17 /craft/app/controllers/TemplatesController.php(185): Craft\BaseController->renderTemplate('_views/_section', Array)
#18 /craft/app/controllers/TemplatesController.php(27): Craft\TemplatesController->_render('_views/_section', Array)
#19 [internal function]: Craft\TemplatesController->actionRender('_views/_section', Array)
#20 /craft/app/framework/web/actions/CAction.php(108): ReflectionMethod->invokeArgs(Object(Craft\TemplatesController), Array)
#21 /craft/app/framework/web/actions/CInlineAction.php(47): CAction->runWithParamsInternal(Object(Craft\TemplatesController), Object(ReflectionMethod), Array)
#22 /craft/app/framework/web/CController.php(308): CInlineAction->runWithParams(Array)
#23 /craft/app/framework/web/CController.php(286): CController->runAction(Object(CInlineAction))
#24 /craft/app/framework/web/CController.php(265): CController->runActionWithFilters(Object(CInlineAction), NULL)
#25 /craft/app/framework/web/CWebApplication.php(282): CController->run('render')
#26 /craft/app/framework/web/CWebApplication.php(141): CWebApplication->runController('templates/rende...')
#27 /craft/app/etc/web/WebApp.php(247): CWebApplication->processRequest()
#28 /craft/app/framework/base/CApplication.php(180): Craft\WebApp->processRequest()
#29 /craft/app/index.php(196): CApplication->run()
#30 /index.php(17): require_once('/var/www/vhosts...')
#31 {main}
Next exception 'Twig_Error_Runtime' with message 'An exception has been thrown during the rendering of a template ("CDbCommand failed to execute the SQL statement: SQLSTATE[HY000]: General error: 1205 Lock wait timeout exceeded; try restarting transaction") in "_views/_section" at line 35.' in /craft/app/vendor/twig/twig/lib/Twig/Template.php:148
Stack trace:
#0 /craft/storage/runtime/compiled_templates/4e/7f/XXXXX.php(260): Twig_Template->displayBlock('content', Array, Array)
#1 /craft/app/vendor/twig/twig/lib/Twig/Template.php(278): __TwigTemplate_XXXXX->doDisplay(Array, Array)
#2 /craft/app/vendor/twig/twig/lib/Twig/Template.php(252): Twig_Template->displayWithErrorHandling(Array, Array)
#3 /craft/storage/runtime/compiled_templates/4e/63/XXXXX.php(41): Twig_Template->display(Array, Array)
#4 /craft/app/vendor/twig/twig/lib/Twig/Template.php(278): __TwigTemplate_XXXXX->doDisplay(Array, Array)
#5 /craft/app/vendor/twig/twig/lib/Twig/Template.php(252): Twig_Template->displayWithErrorHandling(Array, Array)
#6 /craft/app/vendor/twig/twig/lib/Twig/Template.php(263): Twig_Template->display(Array)
#7 /craft/app/vendor/twig/twig/lib/Twig/Environment.php(292): Twig_Template->render(Array)
#8 /craft/app/services/TemplatesService.php(158): Twig_Environment->render('_views/_section', Array)
#9 /craft/app/controllers/BaseController.php(75): Craft\TemplatesService->render('_views/_section', Array)
#10 /craft/app/controllers/TemplatesController.php(185): Craft\BaseController->renderTemplate('_views/_section', Array)
#11 /craft/app/controllers/TemplatesController.php(27): Craft\TemplatesController->_render('_views/_section', Array)
#12 [internal function]: Craft\TemplatesController->actionRender('_views/_section', Array)
#13 /craft/app/framework/web/actions/CAction.php(108): ReflectionMethod->invokeArgs(Object(Craft\TemplatesController), Array)
#14 /craft/app/framework/web/actions/CInlineAction.php(47): CAction->runWithParamsInternal(Object(Craft\TemplatesController), Object(ReflectionMethod), Array)
#15 /craft/app/framework/web/CController.php(308): CInlineAction->runWithParams(Array)
#16 /craft/app/framework/web/CController.php(286): CController->runAction(Object(CInlineAction))
#17 /craft/app/framework/web/CController.php(265): CController->runActionWithFilters(Object(CInlineAction), NULL)
#18 /craft/app/framework/web/CWebApplication.php(282): CController->run('render')
#19 /craft/app/framework/web/CWebApplication.php(141): CWebApplication->runController('templates/rende...')
#20 /craft/app/etc/web/WebApp.php(247): CWebApplication->processRequest()
#21 /craft/app/framework/base/CApplication.php(180): Craft\WebApp->processRequest()
#22 /craft/app/index.php(196): CApplication->run()
#23 /index.php(17): require_once('/var/www/vhosts...')
#24 {main}
REQUEST_URI=/features
---
2014/07/02 15:23:31 [error] [application] Unable to find the template “500”.
2014/07/02 15:23:31 [error] [application] Unable to find the template “error”.