Fixed xf_deletion_log Server error log

Nirjonadda

Well-known member
Affected version
2.1.3
Server error log

Code:
XF\Db\DuplicateKeyException: MySQL query error [1062]: Duplicate entry 'post-849322' for key 'PRIMARY' src/XF/Db/AbstractStatement.php:217

Generated by: prinanad Aug 26, 2019 at 7:10 PM

Stack trace

INSERT  INTO `xf_deletion_log` (`content_type`, `content_id`, `delete_user_id`, `delete_username`, `delete_reason`, `delete_date`) VALUES (?, ?, ?, ?, ?, ?)
------------

#0 src/XF/Db/Mysqli/Statement.php(196): XF\Db\AbstractStatement->getException('MySQL query err...', 1062, '23000')
#1 src/XF/Db/Mysqli/Statement.php(77): XF\Db\Mysqli\Statement->getException('MySQL query err...', 1062, '23000')
#2 src/XF/Db/AbstractAdapter.php(94): XF\Db\Mysqli\Statement->execute()
#3 src/XF/Db/AbstractAdapter.php(218): XF\Db\AbstractAdapter->query('INSERT  INTO `x...', Array)
#4 src/XF/Mvc/Entity/Entity.php(1452): XF\Db\AbstractAdapter->insert('xf_deletion_log', Array, false)
#5 src/XF/Mvc/Entity/Entity.php(1184): XF\Mvc\Entity\Entity->_saveToSource()
#6 src/XF/Mvc/Entity/Entity.php(1202): XF\Mvc\Entity\Entity->save(true, false)
#7 src/XF/Entity/Post.php(776): XF\Mvc\Entity\Entity->save()
#8 src/XF/Service/Post/Deleter.php(81): XF\Entity\Post->softDelete('', Object(Datio\AllowedEmails\XF\Entity\User))
#9 src/XF/Pub/Controller/Post.php(255): XF\Service\Post\Deleter->delete('soft', '')
#10 src/XF/Mvc/Dispatcher.php(321): XF\Pub\Controller\Post->actionDelete(Object(XF\Mvc\ParameterBag))
#11 src/XF/Mvc/Dispatcher.php(244): XF\Mvc\Dispatcher->dispatchClass('XF:Post', 'Delete', Object(XF\Mvc\RouteMatch), Object(TickTackk\ContentCopyProtection\XF\Pub\Controller\Post), NULL)
#12 src/XF/Mvc/Dispatcher.php(100): XF\Mvc\Dispatcher->dispatchFromMatch(Object(XF\Mvc\RouteMatch), Object(TickTackk\ContentCopyProtection\XF\Pub\Controller\Post), NULL)
#13 src/XF/Mvc/Dispatcher.php(50): XF\Mvc\Dispatcher->dispatchLoop(Object(XF\Mvc\RouteMatch))
#14 src/XF/App.php(2178): XF\Mvc\Dispatcher->run()
#15 src/XF.php(390): XF\App->run()
#16 index.php(20): XF::runApp('XF\\Pub\\App')
#17 {main}

Request state

array(4) {
  ["url"] => string(20) "/posts/849322/delete"
  ["referrer"] => string(43) "/threads/58993/page-9"
  ["_GET"] => array(0) {
  }
  ["_POST"] => array(9) {
    ["hard_delete"] => string(1) "0"
    ["reason"] => string(0) ""
    ["author_alert"] => string(1) "1"
    ["author_alert_reason"] => string(45) "spams/meaningless unrelated comments deleted."
    ["_xfRedirect"] => string(43) "/threads/58993/page-9"
    ["_xfToken"] => string(8) "********"
    ["_xfRequestUri"] => string(21) "/threads/58993/page-9"
    ["_xfWithData"] => string(1) "1"
    ["_xfResponseType"] => string(4) "json"
  }
}
 
Thank you for reporting this issue, it has now been resolved. We are aiming to include any changes that have been made in a future XF release (2.2.0 RC1).

Change log:
Prevent a race condition related to soft deleting threads or posts
There may be a delay before changes are rolled out to the XenForo Community.
 
Back
Top Bottom