- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello,
I just recently upgrade from Magento 2.3 to Magento 2.3.3 and whenever I am running "
php bin/magento setup:upgrade" SSH command it just stick on Unique constraint violation found. Any idea how do I fix this ?
Error after running the "php bin/magento setup:db-data:upgrade" SSH command:
In AbstractDb.php line 427: Unique constraint violation found In Mysql.php line 593: SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry ' order-0' for key 'SALES_SEQUENCE_META_ENTITY_TYPE_STORE_ID', query was: INSERT INTO `mg_sales_sequence_meta` (`entity_type`, `store_id`, `sequ ence_table`) VALUES (?, ?, ?) In Mysql.php line 110: SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry ' order-0' for key 'SALES_SEQUENCE_META_ENTITY_TYPE_STORE_ID', query was: INSERT INTO `mg_sales_sequence_meta` (`entity_type`, `store_id`, `sequ ence_table`) VALUES (?, ?, ?) In Mysql.php line 91: SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry ' order-0' for key 'SALES_SEQUENCE_META_ENTITY_TYPE_STORE_ID' setup:db-data:upgrade [--magento-init-params MAGENTO-INIT-PARAMS]
Solved! Go to Solution.
Accepted Solutions
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I had something very similar happen to me when going from 2.2.6 to 2.3.0. I had to go into phpMyAdmin and run a query to find duplicates and manually delete entries. For me though it had to do with the attribute tables.
I've also had issues where the store id was missing for some reason and had to populate it into the tables.
Oh the headache many of us could be saved from if upgrades abstracted database integrity and file permissions for us.
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I had something very similar happen to me when going from 2.2.6 to 2.3.0. I had to go into phpMyAdmin and run a query to find duplicates and manually delete entries. For me though it had to do with the attribute tables.
I've also had issues where the store id was missing for some reason and had to populate it into the tables.
Oh the headache many of us could be saved from if upgrades abstracted database integrity and file permissions for us.
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Re: Unique constraint violation found after upgrading to Magento 2.3.3
Hello @AndyAJ
I am having same issue while migrate from magento 1.X to magento 2.3.3
Could you please let me know in detail what exact need to be done ?
Thank you
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Re: Unique constraint violation found after upgrading to Magento 2.3.3
Same issue on my installation, how we can run queries to find the problem on the database?
Can you help us provide a code to run and detail instructions to find the duplicates?
or at least a technique to locate them?
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Re: Unique constraint violation found after upgrading to Magento 2.3.3
I have got same issue after migration. I follow bellow step to solve order , shipment and invoice issue. Might be its not proper solutions but its work for me.
I have update all order,invoice,shipment invoice tables.
sequence_shipment_0,sequence_shipment_1,sequence_invoice_0,sequence_invoice_1 tables.
alter sequence_value column with auto increment primary key . and insert dummy 1 to 5 values. After that i have clean cache and every order , shipment and invoice generated ..
sequence_shipment_0
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Re: Unique constraint violation found after upgrading to Magento 2.3.3
How would one do that?
I'm in phpMyAdmin in sequence_shipment_ but I am not sure how to do that? Would you give step-by-step on this?
Thank you.