Partial fix Duplicate entry '1133-405' for key 'PRIMARY'

Tom

Active member
Affected version
1.2.4
This seems to be a common error that's appearing in the logs. I'm not entirely sure if it's caused purely by RM itself, or whether there is a conflict with an addon anywhere. You may be able to shed some more light on exactly what's causing this.

Stack Trace:
Code:
#0 /home/afellows/public_html/library/Zend/Db/Statement.php(297): Zend_Db_Statement_Mysqli->_execute(Array)
#1 /home/afellows/public_html/library/Zend/Db/Adapter/Abstract.php(479): Zend_Db_Statement->execute(Array)
#2 /home/afellows/public_html/library/Zend/Db/Adapter/Abstract.php(574): Zend_Db_Adapter_Abstract->query('INSERT INTO `xf...', Array)
#3 /home/afellows/public_html/internal_data/proxy_classes/XenForo_DataWriter__1506781796.php(1638): Zend_Db_Adapter_Abstract->insert('xf_resource_wat...', Array)
#4 /home/afellows/public_html/internal_data/proxy_classes/XenForo_DataWriter__1506781796.php(1627): XFProxy_XenForo_DataWriter->_insert()
#5 /home/afellows/public_html/internal_data/proxy_classes/XenForo_DataWriter__1506781796.php(1419): XFProxy_XenForo_DataWriter->_save()
#6 /home/afellows/public_html/library/XenResource/Model/ResourceWatch.php(376): XFProxy_XenForo_DataWriter->save()
#7 /home/afellows/public_html/library/XenResource/ControllerPublic/Resource.php(2167): XenResource_Model_ResourceWatch->setResourceWatchStateWithUserDefault(1133, 405, 'watch_email')
#8 /home/afellows/public_html/library/XenForo/FrontController.php(351): XenResource_ControllerPublic_Resource->actionDownload()
#9 /home/afellows/public_html/library/XenForo/FrontController.php(134): XenForo_FrontController->dispatch(Object(XenForo_RouteMatch))
#10 /home/afellows/public_html/index.php(13): XenForo_FrontController->run()
#11 {main}

Request State:
Code:
array(3) {
  ["url"] => string(91) "https://fellowsfilm.co.uk/files/botw-legacy-edition-beta-route-pr1.405/download?version=471"
  ["_GET"] => array(1) {
    ["version"] => string(3) "471"
  }
  ["_POST"] => array(0) {
  }
}
 
Generally, errors like this can be ignored. It's specifically caused by a race condition, which should normally be a very small window.

XF1 doesn't have great scope for suppressing these errors (without catching other ones), but XF2 does have a framework to do that, so I've now prevented this from being triggered in XF2/XFRM2. (As such, I'm noting this as a partial fix, since this report relates to XFRM1.)
 
Top Bottom