Magento – Magento 2 Down: replica Tales not found when reindexing!

databaseerrorindexingmagento2reindex

My server went down because the disk was full, after fixing it, I noticed that the magento 2 website never came back:
(Magento 2.2.4, PHP 7.0.30)

When re-indexing, i get the following error:

Table "cataloginventory_stock_status_replica" does not exist Table
Table "catalog_product_index_eav_replica" does not exist Table
Table "cataloginventory_stock_status_replica" does not exist

enter image description here

Exception Logs only shows this:

[2018-10-07 10:00:58] main.CRITICAL: SQLSTATE[HY000]: General error: 3
Error writing file
'./databse_mag2/catalogrule_product__temp30fd3506.frm'
(Errcode: 28 – No space left on device), query was: create table
catalogrule_product__temp30fd3506 like catalogrule_product
{"exception":"[object] (Zend_Db_Statement_Exception(code: 0):
SQLSTATE[HY000]: General error: 3 Error writing file
'./databse_mag2/catalogrule_product__temp30fd3506.frm

System logs shows this:

[2018-10-08 15:01:05] main.WARNING: Memory size allocated for the
temporary table is more than 20% of innodb_buffer_pool_size. Please
update innodb_buffer_pool_size or decrease batch size value (which
decreases memory usages for the temporary table). Current batch size:
100000; Allocated memory size: 200000000 bytes; InnoDB buffer pool
size: 134217728 bytes. [] []

The website is loading in vain, I've no idea where or how to fix it, anyone has an idea how to fix this, please?

Best Answer

1.) Do a fresh install of the same magento version you're having problems with
2.) export the structure of the tables "catalog_product_index_price_replica" and "catalog_product_index_eav_replica"
3.) import those structures into your magento db where you're facing the issue
4.) run the commands
php bin/magento indexer:reset
php bin/magento indexer:reindex
these steps solved the issue for me in magento 2.2.7