View Issue Details

IDProjectCategoryView StatusLast Update
0006762OXID eShop (all versions)4.09. SEO, SEO URLpublic2022-07-25 11:46
Reporter[email protected] Assigned To 
PrioritynormalSeverityminorReproducibilityalways
Status resolvedResolutionfixed 
Product Version4.10.6 / 5.3.6 
Fixed in Version6.4.3 
Summary0006762: Deadlock in oxseo when deleting categories in backend
DescriptionWe deleted a lot of inactive categories in the backend. During this process we had a lot of traffic in the shop. When users where clicking on product lists, some products and categories we received a deadlock in the oxseo table when the click produced a new entry in the oxseo table. Our shop was not reachable for other users during the deadlock.
Steps To Reproduce1. Delete categories in the backend
2. When delete categories is loading/running then you have to click in product lists or categories in the frontend which generate a new entry in the oxseo table (insert/update).
Additional InformationSee attached error output
TagsDatabase, SEO
ThemeAll
BrowserAll
PHP Version7.3
Database VersionNot defined

Relationships

related to 0005892 resolvedrobert blank Add index on OXSEO table to avoid random deadlocks 

Activities

QA

2018-01-05 10:09

administrator   ~0012344

Reproducible by executing the following script at least two times parallel (by executing it three times parallel it happens nearly instantly):

require_once '../bootstrap.php';

while (true) {

    $cat = oxNew('oxcategory');
    $cat->oxcategories__oxid = new oxField('3b053b36ff5337f42814b9e081914fdd');
    $cat->oxcategories__oxparentid = new oxField('oxrootid');

    $cat->save();

    oxRegistry::get('oxSeoEncoderCategory')->getCategoryUri($cat, 0);

    $cat->delete();
}


The tracked error message:


PHP Fatal error:  Uncaught oxAdoDbException: mysqli error: [1213: Deadlock found when trying to get lock; try restarting transaction] in EXECUTE (update oxseo, (select oxseourl from oxseo where oxobjectid = 'b39215f19ab428069517e4633c812a3d' and oxtype = 'oxcategory') as test set oxseo.oxexpired=1 where oxseo.oxseourl like concat(test.oxseourl, '%') and (oxtype = 'oxcategory' or oxtype = 'oxarticle'), Array) with user root
 in /var/www/html/e536/core/adodblite/adodb-exceptions.inc.php:84
Stack trace:
#0 /var/www/html/e536/core/adodblite/adodbSQL_drivers/mysqli/mysqli_driver.inc(359): adodb_throw('mysqli', 'EXECUTE', 1213, 'Deadlock found ...', 'update oxseo, (...', Array, Object(object_ADOConnection))
#1 /var/www/html/e536/core/adodblite/adodb.inc.php(316): mysqli_driver_ADOConnection->do_query('update oxseo, (...', -1, -1, Array)
#2 /var/www/html/e536/core/oxlegacydb.php(236): ADOConnection->Execute('update oxseo, (...', Array)
#3 /var/www/html/e536/application/models/oxseoencodercategory.php(236): oxLegacyDb->execute('update in /var/www/html/e536/core/adodblite/adodb-exceptions.inc.php on line 84

PHP Fatal error:  Uncaught oxAdoDbException: mysqli error: [1213: Deadlock found when trying to get lock; try restarting transaction] in EXECUTE (insert into oxseo
                    (oxobjectid, oxident, oxshopid, oxlang, oxstdurl, oxseourl, oxtype, oxfixed, oxexpired, oxparams)
                values
                    ( '7960ed5c28d65f0ffa8a8b66930337cc', 'ca4802ac3ef38edea35dc4691ce2fd5b', '1', 0, 'index.php?cl=alist&cnid=7960ed5c28d65f0ffa8a8b66930337cc', 'oxid-oxid-1/', 'oxcategory', '0', '0', "" )
                on duplicate key update
                    oxident = 'ca4802ac3ef38edea35dc4691ce2fd5b', oxstdurl = 'index.php?cl=alist&cnid=7960ed5c28d65f0ffa8a8b66930337cc', oxseourl = 'oxid-oxid-1/', oxfixed = '0', oxexpired = '0', Array) with user root
 in /var/www/html/e536/core/adodblite/adodb-exceptions.inc.php:84
Stack trace:
#0 /var/www/html/e536/core/adodblite/adodbSQL_drivers/mysqli/mysqli_driver.inc(359): adodb_throw('mysqli', 'EXECUTE', 1213, 'Deadlock found ...', 'insert into oxs...', Array, Object(obj in /var/www/html/e536/core/adodblite/adodb-exceptions.inc.php on line 84