• Register
    • Help

    striker  0 Items
    Currently Supporting
    • Home
    • News
    • Forum
    • Wiki
    • Support
      • Manage Subscriptions
      • FAQ
      • Support For
        • VaultWiki 4.x Series
        • VaultWiki.org Site
    • What's New?
    • Buy Now
    • Manual
    • 
    • Support
    • VaultWiki 4.x Series
    • Bug
    • Deadlock found when trying to get lock; try restarting transaction src/XF/Db/AbstractStatement.php:230

    1. Welcome to VaultWiki.org, home of the wiki add-on for vBulletin and XenForo!

      VaultWiki allows your existing forum users to collaborate on creating and managing a site's content pages. VaultWiki is a fully-featured and fully-supported wiki solution for vBulletin and XenForo.

      The VaultWiki Team encourages you to join our community of forum administrators and check out VaultWiki for yourself.

    Issue: Deadlock found when trying to get lock; try restarting transaction src/XF/Db/AbstractStatement.php:230

    • Issue Tools
      • View Changes
    1. issueid=6483 4 Weeks Ago 8:55 AM
      Alfa1 Alfa1 is offline
      Distinguished Member
      Deadlock found when trying to get lock; try restarting transaction src/XF/Db/AbstractStatement.php:230

      XF\Db\DeadlockException: Job vw\vw\Handler\Job\Defer: 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 16, 2025 at 5:00 AM

      Stack trace

      DELETE FROM `xf_vw_accelerate` WHERE entry_type = 'file' AND `entry_name` IN ('Restless Legs Syndrome/src/addons/vw/vw/_core/controller/fetch/stack/vw.php','Restless Legs Syndrome/src/addons/vw/vw/_core/model/index/xf2.php','Restless Legs Syndrome/src/addons/vw/vw/_core/model/index/xf0.php','Restless Legs Syndrome/src/addons/vw/vw/_core/model/index/vw.php','Restless Legs Syndrome/src/addons/vw/vw/_core/controller/dm/xf2.php','Restless Legs Syndrome/src/addons/vw/vw/_core/controller/dm/vw.php','Restless Legs Syndrome/src/addons/vw/vw/_core/controller/dm/page/xf2.php','Restless Legs Syndrome/src/addons/vw/vw/_core/controller/dm/page/vw.php','Restless Legs Syndrome/src/addons/vw/vw/_core/controller/dm/node/vw.php','Restless Legs Syndrome/src/addons/vw/vw/_core/controller/dm/base/routable/vw.php','Restless Legs Syndrome/src/addons/vw/vw/_core/controller/dm/base/vw.php','Restless Legs Syndrome/src/addons/vw/vw/_core/model/ui/tab/xf2.php','Restless Legs Syndrome/src/addons/vw/vw/_core/model/ui/tab/xf0.php','Restless Legs Syndrome/src/addons/vw/vw/_core/model/ui/tab/vw.php','Restless Legs Syndrome/src/addons/vw/vw/_core/controller/css/xf2.php','Restless Legs Syndrome/src/addons/vw/vw/_core/controller/css/vw.php','Restless Legs Syndrome/src/addons/vw/vw/_core/model/page/xf2.php','Restless Legs Syndrome/src/addons/vw/vw/_core/model/page/xf0.php','Restless Legs Syndrome/src/addons/vw/vw/_core/model/page/vw.php','Restless Legs Syndrome/src/addons/vw/vw/_core/view/reply/redirect/xf2.php','Restless Legs Syndrome/src/addons/vw/vw/_core/view/reply/redirect/xf0.php','Restless Legs Syndrome/src/addons/vw/vw/_core/view/reply/redirect/vw.php','Restless Legs Syndrome/src/addons/vw/vw/_core/controller/ui/page/xf2.php','Restless Legs Syndrome/src/addons/vw/vw/_core/controller/ui/page/xf0.php','Restless Legs Syndrome/src/addons/vw/vw/_core/controller/ui/page/vw.php','Restless Legs Syndrome/src/addons/vw/vw/_core/controller/nav/paging/xf2.php','Restless Legs Syndrome/src/addons/vw/vw/_core/controller/nav/paging/xf0.php','Restless Legs Syndrome/src/addons/vw/vw/_core/controller/nav/paging/vw.php','Restless Legs Syndrome/src/addons/vw/vw/_core/view/response/html/xf2.php','Restless Legs Syndrome/src/addons/vw/vw/_core/view/response/html/xf0.php','Restless Legs Syndrome/src/addons/vw/vw/_core/view/response/html/vw.php','Restless Legs Syndrome/src/addons/vw/vw/_core/view/ui/base/vw.php','Restless Legs Syndrome/src/addons/vw/vw/_core/instance/stack/block/xf2.php','Restless Legs Syndrome/src/addons/vw/vw/_core/instance/stack/block/xf0.php','Restless Legs Syndrome/src/addons/vw/vw/_core/instance/stack/block/vw.php','Restless Legs Syndrome/src/addons/vw/vw/_core/model/customfield/xf2.php','Restless Legs Syndrome/src/addons/vw/vw/_core/model/customfield/vw.php','Restless Legs Syndrome/src/addons/vw/vw/_core/model/contenttype/xf2.php','Restless Legs Syndrome/src/addons/vw/vw/_core/model/contenttype/vw.php','Restless Legs Syndrome/src/addons/vw/vw/_core/view/sidebar/xf2.php','Restless Legs Syndrome/src/addons/vw/vw/_core/view/sidebar/xf0.php','Restless Legs Syndrome/src/addons/vw/vw/_core/view/sidebar/vw.php','Restless Legs Syndrome/src/addons/vw/vw/_core/model/tagging/xf2.php','Restless Legs Syndrome/src/addons/vw/vw/_core/model/tagging/xf0.php','Restless Legs Syndrome/src/addons/vw/vw/_core/model/tagging/vw.php','Restless Legs Syndrome/src/addons/vw/vw/_core/controller/proxy/tagging/xf2.php','Restless Legs Syndrome/src/addons/vw/vw/_core/controller/proxy/tagging/vw.php','Restless Legs Syndrome/src/addons/vw/vw/_core/controller/proxy/tagging/page/xf2.php','Restless Legs Syndrome/src/addons/vw/vw/_core/controller/proxy/tagging/page/vw.php','Restless Legs Syndrome/src/addons/vw/vw/_core/controller/proxy/tagging/base/vw.php','Restless Legs Syndrome/src/addons/vw/vw/_core/view/microdata/xf2.php','Restless Legs Syndrome/src/addons/vw/vw/_core/view/microdata/vw.php','Restless Legs Syndrome/src/addons/vw/vw/_core/controller/fetch/language/xf2.php','Restless Legs Syndrome/src/addons/vw/vw/_core/controller/fetch/language/xf0.php','Restless Legs Syndrome/src/addons/vw/vw/_core/controller/fetch/language/vw.php','Restless Legs Syndrome/src/addons/vw/vw/_core/model/language/xf2.php','Restless Legs Syndrome/src/addons/vw/vw/_core/model/language/vw.php','Restless Legs Syndrome/src/addons/vw/vw/_core/controller/dm/language/xf2.php','Restless Legs Syndrome/src/addons/vw/vw/_core/controller/dm/language/vw.php','Restless Legs Syndrome/src/addons/vw/vw/_core/view/ui/stack/xf2.php','Restless Legs Syndrome/src/addons/vw/vw/_core/view/ui/stack/xf0.php','Restless Legs Syndrome/src/addons/vw/vw/_core/view/ui/stack/vw.php','Restless Legs Syndrome/src/addons/vw/vw/_core/view/factory/tab/xf2.php','Restless Legs Syndrome/src/addons/vw/vw/_core/view/factory/tab/vw.php','Restless Legs Syndrome/src/addons/vw/vw/_core/model/rating/xf2.php','Restless Legs Syndrome/src/addons/vw/vw/_core/model/rating/xf0.php','Restless Legs Syndrome/src/addons/vw/vw/_core/model/rating/vw.php','Restless Legs Syndrome/src/addons/vw/vw/_core/view/factory/tab/page/xf2.php','Restless Legs Syndrome/src/addons/vw/vw/_core/view/factory/tab/page/xf0.php','Restless Legs Syndrome/src/addons/vw/vw/_core/view/factory/tab/page/vw.php','Restless Legs Syndrome/src/addons/vw/vw/_core/view/factory/title/xf2.php','Restless Legs Syndrome/src/addons/vw/vw/_core/view/factory/title/xf0.php','Restless Legs Syndrome/src/addons/vw/vw/_core/view/factory/title/vw.php','Restless Legs Syndrome/src/addons/vw/vw/_core/view/ui/area/xf2.php','Restless Legs Syndrome/src/addons/vw/vw/_core/view/ui/area/vw.php','Restless Legs Syndrome/src/addons/vw/vw/_core/view/ui/index/xf2.php','Restless Legs Syndrome/src/addons/vw/vw/_core/view/ui/index/xf0.php','Restless Legs Syndrome/src/addons/vw/vw/_core/view/ui/index/vw.php','Restless Legs Syndrome/src/addons/vw/vw/_core/view/nav/xf2.php','Restless Legs Syndrome/src/addons/vw/vw/_core/view/nav/vw.php','Restless Legs Syndrome/src/addons/vw/vw/_core/instance/string/xf2.php','Restless Legs Syndrome/src/addons/vw/vw/_core/instance/string/xf0.php','Restless Legs Syndrome/src/addons/vw/vw/_core/instance/string/vw.php','Restless Legs Syndrome/src/addons/vw/vw/_core/model/microdata/xf2.php','Restless Legs Syndrome/src/addons/vw/vw/_core/model/microdata/xf0.php','Restless Legs Syndrome/src/addons/vw/vw/_core/model/microdata/vw.php','Restless Legs Syndrome/src/addons/vw/vw/_helper/schemaorg/DataType/Article.php','Restless Legs Syndrome/src/addons/vw/vw/_helper/schemaorg/DataType/CreativeWork.php','Restless Legs Syndrome/src/addons/vw/vw/_helper/schemaorg/DataType/Thing.php','Restless Legs Syndrome/src/addons/vw/vw/_helper/schemaorg/DataType.php','Restless Legs Syndrome/src/addons/vw/vw/_helper/schemaorg/Basic.php','Restless Legs Syndrome/src/addons/vw/vw/_core/view/factory/block/xf2.php','Restless Legs Syndrome/src/addons/vw/vw/_core/view/factory/block/xf0.php','Restless Legs Syndrome/src/addons/vw/vw/_core/view/factory/block/vw.php','Restless Legs Syndrome/src/addons/vw/vw/_core/model/block/search/xf2.php','Restless Legs Syndrome/src/addons/vw/vw/_core/model/block/search/xf0.php','Restless Legs Syndrome/src/addons/vw/vw/_core/model/block/search/vw.php','Restless Legs Syndrome/src/addons/vw/vw/_core/view/factory/block/search/xf2.php','Restless Legs Syndrome/src/addons/vw/vw/_core/view/factory/block/search/xf0.php','Restless Legs Syndrome/src/addons/vw/vw/_core/view/factory/block/search/vw.php') LIMIT 100
      ------------

      #0 src/XF/Db/Mysqli/Statement.php(207): XF\Db\AbstractStatement->getException('MySQL query err...', 1213, '40001')
      #1 src/XF/Db/Mysqli/Statement.php(83): XF\Db\Mysqli\Statement->getException('MySQL query err...', 1213, '40001')
      #2 src/XF/Db/AbstractAdapter.php(96): XF\Db\Mysqli\Statement->execute()
      #3 src/addons/vw/vw/_core/controller/db/xf2.php(118): XF\Db\AbstractAdapter->query('DELETE FROM `xf...')
      #4 src/addons/vw/vw/_core/model/db/mysql/vw.php(1521): vw_DB_Controller_XF2->query_write('DELETE FROM `xf...')
      #5 src/addons/vw/vw/_core/model/db/mysql/vw.php(371): vw_DB_MySQL_Model->shutdown_or_run('DELETE FROM `xf...', false)
      #6 src/addons/vw/vw/_core/model/cron/cleanup/vw.php(390): vw_DB_MySQL_Model->delete(Array)
      #7 src/addons/vw/vw/_core/model/cron/deferred/cleanup/vw.php(61): vw_Cron_Cleanup_Model->clean_classcache(1757995221)
      #8 src/addons/vw/vw/_core/model/cron/deferred/vw.php(66): vw_Cron_Deferred_Cleanup_Model->run(Array)
      #9 src/addons/vw/vw/Handler/Job/Defer.php(41): vw_Cron_Deferred_Model->exec()
      #10 src/XF/Job/Manager.php(275): vw\vw\Handler\Job\Defer->run(7.77986)
      #11 src/XF/Job/Manager.php(205): XF\Job\Manager->runJobInternal(Array, 7.77986)
      #12 src/XF/Job/Manager.php(89): XF\Job\Manager->runJobEntry(Array, 7.77986)
      #13 job.php(46): XF\Job\Manager->runQueue(false, 8)
      #14 {main}

      Request state

      array(4) {
      ["url"] => string(8) "/job.php"
      ["referrer"] => string(38) "https://forum.com/reports/20466/"
      ["_GET"] => array(0) {
      }
      ["_POST"] => array(0) {
      }
      }

      VW4.1.19
      XF2.3.7
      PHP8.3
    Issue Details
    Issue Number 6483
    Issue Type Bug
    Project VaultWiki 4.x Series
    Category Unknown
    Status Fixed
    Priority 2 - Fatal / Database Errors
    Affected Version 4.1.9
    Fixed Version 4.1.10
    Milestone (none)
    Software DependencyXenForo 2.x
    License TypePaid
    Users able to reproduce bug 0
    Users unable to reproduce bug 0
    Attachments 0
    Assigned Users (none)
    Tags (none)




    1. 4 Weeks Ago 9:03 AM
      Alfa1 Alfa1 is offline
      Distinguished Member
      Could be related to:
      https://www.vaultwiki.org/issues/6470/
      Reply Reply  
    2. 4 Weeks Ago 12:34 AM
      pegasus pegasus is offline
      VaultWiki Team
      This is hard to reproduce, but I'm tentatively making it as Fixed in the next release.

      Most likely the cron is deadlocked because it's trying to mass delete a bunch of cache rows, at the same time another user is trying to update some of the same cache rows. We've basically eliminated all the other logical scenarios at this point, and actually we've already fixed it so the user trying to update doesn't get the deadlock (they can always try their update again next reload).

      Deadlocks usually happen when performing mass updates against an active database like this. The methods to "fix" it are basically to try to avoid the situation as much as possible. In certain cases, it may be possible to do this by establishing a lock so only one user can do their activity at a time. But since the user actually defers their cache update here, we are unable to use a lock. In other cases, we ignore the error and suppress it if we don't care that it failed. And in other cases, we retry the query a bunch of times until it succeeds or times out, and in that case still deadlock.

      For this particular case, we do care if it fails, because not deleting the rows could result in a stale/bad cache. So our only option is to retry the query in much smaller batches, which will result in several hundred (or thousand) queries, but I guess that's okay in a daily cron job like this. Then if a single batch fails, we can ignore that batch since that's the one that's getting updated by the user anyway.
      Reply Reply  
    3. 3 Weeks Ago 8:01 AM
      Alfa1 Alfa1 is offline
      Distinguished Member
      I'm trying to figure out why XF now is not firing various jobs and leaving a mass of jobs in the queue with multiple attempts.
      See:
      https://nixfifty.com/threads/1500-jo...iggered.19728/
      And a related Push Alert error here:
      https://atelieraphelion.com/threads/...php-3759.1375/

      I dont know if this related or not, but it would make sense.
      Reply Reply  
    4. 2 Weeks Ago 2:08 AM
      pegasus pegasus is offline
      VaultWiki Team
      Before I get too deep in the weeds, you can check your xf_job table for any job where manual_execute = 0 and the trigger_date is more than an hour ago. If you can find those criteria, then the admin message talking about stopped jobs will appear. But I'm not sure it automatically means jobs are stopped. You may just have a job that is taking a really long time. You may want to compare how long ago the last_run_date is for any offending row.

      I'd be surprised if VaultWiki receiving an occasional deadlock has anything to do with that. VaultWiki's individual tasks are relatively siloed from the rest of the job system. XenForo runs generically a VaultWiki task, and VaultWiki gets to decide what the task is. VaultWiki knows not to reattempt the same task twice. Once a task is started, it is locked and is placed on hold if the lock exists for longer than 5 minutes. Meanwhile, XenForo could be continuing to process other jobs. Even if it reissued the VaultWiki job because it recently failed, VaultWiki would proceed to a different task because a lock already exists on the failed task. That task will not be attempted again until VaultWiki actively adds it back to the queue, and then it's at the back of the queue.

      While VaultWiki queues tasks very often, it is highly unlikely that VaultWiki somehow repeatedly jumps to the front of the job queue if there are other jobs already scheduled for the same time. You can actually see what job is next in the AdminCP's Cron Entries list.

      Regardless, you can silence the deadlock messages in this case, because we don't really care if this query fails. In src/addons/vw/vw/_core/model/cron/cleanup/vw.php, find:
      Code:
      					vw_DB::get()->query()->delete(array(
      						'table' => 'vw_accelerate',
      						'where' => array(
      							vw_DB::get()->query()->eq('entry_type', $dbtype),
      							vw_DB::get()->query()->in('entry_name', $set)
      						),
      						'limit' => count($set)
      					));
      Replace with:
      Code:
      					vw_DB::get()->func()->hide_errors();
      
      					vw_DB::get()->query()->delete(array(
      						'table' => 'vw_accelerate',
      						'where' => array(
      							vw_DB::get()->query()->eq('entry_type', $dbtype),
      							vw_DB::get()->query()->in('entry_name', $set)
      						),
      						'limit' => count($set)
      					));
      
      					vw_DB::get()->func()->show_errors();
      Reply Reply  
    + Reply

    Assigned Users
    Loading Please Wait
    Tags
    Loading Please Wait
    • Contact Us
    • License Agreement
    • Privacy
    • Terms
    • Top
    All times are GMT -4. The time now is 1:41 AM.
    This site uses cookies to help personalize content, to tailor your experience, and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Learn more… Accept Remind me later
  • striker
    Powered by vBulletin® Version 4.2.5 Beta 2
    Copyright © 2025 vBulletin Solutions Inc. All rights reserved.
    Search Engine Optimisation provided by DragonByte SEO (Pro) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
    Copyright © 2008 - 2024 VaultWiki Team, Cracked Egg Studios, LLC.