URL rewrites problem

Hello,
 
I tried to change the Product URL Suffix and Category URL Suffix from “.html” to empty. When I try to do that I got the following message:
Something went wrong while saving this configuration: SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry ‘eiken-haardhout-0-5-kuub-2’ for key ‘URL_REWRITE_REQUEST_PATH_STORE_ID’, query was: UPDATE `url_rewrite` SET `request_path` = ? WHERE (`url_rewrite_id` = 1294)
when I look at rewrites, there I see there is number 1062 and 1294.  There is a complete range of rewrites missing?
What to do?
 
regards,
 
Albert

  1. Profile photo of Albert van den BroekeAlbert 80.00 $tone December 22, 2016
    it must be "I DON'T see number 1062 and 1294.

5 answers

Profile photo of Mall Staff 184060.00 $tone December 23, 2016
Public

Hi Albert,

it must be “I DON’T see number 1062 and 1294.

Number 1062 is error code only.

Duplicate entry ‘eiken-haardhout-0-5-kuub-2’ for key ‘URL_REWRITE_REQUEST_PATH_STORE_ID’, query was: UPDATE `url_rewrite` SET `request_path` = ? WHERE (`url_rewrite_id` = 1294)

That issue because the data migrated from your Magento1 database has some duplicate of url_path. I raise conflict with new working rules of Magento2.
Let’s try with step as below:
Open your Terminal, go to your Magento2 folder and run command:
php -f bin/ubdatamigration fixduplicateurl
And clean your Magento 2 cache: php -f bin/magento cache:flush
And tell me know how it goes.
Regards,
Mall.
 
 

#1
Profile photo of Albert van den Broeke 80.00 $tone December 23, 2016
Public

Hi Mall,
 
Now I get this error:
Something went wrong while saving this configuration: SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry ‘brandpunten-2’ for key ‘URL_REWRITE_REQUEST_PATH_STORE_ID’, query was: UPDATE `url_rewrite` SET `request_path` = ? WHERE (`url_rewrite_id` = 914)
 
regards,
Albert

#2
Profile photo of Mall Staff 184060.00 $tone December 23, 2016
Public

Hi Albert,
So, please try with steps as bellow:
Step 1: Backup current your Magento2 database.
Step 2: Delete all records from table url_rewrite by SQL comamd: Delete From url_rewrite
Step 3: Come back to back-end of your M2 and then re-save all your Categories.
And clean the Magento2 cache.
And tell me know how it goes.
Regards,
Mall.

#3

This question is now closed

Written By

Comments