cancel
Showing results for 
Search instead for 
Did you mean: 

URL key for specified store already exists.

URL key for specified store already exists.

Hi All,

I am using Magento version 2.1.3
We are getting errors while saving the category or product form the admin as:
Error: URL key for specified store already exists.
And when i searched for solution maximum suggestions are to "Truncate the url_rewrite table".
As per the suggestion i have truncated the "url_rewrite" table and tried to save the category or product from the admin. Now it shows the error as:
Error: Something went wrong while saving the category.

Please can any one suggest a best solution for this..

Thanks,
Shiva.



Thanks,
Shiva.

7 REPLIES 7

Re: URL key for specified store already exists.

Hi @soho_rize,

 

Can you try running the indexer from the CLI (right after you truncate the table and before trying to update values)?

 

 

Re: URL key for specified store already exists.

Hi Damian,

Thanks for your reply..

Yes, we have tried reindexer from command line after truncating the table 'url_rewrite'.
Then we tried to save the category we are getting Errors as "Something went wrong while saving the category." instead of "URL key for specified store already exists."

And can you tell me why 'url_rewrite' table is still empty after reindexing. If it will regenerates only when we saved the category, but while saving we are getting the above error.

Please help me..


Re: URL key for specified store already exists.

@soho_rize,

 

Did you delete/truncate the catalog_url_rewrite_product_category table too?

I saw that we have a FK restriction if you try to delete this information inside the database.

Re: URL key for specified store already exists.

Hi Damian,

We have done as you suggested and we are getting the categories saved, but now a new error arises.

While Saving the products i am getting "No data to save" error and not saving anything..

Did you experience this as well..

Please suggest..

Thanks,
Shiva.

Re: URL key for specified store already exists.

hello,
Does this issue have anything to do with the MySQL version? if mysql 5.6.x will happen ?

Re: URL key for specified store already exists.

I was looking for solution for this problem and i allready found. I created short movie with doc to fix this problem. https://www.youtube.com/watch?v=xerkbeiH2jU Step by step instruction

Re: URL key for specified store already exists.

Hi @a100TZMO,


I think changing core files isn't the right solution. You should create a module and override the core behavior.

Maybe you can create the module and publish on GitHub or even better, is this is a bug you can create an issue https://github.com/magento/magento2/issues and explain the problem and the possible solution.