cancel
Showing results for 
Search instead for 
Did you mean: 

Category generating weird issues in url rewrites and adding to a product

Category generating weird issues in url rewrites and adding to a product

im experiencing some issues in a magento intance and after track them i think it all breaks down to a category. (isolated-organ-perfusion-studies/isolated-heart-perfusion-systems) The issues i experienced are:

  • Generation of url_rewrites, like:

isolated-organ-perfusion-studies/isolated-heart-perfusion-systems/application-specific-measurements-options-for-isolated-heart-systems/lvp-measurement .html/universal-left-ventricular-pressure-lvp-kits-with-stainless-steel-catheter.html

notice the .html inside the url and not only at the end.

  • Unability to use more than one category from its subcategories

For instance if i take a product like again the universal-left-ventricular-pressure-lvp-kits-with-stainless-steel-catheter that already has the cateogry lvp-measurement (a child of my problematic category) and try to add lets say another category lets say isolated-organ-perfusion-studies/isolated-heart-perfusion-systems /application-specific-measurements-options-for-isolated-heart-systems/lvp-pressure-kits

that will throw an Unique constraint violation found exeption so that product can only be inside one category of the entire tree inside the isolated-heart-perfusion-systems.

In the exeption log i got this:

[2020-03-02 20:02:35] main.CRITICAL: Unique constraint violation found { "exception":"[object] (Magento\Framework\Exception\AlreadyExists Exception(code: 0): Unique constraint violation found at /srv/public_html/vendor/magento/framework/EntityManager/Operation/Update.php: 121, Magento\Framework\DB\Adapter\DuplicateException(code: 1062): SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry 'isolated-organ-perfusion-studies/isolated-heart-perfusion-system' for key 'URL_REWRITE_REQUEST_PATH_STORE_ID', query was: INSERT INTO url_rewrite (redirect_type,is_autogenerated,metadata,description,entity_type,entity_id,request_path,target_path,store_id) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?), (?, ?, ?, ?, ?, ?, ?, ?, ?), (?, ?, ?, ?, ?, ?, ?, ?, ?), (?, ?, ?, ?, ?, ?, ?, ?, ?), (?, ?, ?, ?, ?, ?, ?, ?, ?), (?, ?, ?, ?, ?, ?, ?, ?, ?), (?, ?, ?, ?, ?, ?, ?, ?, ?) at /srv/public_html/vendor/magento/framework/DB/Adapter/Pdo/Mysql.php: 589, Zend_Db_Statement_Exception(code: 23000): SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry 'isolated-organ-perfusion-studies/isolated-heart-perfusion-system' for key 'URL_REWRITE_REQUEST_PATH_STORE_ID', query was: INSERT INTO url_rewrite (redirect_type,is_autogenerated,metadata,description,entity_type,entity_id,request_path,target_path,store_id)
VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?), (?, ?, ?, ?, ?, ?, ?, ?, ?), (?, ?, ?, ?, ?, ?, ?, ?, ?), (?, ?, ?, ?, ?, ?, ?, ?, ?), (?, ?, ?, ?, ?, ?, ?, ?, ?), (?, ?, ?, ?, ?, ?, ?, ?, ?), (?, ?, ?, ?, ?, ?, ?, ?, ?) at /srv/public_html/vendor/magento/framework/DB/Statement/Pdo/Mysql.php: 110, PDOException(code: 23000): SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry 'isolated-organ-perfusion-studies/isolated-heart-perfusion-system' for key 'URL_REWRITE_REQUEST_PATH_STORE_ID' at /srv/public_html/vendor/magento/framework/DB/Statement/Pdo/Mysql.php:91)"} []

Obviously i have checked the url rewrite table and i can say that no conflict exist for that even if i manually delete the rewrites for that product it'll not generate the new rewrites if i use more than one subcategory of isolated-heart-perfusion-systems

I already found several posts almost all of them explaining that it most be a problem with duplicate url keys and stuff messing with the url rewrites a lot of them pointing me a cadence lab module for cleaning dupes and regenerating the rewrites table

 

https://www.cadence-labs.com/2017/11/magento-2-fix-duplicate-url-key-for-categories-and-products/

 

and after using it indeed i have some problems in my products but it coulnd find anything on categories not by this process or on the data base even after regenerating the entire url rewrite table that particular category dindt generate its own url it remain as catag/category/view/5 on sitemap, t has to be generated manually. so right now im running out of ideas and in fear that maybe its another category somewhere that could have similar issues. any idea guys???

1 REPLY 1

Re: Category generating weird issues in url rewrites and adding to a product

Same error message here after creating a new storeview for a new website/store. Anybody? Magento2.3.4p2.

 

