Skip to content
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

Duplicate entry "reques path" although different store_id #26

Closed
Vincenkt opened this issue Dec 17, 2015 · 25 comments
Closed

Duplicate entry "reques path" although different store_id #26

Vincenkt opened this issue Dec 17, 2015 · 25 comments

Comments

@Vincenkt
Copy link

I don't now why I can't migrate url_rewrite table with same "request path" value but different store_id.
I think this is a bug of this tool.
Do you have any idea?
screenshot_2

@bh-ref
Copy link

bh-ref commented Dec 17, 2015

I am just now encountering a similar problem.

The problem on your Magento 1 database seems to be that it returns more than one row for the following SQL query:
SELECT <your magento 1 database>.core_url_rewrite WHERE request_path='plugins.html' AND store_id=9;

As you can see with the command SHOW CREATE TABLE <your magento 1 database>.core_url_rewrite;, the combination of the columns request_path and store_idhave to be unique.

Maybe you can delete the duplicate entry? I do not know if it is wise, though.

@bh-ref
Copy link

bh-ref commented Dec 17, 2015

If you want to know how many duplicates you have, run this:

SELECT request_path, store_id, COUNT(*) as count
FROM <your magento 1 database>.core_url_rewrite
GROUP BY request_path, store_id
HAVING COUNT(*) > 1;

@Vincenkt
Copy link
Author

Hi
I have solved this issue.
However, I'm facing a problem in Order grid step.
screenshot_3

@bh-ref
Copy link

bh-ref commented Dec 17, 2015

I don't know what the problem could be, unfortunately.

May I ask how you solved your first problem?

@Vincenkt
Copy link
Author

I have removed duplicate records and the issue has been solved.

@bh-ref
Copy link

bh-ref commented Dec 17, 2015

Alright, then I think I will do the same, at least for the test migration. Thank you.

@Vincenkt
Copy link
Author

Do you have any idea with my second issue?

@bh-ref
Copy link

bh-ref commented Dec 17, 2015

#16 mentions a similar problem, I think. Maybe it helps?

If not, you may want to begin to debug, probably the perform() method inside vendor/magento/data-migration-tool/src/Migration/Step/OrderGrids/Volume.php

@csdougliss
Copy link

@bh-ref I have the same issue.

However, your query given above returns nothing on m1 DB (changed to enterprise_url_rewrite)

The data migration tool will fail on upright-vacuum-cleaners/swift-upright which exists for store 22 and store 4 etc. However they are unique as it appends the store id??

[2016-01-05 15:18:38][INFO][mode: data][stage: data migration][step: Url Rewrite Step]: Duplicate resolved. Request path was: cylinder-vacuum-cleaners/swift-cylinder Target path was: catalog/category/view/id/63 Store ID: 4 New request path: cylinder-vacuum-cleaners/swift-cylinder
[2016-01-05 15:18:38][INFO][mode: data][stage: data migration][step: Url Rewrite Step]: Duplicate resolved. Request path was: cylinder-vacuum-cleaners/swift-cylinder Target path was: catalog/category/view/id/63 Store ID: 22 New request path: cylinder-vacuum-cleaners/swift-cylinder
[2016-01-05 15:18:38][INFO][mode: data][stage: data migration][step: Url Rewrite Step]: Duplicate resolved. Request path was: cylinder-vacuum-cleaners/white-cylinder Target path was: catalog/category/view/id/159 Store ID: 22 New request path: cylinder-vacuum-cleaners/white-cylinder
[2016-01-05 15:18:38][INFO][mode: data][stage: data migration][step: Url Rewrite Step]: Duplicate resolved. Request path was: cylinder-vacuum-cleaners/white-cylinder Target path was: catalog/category/view/id/159 Store ID: 4 New request path: cylinder-vacuum-cleaners/white-cylinder

@bh-ref
Copy link

bh-ref commented Jan 5, 2016

@craigcarnell I never encountered the case where a duplicate was automatically resolved like it seems to be the case in your log. However, I had another problem with URL Rewrite step. It turned out, that the affected rewrite had like some fields missing (NULL) whereas other rewrite did not have NULLs in the same fields (columns).

Maybe you can look up your affected rewrites in your DB and check with other rewrites which where successful to detect a difference/error?

@hws47a
Copy link

hws47a commented Feb 12, 2016

After upgrade migration tool to 2.0.2 I still have related issue:

[PDOException]
SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry 'female/edits-1' for key 'URL_REWRITE_REQUEST_PATH_STORE_ID'

for data in source db

@csdougliss
Copy link

I am trying migration tool 2.0.2 and I have this issue:

[PDOException]                                                                                                                                                
  SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry 'upright-vacuum-cleaners/swift-upright-22' for key 'URL_REWRITE_REQUEST_PATH_STORE_ID'

In my magento 1 db in enterprise_url_rewrite:

SELECT * FROM enterprise_url_rewrite WHERE request_path LIKE '%upright-vacuum-cleaners/swift-upright%' AND store_id=22;

screen shot 2016-02-12 at 14 53 47

@csdougliss
Copy link

Also:

[PDOException]                                                                                                                                                    
  SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry 'upright-vacuum-cleaners/turboforce-upright-4' for key 'URL_REWRITE_REQUEST_PATH_STORE_ID'

When there is only 2 in different stores:

29552106    upright-vacuum-cleaners/turboforce-upright  catalog/category/view/id/55 1   facbb8dc01a1cd1f5278eff3399cdc82    upright-vacuum-cleaners/turboforce-upright  1   51  22  2
29552201    upright-vacuum-cleaners/turboforce-upright  catalog/category/view/id/55 1   d6c5bada7a19d8a2c4216f53821bc987    upright-vacuum-cleaners/turboforce-upright  1   51  4   2

@cchamplin
Copy link

It looks like in 32cba04 the duplicate resolution what changed to only modify paths with a "." in them. Not sure why this change was added, but it seems to completely break duplicate resolution for many paths.

@cchamplin
Copy link

Additionally duplicates are queried and pulled by priority, but when the resolution occurs the record that is inserted into the database that does NOT have its request_path modified doesn't get the target_path or redirect_type for the highest priority duplicate.

@csdougliss
Copy link

Any updates on this Magento???

@ilol
Copy link

ilol commented Apr 28, 2016

@yaronish @victor-v-rad can you help?

@victor-v-rad
Copy link
Collaborator

I suggest #81 is the same. I have created internal issue to process this case

@csdougliss
Copy link

@ilol Any updates on this issue? This is the last issue preventing me from handing over a decent M1 database -> M2

@digitalredefned
Copy link

I'm also experiencing this issue. 1.9.0.1 to 2.0.7 migration. Only 1 instance of the combination that is throwing the error:
SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry 'adobe-1' for key 'URL_REWRITE_REQUEST_PATH_STORE_ID'

@csdougliss
Copy link

@ilol I still get this issue with 2.1

@ilol
Copy link

ilol commented Jul 8, 2016

will fix this in the next sprint (MAGETWO-52505)

@ygrigoriev
Copy link
Contributor

ygrigoriev commented Jul 11, 2016

@craigcarnell, we currently work on this issue. Could you please provide us with your core_url_rewrite/enterprise_url_rewrite table?

@csdougliss
Copy link

@ygrigoriev do you have an e-mail address or some how to send you this data?

@victor-v-rad
Copy link
Collaborator

victor-v-rad commented Oct 3, 2016

@craigcarnell
Here https://github.com/victor-v-rad you can find my email.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

9 participants