0

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\AlreadyExistsException(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 to this

Magento 2 Fix duplicate Url Keys

and 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???

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.