[2020-08-04 12:09:39] main.CRITICAL: Exception message: SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry 'home-3' for key 'URL_REWRITE_REQUEST_PATH_STORE_ID', query was: INSERT  INTO `url_rewrite` (`redirect_type`,`is_autogenerated`,`metadata`,`description`,`store_id`,`entity_type`,`entity_id`,`request_path`,`target_path`) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?), (?, ?, ?, ?, ?, ?, ?, ?, ?), (?, ?, ?, ?, ?, ?, ?, ?, ?), (?, ?, ?, ?, ?, ?, ?, ?, ?), (?, ?, ?, ?, ?, ?, ?, ?, ?), (?, ?, ?, ?, ?, ?, ?, ?, ?), (?, ?, ?, ?, ?, ?, ?, ?, ?), (?, ?, ?, ?, ?, ?, ?, ?, ?), (?, ?, ?, ?, ?, ?, ?, ?, ?), (?, ?, ?, ?, ?, ?, ?, ?, ?), (?, ?, ?, ?, ?, ?, ?, ?, ?), (?, ?, ?, ?, ?, ?, ?, ?, ?), (?, ?, ?, ?, ?, ?, ?, ?, ?), (?, ?, ?, ?, ?, ?, ?, ?, ?), (?, ?, ?, ?, ?, ?, ?, ?, ?), (?, ?, ?, ?, ?, ?, ?, ?, ?), (?, ?, ?, ?, ?, ?, ?, ?, ?), (?, ?, ?, ?, ?, ?, ?, ?, ?), (?, ?, ?, ?, ?, ?, ?, ?, ?), (?, ?, ?, ?, ?, ?, ?, ?, ?), (?, ?, ?, ?, ?, ?, ?, ?, ?), (?, ?, ?, ?, ?, ?, ?, ?, ?), (?, ?, ?, ?, ?, ?, ?, ?, ?), (?, ?, ?, ?, ?, ?, ?, ?, ?), (?, ?, ?, ?, ?, ?, ?, ?, ?), (?, ?, ?, ?, ?, ?, ?, ?, ?), (?, ?, ?, ?, ?, ?, ?, ?, ?), (?, ?, ?, ?, ?, ?, ?, ?, ?), (?, ?, ?, ?, ?, ?, ?, ?, ?), (?, ?, ?, ?, ?, ?, ?, ?, ?), (?, ?, ?, ?, ?, ?, ?, ?, ?), (?, ?, ?, ?, ?, ?, ?, ?, ?), (?, ?, ?, ?, ?, ?, ?, ?, ?), (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, ?, ?), (?, ?, ?, ?, ?, ?, ?, ?, ?), (?, ?, ?, ?, ?, ?, ?, ?, ?), (?, ?, ?, ?, ?, ?, ?, ?, ?), (?, ?, ?, ?, ?, ?, ?, ?, ?), (?, ?, ?, ?, ?, ?, ?, ?, ?), (?, ?, ?, ?, ?, ?, ?, ?, ?), (?, ?, ?, ?, ?, ?, ?, ?, ?), (?, ?, ?, ?, ?, ?, ?, ?, ?), (?, ?, ?, ?, ?, ?, ?, ?, ?), (?, ?, ?, ?, ?, ?, ?, ?, ?), (?, ?, ?, ?, ?, ?, ?, ?, ?), (?, ?, ?, ?, ?, ?, ?, ?, ?), (?, ?, ?, ?, ?, ?, ?, ?, ?), (?, ?, ?, ?, ?, ?, ?, ?, ?)
Trace: <pre>#1 Magento\Framework\DB\Adapter\Pdo\Mysql->query() called at [vendor/magento/framework/DB/Adapter/Pdo/Mysql.php:2063]
#2 Magento\Framework\DB\Adapter\Pdo\Mysql->insertArray() called at [vendor/magento/framework/DB/Adapter/Pdo/Mysql.php:2020]
#3 Magento\Framework\DB\Adapter\Pdo\Mysql->insertMultiple() called at [vendor/magento/module-url-rewrite/Model/Storage/DbStorage.php:332]
#4 Magento\UrlRewrite\Model\Storage\DbStorage->insertMultiple() called at [vendor/magento/module-url-rewrite/Model/Storage/DbStorage.php:282]
#5 Magento\UrlRewrite\Model\Storage\DbStorage->doReplace() called at [vendor/magento/module-url-rewrite/Model/Storage/AbstractStorage.php:87]
#6 Magento\UrlRewrite\Model\Storage\AbstractStorage->replace() called at [vendor/magento/framework/Interception/Interceptor.php:58]
#7 Magento\UrlRewrite\Model\Storage\DbStorage\Interceptor->___callParent() called at [vendor/magento/framework/Interception/Interceptor.php:138]
#8 Magento\UrlRewrite\Model\Storage\DbStorage\Interceptor->Magento\Framework\Interception\{closure}() called at [vendor/magento/framework/Interception/Interceptor.php:153]
#9 Magento\UrlRewrite\Model\Storage\DbStorage\Interceptor->___callPlugins() called at [generated/code/Magento/UrlRewrite/Model/Storage/DbStorage/Interceptor.php:39]
#10 Magento\UrlRewrite\Model\Storage\DbStorage\Interceptor->replace() called at [vendor/magento/module-cms-url-rewrite/Plugin/Cms/Model/Store/View.php:77]
#11 Magento\CmsUrlRewrite\Plugin\Cms\Model\Store\View->afterSave() called at [vendor/magento/framework/Interception/Interceptor.php:146]
#12 Magento\Store\Model\ResourceModel\Store\Interceptor->Magento\Framework\Interception\{closure}() called at [vendor/magento/framework/Interception/Interceptor.php:153]
#13 Magento\Store\Model\ResourceModel\Store\Interceptor->___callPlugins() called at [generated/code/Magento/Store/Model/ResourceModel/Store/Interceptor.php:26]
#14 Magento\Store\Model\ResourceModel\Store\Interceptor->save() called at [vendor/magento/framework/Model/AbstractModel.php:655]
#15 Magento\Framework\Model\AbstractModel->save() called at [vendor/magento/framework/Interception/Interceptor.php:58]
#16 Magento\Store\Model\Store\Interceptor->___callParent() called at [vendor/magento/framework/Interception/Interceptor.php:138]
#17 Magento\Store\Model\Store\Interceptor->Magento\Framework\Interception\{closure}() called at [vendor/magento/module-theme/Model/Indexer/Design/Config/Plugin/Store.php:39]
#18 Magento\Theme\Model\Indexer\Design\Config\Plugin\Store->aroundSave() called at [vendor/magento/framework/Interception/Interceptor.php:135]
#19 Magento\Store\Model\Store\Interceptor->Magento\Framework\Interception\{closure}() called at [vendor/magento/framework/Interception/Interceptor.php:153]
#20 Magento\Store\Model\Store\Interceptor->___callPlugins() called at [generated/code/Magento/Store/Model/Store/Interceptor.php:39]
#21 Magento\Store\Model\Store\Interceptor->save() called at [vendor/magento/module-backend/Controller/Adminhtml/System/Store/Save.php:72]
#22 Magento\Backend\Controller\Adminhtml\System\Store\Save->processStoreSave() called at [vendor/magento/module-backend/Controller/Adminhtml/System/Store/Save.php:130]
#23 Magento\Backend\Controller\Adminhtml\System\Store\Save->execute() called at [vendor/magento/framework/App/Action/Action.php:108]
#24 Magento\Framework\App\Action\Action->dispatch() called at [vendor/magento/module-backend/App/AbstractAction.php:231]
#25 Magento\Backend\App\AbstractAction->dispatch() called at [vendor/magento/framework/Interception/Interceptor.php:58]
#26 Magento\Backend\Controller\Adminhtml\System\Store\Save\Interceptor->___callParent() called at [vendor/magento/framework/Interception/Interceptor.php:138]
#27 Magento\Backend\Controller\Adminhtml\System\Store\Save\Interceptor->Magento\Framework\Interception\{closure}() called at [vendor/magento/module-backend/App/Action/Plugin/Authentication.php:143]
#28 Magento\Backend\App\Action\Plugin\Authentication->aroundDispatch() called at [vendor/magento/framework/Interception/Interceptor.php:135]
#29 Magento\Backend\Controller\Adminhtml\System\Store\Save\Interceptor->Magento\Framework\Interception\{closure}() called at [vendor/magento/framework/Interception/Interceptor.php:153]
#30 Magento\Backend\Controller\Adminhtml\System\Store\Save\Interceptor->___callPlugins() called at [generated/code/Magento/Backend/Controller/Adminhtml/System/Store/Save/Interceptor.php:26]
#31 Magento\Backend\Controller\Adminhtml\System\Store\Save\Interceptor->dispatch() called at [vendor/magento/framework/App/FrontController.php:159]
#32 Magento\Framework\App\FrontController->processRequest() called at [vendor/magento/framework/App/FrontController.php:99]
#33 Magento\Framework\App\FrontController->dispatch() called at [vendor/magento/framework/Interception/Interceptor.php:58]
#34 Magento\Framework\App\FrontController\Interceptor->___callParent() called at [vendor/magento/framework/Interception/Interceptor.php:138]
#35 Magento\Framework\App\FrontController\Interceptor->Magento\Framework\Interception\{closure}() called at [vendor/magento/framework/Interception/Interceptor.php:153]
#36 Magento\Framework\App\FrontController\Interceptor->___callPlugins() called at [generated/code/Magento/Framework/App/FrontController/Interceptor.php:26]
#37 Magento\Framework\App\FrontController\Interceptor->dispatch() called at [vendor/magento/framework/App/Http.php:116]
#38 Magento\Framework\App\Http->launch() called at [vendor/magento/framework/App/Bootstrap.php:261]
#39 Magento\Framework\App\Bootstrap->run() called at [pub/index.php:40]