A frequent reindex error in Magento 2 is the following one: “One or more indexers are invalid. Make sure your Magento cron job is running”. When you see this system message you instantly want to fix this problem. Luckily for you, this problem is very easy to fix.
Sometimes indexing in the Magento 2 back-end gives trouble. This is frustrating, but there is a solution.
Image may be NSFW.
Clik here to view.
Solution
The easiest solution to this problem is to reindex the Magento 2 tables via the command line. We’ve also written an article on how to do this in Magento 1, and now we’ll describe to you how to do it in M2.
- Open your CLI (Command Line Interface)
- Navigate to the root of your Magento 2 installation
- To index all, use the following command:
php bin\magento indexer:reindex
- To index a specific table, use the following command:
php bin\magento indexer:reindex indexer_name
To find the name of an indexer you’re looking for, simply type the following in your CLI:
php bin\magento indexer:info
You can also check on the status of the indexer. This command shows you whether the indexer is already running, or ready to reindex.
php bin\magento indexer:status
You can also check the status of a specific indexer by putting the table name after the command above just like the command shown in step number 4. We hope this has helped you to solve the reindexing error in Magento 2. If you have any questions, feel free to drop a comment below.
The post Magento 2 Reindexing error: One or more indexes are Invalid appeared first on Coding Basics.