Magento 2: "Base table or view not found: 1932 Table 'magento.customer_grid_flat' doesn't exist" (Error) Print

  • M2
  • 1

Issue:

Unable to view customers in the backend of Magento:

There was an error processing your request

Exception printing is disable by default for security reasons
Error log record number: f1833c83c2372fb161baf79823f869fc4af6c10890df41022b346475e0278258

The following error is seen in var/report:

{"0":"SQLSTATE[42S02]: Base table or view not found: 1932 Table 'magento.customer_grid_flat' doesn't exist in engine, query was: DESCRIBE `customer_grid_flat`"

This is likely an indexing issue. Magento initially stores information in the customer_entity table, and not in customer_grid_flat. In order for the system to store the account data in customer_grid_flat you will need to execute the reindex command.

Possible Solution

Try the following to reindex:

php bin/magento i:rei customer_grid

If this doesn't work, try resetting the customer_grid index first:

php bin/magento i:reset customer_grid && php bin/magento i:rei customer_grid

If you get, an issue such as the following, then you could have a database related issue:

$ php bin/magento i:reset customer_grid && php bin/magento i:rei customer_grid
Customer Grid indexer has been invalidated.
Customer Grid index process unknown error:
SQLSTATE[HY000]: General error: 1813 Tablespace for table '`magento`.`customer_grid_flat`' exists. Please DISCARD the tablespace before IMPORT, query was: CREATE TABLE IF NOT EXISTS `customer_grid_flat` (

This is a trickier issue to resolve, as it will require root / sudo access or assistance from your hosting support. There are a number of ways to resolve this.

Possible Solution

Navigate to your mysql directory on the server and determine if there is an orphaned .ibd file. For example:

# ls -als /var/lib/mysql/magento | grep customer_grid_flat
-rw-rw---- 1 mysql mysql   229376 Oct  3 17:05 customer_grid_flat.ibd

In this case, there is a customer_grid_flat.ibd file but no associated customer_grid_flat.frm file. There are a number of ways to deal with this; we could remove that file, restart mysql/mariadb and then perform a reindex:

# mv /var/lib/mysql/magento/customer_grid_flat.ibd /var/lib/mysql/magento/customer_grid_flat.ibd.bak
# service mariadb restart 

Perform a reindex as magento user

$ php bin/magento i:reset customer_grid && php bin/magento i:rei customer_grid
Customer Grid indexer has been invalidated.
Customer Grid index has been rebuilt successfully in 00:00:00

 

If you are a Create Hosting customer utilising our MageVPS Plan, feel free to submit a support ticket and we can investigate and take care of this issue for you.


Was this answer helpful?

« Back