XF 2.1 Error when delete user with batch update

maszd

Well-known member
Hi,
i get this error on acp when delete user with zero post using batch update

Rich (BB code):
Server error log

    XF\Db\DeadlockException: Job XF:UserDeleteCleanUp: MySQL query error [1213]: Deadlock found when trying to get lock; try restarting transaction src/XF/Db/AbstractStatement.php:228

    Generated by: Unknown account Apr 1, 2020 at 6:08 AM

Stack trace

            UPDATE (
                SELECT content_id FROM xf_reaction_content
                WHERE content_type = ?
                AND reaction_user_id = ?
            ) AS temp
            INNER JOIN xf_post AS reaction_table ON (reaction_table.`post_id` = temp.content_id)
            SET reaction_table.`reaction_users` = REPLACE(reaction_table.`reaction_users`, ?, ?)
      
------------

#0 src/XF/Db/Mysqli/Statement.php(196): XF\Db\AbstractStatement->getException('MySQL query err...', 1213, '40001')
#1 src/XF/Db/Mysqli/Statement.php(77): XF\Db\Mysqli\Statement->getException('MySQL query err...', 1213, '40001')
#2 src/XF/Db/AbstractAdapter.php(94): XF\Db\Mysqli\Statement->execute()
#3 src/XF/Reaction/AbstractHandler.php(141): XF\Db\AbstractAdapter->query('
            UPDATE (
        ...', Array)
#4 src/XF/Service/User/ContentChange.php(343): XF\Reaction\AbstractHandler->updateRecentCacheForUserChange(1483, 0, 'Jose', 'Jose')
#5 src/XF/MultiPartRunnerTrait.php(48): XF\Service\User\ContentChange->stepRebuildReactions(0, G)
#6 src/XF/Service/User/ContentChange.php(198): XF\Service\User\ContentChange->runLoop(G)
#7 src/XF/Service/User/DeleteCleanUp.php(255): XF\Service\User\ContentChange->apply(G)
#8 src/XF/MultiPartRunnerTrait.php(48): XF\Service\User\DeleteCleanUp->stepChangeOwner(NULL, G)
#9 src/XF/Service/User/DeleteCleanUp.php(93): XF\Service\User\DeleteCleanUp->runLoop(G)
#10 src/XF/Job/UserDeleteCleanUp.php(32): XF\Service\User\DeleteCleanUp->cleanUp(G)
#11 src/XF/Job/Manager.php(253): XF\Job\UserDeleteCleanUp->run(G)
#12 src/XF/Job/Manager.php(195): XF\Job\Manager->runJobInternal(Array, G)
#13 src/XF/Job/Manager.php(79): XF\Job\Manager->runJobEntry(Array, G)
#14 job.php(42): XF\Job\Manager->runQueue(false, 8)
#15 {main}

Request state

array(4) {
  ["url"] => string(8) "/job.php"
  ["referrer"] => string(24) "https://forum.com/"
  ["_GET"] => array(0) {
  }
  ["_POST"] => array(0) {
  }
}
 
Are you able to query the database to see how many reactions that account has given?
yes, what command to do that?
btw user with zero post was delete from my forum using batch update, its show complete but when i back to acp dasbord this error appear.
 
I'm not in my office and don't have access to the schema, but I'm guessing something like:
SQL:
SELECT count(*) FROM xf_reaction_content WHERE reaction_user_id = x


Replace x with the user's ID.
 
There are quite a few reports of this looking at the search facility, and it has been happening since XF2.0.

It is certainly something we see every time we do a batch user deletion and I have hundreds of errors in our log right now.

My concern is if this is actually leaving orphaned data in the database? Not such a big problem if the data is cleaned up by any of the daily/hourly cron cleanup jobs.
 
Back
Top Bottom