XF 2.2 Server error log Deadlock found when trying to get lock; try restarting transaction

Mr Lucky

Well-known member
Does anyone know what might cause this:

Code:
XF\Db\DeadlockException: Error rendering widget: MySQL query error [1213]: Deadlock found when trying to get lock; try restarting transaction src/XF/Db/AbstractStatement.php:230
Generated by: Unknown account Sep 22, 2021 at 11:55 PM
Stack trace
INSERT  INTO `xf_job` (`execute_class`, `execute_data`, `unique_key`, `manual_execute`, `trigger_date`) VALUES (?, ?, ?, ?, ?) ON DUPLICATE KEY UPDATE
            execute_class = VALUES(execute_class),
            execute_data = VALUES(execute_data),
            manual_execute = VALUES(manual_execute),
            trigger_date = VALUES(trigger_date),
            last_run_date = NULL
        
------------

#0 src/XF/Db/Mysqli/Statement.php(198): XF\Db\AbstractStatement->getException('MySQL query err...', 1213, '40001')
#1 src/XF/Db/Mysqli/Statement.php(79): XF\Db\Mysqli\Statement->getException('MySQL query err...', 1213, '40001')
#2 src/XF/Db/AbstractAdapter.php(96): XF\Db\Mysqli\Statement->execute()
#3 src/XF/Db/AbstractAdapter.php(220): XF\Db\AbstractAdapter->query('INSERT  INTO `x...', Array)
#4 src/XF/Job/Manager.php(527): XF\Db\AbstractAdapter->insert('xf_job', Array, false, '
            execute_cla...')
#5 src/XF/Job/Manager.php(469): XF\Job\Manager->_enqueue('searchForumCach...', 'XF:SearchForumC...', Array, false, 1632351356)
#6 src/addons/SV/UserEssentials/XF/Job/Manager.php(19): XF\Job\Manager->enqueueUnique('searchForumCach...', 'XF:SearchForumC...', Array, false)
#7 src/XF/Repository/SearchForum.php(156): SV\UserEssentials\XF\Job\Manager->enqueueUnique('searchForumCach...', 'XF:SearchForumC...', Array, false)
#8 src/XF/Widget/SearchForum.php(71): XF\Repository\SearchForum->enqueueCacheRebuildIfNeeded(Object(XF\Entity\SearchForum))
#9 internal_data/code_cache/widgets/_56_sf_popular.php(5): XF\Widget\SearchForum->render()
#10 src/XF/Template/Templater.php(7509): XF\SubContainer\Widget->{closure}(Object(MaZ\AMP\XF\Template\XF22\Templater), Array, Array)
#11 src/XF/SubContainer/Widget.php(168): XF\Template\Templater->renderWidgetClosure(Object(Closure), Array)
#12 src/XF/Template/Templater.php(1928): XF\SubContainer\Widget->getCompiledWidget(Array, Array)
#13 internal_data/code_cache/templates/l1/s109/public/thread_view.php(1255): XF\Template\Templater->widgetPosition('thread_view_sid...', Array)
#14 src/XF/Template/Templater.php(1651): XF\Template\Templater->{closure}(Object(MaZ\AMP\XF\Template\XF22\Templater), Array, Object(XF\Template\ExtensionSet))
#15 src/addons/MaZ/AMP/XF/Template/XF22/Templater.php(52): XF\Template\Templater->renderTemplate('thread_view', Array, true, NULL)
#16 src/XF/Template/Template.php(24): MaZ\AMP\XF\Template\XF22\Templater->renderTemplate('public:thread_v...', Array)
#17 src/XF/Mvc/Renderer/Html.php(50): XF\Template\Template->render()
#18 src/XF/Mvc/Dispatcher.php(460): XF\Mvc\Renderer\Html->renderView('XF:Thread\\View', 'public:thread_v...', Array)
#19 src/XF/Mvc/Dispatcher.php(442): XF\Mvc\Dispatcher->renderView(Object(XF\Mvc\Renderer\Html), Object(XF\Mvc\Reply\View))
#20 src/XF/Mvc/Dispatcher.php(402): XF\Mvc\Dispatcher->renderReply(Object(XF\Mvc\Renderer\Html), Object(XF\Mvc\Reply\View))
#21 src/XF/Mvc/Dispatcher.php(60): XF\Mvc\Dispatcher->render(Object(XF\Mvc\Reply\View), 'html')
#22 src/XF/App.php(2345): XF\Mvc\Dispatcher->run()
#23 src/XF.php(512): XF\App->run()
#24 index.php(20): XF::runApp('XF\\Pub\\App')
#25 {main}
Request state
array(4) {
  ["url"] => string(27) "/threads/night-train.11067/"
  ["referrer"] => bool(false)
  ["_GET"] => array(0) {
  }
  ["_POST"] => array(0) {
  }
}

Thanks
 
The same problem arose for me after using the Batch Update Users option in the ACP.

I first cleared the job table in MySQL, then turned off all cron jobs in the ACP and turned it on again.

 
Last edited:
Back
Top Bottom