-
Notifications
You must be signed in to change notification settings - Fork 9.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Category - URL key for specified store already exists. #6531
Comments
Did you try to place a breakpoint in place where this exception is thrown? You can also track an exact DB query which causes a constraint violation. There could also exist product or CMS page with the same request path, but as you checked |
@beckindesigns |
@beckindesigns
Have you tried to flush the cache of Magento 2? It could help. |
@orlangur Can you elaborate on how I can do this? @victor-v-rad Cache is disabled but I refreshed all of them again, manually deleted contents in P.S. I checked the logs and logged the url that it was trying to save and noticed that although editing one category it re-saves all the data for each category and its children categories and every product assigned to those categories. It is too much data to try and determine the exact problem. Not sure why it does this instead of saving just one category like you are doing. This makes finding the issue much more difficult. Any other suggestions in trying to determine the exact cause? |
@beckindesigns |
Fell free to reopen the issue when you have additional information. |
@victor-v-rad I've got a similar issue with categories where it says 'Url key already exists'. |
I managed to fix this by removing duplicates products. once they are deleted , run re-index and clear cache. SELECT COUNT(DISTINCT entity_id) AS amount, |
Quite similar issue #8304 |
0 I was also facing same issue while adding/editing categories. Firstly I found there was wrong attribute id in "catalog_category_entity_varchar" table for url_key and url_path. Then I checked the exect attribute_id of both attributes ('url_key' and 'url_path'). e.g in "catalog_category_entity_varchar" table it was showing '117' and '118' but exact id was '119' and '120'. Then I found there was some rows in "catalog_category_entity_varchar" table with these (correct id '119','120'). I followed below steps to resolve issue.
Make sure take the backup of the database before doing above steps. |
[arcticfoxes] B2B-1637: Fix GET_LOCK error on read-only slave connection
I have seen this same issue but no real solution to the problem. I have an existing category that when I try to edit the category it displays "URL key for specified store already exists". However, this url key is only being used in the store once. There are no children categories with the same name either. I also checked
catalog_category_entity_varchar
andurl_rewrite
just to make sure this url key only exists once and it only exists for the same category that I am trying to edit.I also tried changing the url key in
catalog_category_entity_varchar
to something wild that would never be used in our store and removed theurl_key
all together inurl_rewrite
and the same thing happened while trying to save. Seems more like a core coding bug than a database problem based on that experiment.Preconditions
Has anyone figured out why this is happening?
The text was updated successfully, but these errors were encountered: