0

I have the same problem as this answer: https://magento.stackexchange.com/a/255003/106058

But I can't comment on his answer directly so here I am.

I'm using Magento 2.3.3. I ran bin/magento setup:upgrade and got Unique constraint violation found after the Running data recurring... message. So, I ran bin/magento setup:db-data:upgrade and got this error message below:

Module 'Magento_Widget': Module 'Magento_SalesSequence': Running data recurring... 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 'MG2_SALES_SEQUENCE_META_ENTITY_TYPE_STORE_ID', query was: INSE RT INTO `mg2_sales_sequence_meta` (`entity_type`, `store_id`, `sequence_table`) VALUES (?, ?, ?) In Mysql.php line 110: SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry 'order-0' for key 'MG2_SALES_SEQUENCE_META_ENTITY_TYPE_STORE_ID', query was: INSE RT INTO `mg2_sales_sequence_meta` (`entity_type`, `store_id`, `sequence_table`) VALUES (?, ?, ?) In Mysql.php line 91: SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry 'order-0' for key 'MG2_SALES_SEQUENCE_META_ENTITY_TYPE_STORE_ID' setup:db-data:upgrade [--magento-init-params MAGENTO-INIT-PARAMS] 

I tried deleting the existing records on the table (the error occurs only with the records where the store_id column is 0) but it still showed the same error message. I even tried dropping the sales_sequence_meta and sales_sequence_profile tables of the Sales Sequence module and reran the upgrade command. It re-created the tables but still got the same error message.

Any idea on how to solve this? Thank you!

1 Answer 1

0

I solved it by truncating both the sales_sequence_meta and sales_sequence_profile tables and run the bin/magento setup:db-data:upgrade command.

I ran the command before but thought that it differs from the bin/magento setup:upgrade command which always failed when reaches the SalesSequence module. Then I found this answer on Stackoverflow which affirm that it's going to work so I followed along.

Also, the admin page can't be accessed since there was an error about missing class which the bin/magento setup:di:compile didn't help. Turned out it was a files permission issue not related to the upgrade command.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.