Fixed Mysqli statement execute error : Duplicate entry xxxx for key PRIMARY

yessir

Active member
I keep getting errors like this over the last few weeks.

Code:
Server Error Log
Error Info
Zend_Db_Statement_Mysqli_Exception: Mysqli statement execute error : Duplicate entry '762-2' for key 'PRIMARY' - library/Zend/Db/Statement/Mysqli.php:214
Generated By: xxxxxxxx, Yesterday at 12:55 PM
Stack Trace
#0 /home/xxxxx/public_html/library/Zend/Db/Statement.php(297): Zend_Db_Statement_Mysqli->_execute(Array)
#1 /home/xxxxx/public_html/library/Zend/Db/Adapter/Abstract.php(479): Zend_Db_Statement->execute(Array)
#2 /home/xxxxx/public_html/library/Zend/Db/Adapter/Abstract.php(574): Zend_Db_Adapter_Abstract->query('INSERT INTO `xf...', Array)
#3 /home/xxxxx/public_html/library/XenForo/DataWriter/User.php(944): Zend_Db_Adapter_Abstract->insert('xf_user_group_r...', Array)
#4 /home/xxxxx/public_html/library/XenForo/DataWriter/User.php(881): XenForo_DataWriter_User->rebuildUserGroupRelations()
#5 /home/xxxxx/public_html/library/XenForo/DataWriter.php(1397): XenForo_DataWriter_User->_postSave()
#6 /home/xxxxx/public_html/library/XenForo/Model/User.php(1615): XenForo_DataWriter->save()
#7 /home/xxxxx/public_html/library/XenForo/Model/User.php(1520): XenForo_Model_User->_applyUserGroupChanges(762, Array, Array)
#8 /home/xxxxx/public_html/library/XenForo/Model/UserGroupPromotion.php(338): XenForo_Model_User->removeUserGroupChange(762, 'ugPromotion1')
#9 /home/xxxxx/public_html/library/XenForo/Model/UserGroupPromotion.php(295): XenForo_Model_UserGroupPromotion->demoteUser(Array, 762)
#10 /home/xxxxx/public_html/library/XenForo/ControllerPublic/Abstract.php(77): XenForo_Model_UserGroupPromotion->updatePromotionsForUser(Array)
#11 /home/xxxxx/public_html/library/XenForo/ControllerPublic/Abstract.php(16): XenForo_ControllerPublic_Abstract->_executePromotionUpdate()
#12 /home/xxxxx/public_html/library/Tapatalk/Bridge.php(67): XenForo_ControllerPublic_Abstract->_preDispatchType('get_inbox_stat')
#13 /home/xxxxx/public_html/mobiquo/mobiquo.php(69): Tapatalk_Bridge->init()
#14 {main}
Request State
array(3) {
  ["url"] => string(43) "http://xxxxxxxxxxx.com/mobiquo/mobiquo.php"
  ["_GET"] => array(0) {
  }
  ["_POST"] => array(0) {
  }
}

The keys with the errors are typically 762-2 or 376-2.

I have no idea how to resolve it.
 
Also get the error on other files than Tapatalk, example

Code:
Request State
array(3) {
  ["url"] => string(52) "http://www.xxxxxxxxx.com/find-new/3179548/threads"
  ["_GET"] => array(0) {
  }
  ["_POST"] => array(0) {
  }
}
 
This may be caused by an issue in an add-on, though it's generally something I can prevent in the core code, so sorted now.
 
Back
Top Bottom