1

I am using magento 2.4 while MSI is enabled. when check out , an exception occurred,

main.CRITICAL: SQLSTATE[42S02]: Base table or view not found: 1146 Table 'magento.sequence_order_1' doesn't exist,

I check the magento db using phpMyAdmin and did not find the table sequence_order_1,

Who can help me to solve this problem Thank you

Itm Song

4 Answers 4

0

Please try reindex once since store id with order sequence may be wrong.
Still issue persist, do the following steps,
found the table name as sales_sequence_meta in your database and remove the record of
enter image description here

entity_type as order and store_id as 1 and sequence_table as sequence_order_1

After that , do the reindex once and check it out.

Hope it works for you or points you in the right direction.

0

After further investigation, i found the original version of my web in another server's db contains the table sequence_order_0, sequence_order_1 and all other related table.

So the root cause of this issue was due to, when i backuped the db and restored it in my new server, these 6 more tables was lost. since no table, so exception occurred

Thank you for everyone's comments and effort.

0

You can use n98-magerun2 (https://github.com/netz98/n98-magerun2)

n98-magerun2.phar sales:sequence:add [store]

example

n98-magerun2.phar sales:sequence:remove 1
n98-magerun2.phar sales:sequence:add 1

see https://github.com/netz98/n98-magerun2/pull/1177

0

In my case, it was the sequence tables missing for the store.

var/log/exception.log

Next Zend_Db_Statement_Exception: SQLSTATE[42S02]: Base table or view not found: 1146 Table 'xxx.sequence_order_3' doesn't exist, query was: INSERT INTO sequence_order_3 () VALUES () in /app/xxx/vendor/magento/framework/DB/Statement/Pdo/Mysql.php:109

n98-magerun2.phar sales:sequence:add [store_id] didn't work for me.

So, I had to manually create the missing sequence tables.

CREATE TABLE `sequence_order_3` (`sequence_value` int(10) unsigned NOT NULL AUTO_INCREMENT, PRIMARY KEY (`sequence_value`));
CREATE TABLE `sequence_invoice_3` (`sequence_value` int(10) unsigned NOT NULL AUTO_INCREMENT, PRIMARY KEY (`sequence_value`));
CREATE TABLE `sequence_creditmemo_3` (`sequence_value` int(10) unsigned NOT NULL AUTO_INCREMENT, PRIMARY KEY (`sequence_value`));
CREATE TABLE `sequence_shipment_3` (`sequence_value` int(10) unsigned NOT NULL AUTO_INCREMENT, PRIMARY KEY (`sequence_value`));
CREATE TABLE `sequence_rma_item_3` (`sequence_value` int(10) unsigned NOT NULL AUTO_INCREMENT, PRIMARY KEY (`sequence_value`));

And, that fixed the issue for me.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.