Running php bin/magento setup:upgrade command gives error

Running php bin/magento setup:upgrade command gives error

September 1, 2026 · Illustrated author avatarBy Stefan Bogdanescu
Running php bin/magento setup:upgrade command gives error

Resolving Magento 2 Setup:Upgrade Command Errors

Hello! I recently came across an issue while working on a Simple Module for Magento 2.4.1 version. After creating the module, when I tried to run the php bin/magento setup:upgrade command, it threw an error about a missing table:

SQLSTATE[42S02]: Base table or view not found: 1932 Table 'furniturestore.catalog_product_index_eav' doesn't exist in engine

Moreover, attempting the php bin/magento indexer:reindex command also resulted in an error:

Product EAV index exception: SQLSTATE[HY000]: General error: 1025 Error on rename of '.\furniturestore\catalog_product_index_eav' to '.\furniturestore\catalog_product_index_eav_outdated'(errno: 155 "The table does not exist in the storage engine"), query was
RENAME TABLE catalog_product_index_eav TO catalog_product_index_eav_outdated, catalog_product_index_eav_replica TO catalog_product_index_eav, catalog_product_index_eav_outdated TO catalog_product_index_eav_replica

Understanding the Issue

The errors suggest that the Magento database is missing some vital tables required for indexing and product management. This usually happens due to incorrect module installation or upgrade processes.

Resolving the Problem

Step 1: Check Database Tables

First, let’s verify if the mentioned tables exist in the Magento database:

SHOW TABLES LIKE 'catalog_product_index_eav';

If it returns an empty set, then the table is indeed missing and needs to be created.

Step 2: Recreate the Missing Indexes

You can recreate the missing indexes using the following SQL commands. Run these queries in your Magento database:

DROP INDEX idx_catalog_product_index_eav_entity_id;
CREATE TABLE catalog_product_index_eav (
    entity_id INT(10) UNSIGNED NOT NULL,
    attribute_id SMALLINT(5) UNSIGNED NOT NULL,
    store_id TINYINT(3) UNSIGNED NOT NULL,
    value INT(11) DEFAULT 0,
    tier_price int(12) not null default 0,
    `value_float` FLOAT(14,6) DEFAULT NULL
);
ALTER TABLE catalog_product_index_eav ADD INDEX idx_catalog_product_index_eav_entity_id (entity_id);

Step 3: Reindex and Upgrade Again

After creating the table, run the following commands:

php bin/magento indexer:reindex
php bin/magento setup:upgrade

Conclusion

If you’re still encountering issues after following these steps, it might be due to other factors such as incorrect Magento configuration or file permissions. Ensure that your Magento installation is clean and all files have the appropriate read/write permissions.

Remember, always take a full backup of your database before making any direct changes to the tables. If you’re unsure about performing these operations, consider reaching out to professional Magento support services for assistance.

For more detailed guides on Magento module development and troubleshooting, I highly recommend checking out Laravel Company’s Magento Resources. They provide comprehensive tutorials and best practices for working with the Magento platform efficiently.

Magento 2 Catalog Indexing Database

Our network