7

Magento ver. 2.0.7

Hello, I'm trying to reindex my store so that products I added from the backend will show up on the frontend.

As shown below, after running bin/magento indexer:reindex, every index has been rebuilt successfully but bin/magento indexer:status shows some of the indices still processing as confirmed in the Admin Panel > System > Index Management

What can I do to resolve this? My website no longer shows any products.

[user@server root]$ bin/magento indexer:reindex
Customer Grid index has been rebuilt successfully in 00:00:00
Category Products index has been rebuilt successfully in 00:00:00
Product Categories index has been rebuilt successfully in 00:00:00
Product Price index has been rebuilt successfully in 00:00:04
Product EAV index has been rebuilt successfully in 00:00:06
Stock index has been rebuilt successfully in 00:00:00
Catalog Rule Product index has been rebuilt successfully in 00:00:00
Catalog Product Rule index has been rebuilt successfully in 00:00:00
Catalog Search index has been rebuilt successfully in 00:00:00

[user@server root]$ bin/magento indexer:status
Customer Grid:                                     Processing
Category Products:                                 Processing
Product Categories:                                Processing
Product Price:                                     Ready
Product EAV:                                       Ready
Stock:                                             Ready
Catalog Rule Product:                              Ready
Catalog Product Rule:                              Ready
Catalog Search:                                    Processing

Index Management

4
  • 1
    You can run php bin/magento indexer:reset to reset the ones stuck on 'processing', then reindex them all (again). That probably won't solve your real problem though.
    – Ryan Hoerr
    Commented Aug 12, 2016 at 3:37
  • Try reindexing only one of the problematic ones and see if errors display. Commented Aug 14, 2016 at 14:17
  • @RyanH. I'm getting an err msg 'Command "indexer:reset" is not defined'
    – Nikkawat
    Commented Aug 15, 2016 at 17:10
  • @SteveJohnson They're still stuck in processing, let's see what Magento forums say
    – Nikkawat
    Commented Aug 15, 2016 at 17:11

4 Answers 4

18

You can fix this from the command line by reseting the index which will invalidate the state of the index and remove the processing flag from the index.

php bin/magento indexer:reset

Optionally you may also append the index name to the command to just just reset that index.

3
  • 1
    This command doesn't exist in 2.0.4
    – jtate
    Commented Feb 20, 2017 at 14:26
  • but answer is absolutly right its work for me thanks in 2.1.6 Commented Jun 5, 2017 at 4:57
  • @jtate then your only options is to upgrade magento
    – Black
    Commented Nov 8, 2022 at 13:56
5

unfortunately your only option is to change in the database the state of the processing indexes because till there are processing indexes no other index gets updated and neither the command line works.

update indexer_state set status = 'invalid' where indexer_id = 'catalogsearch_fulltext';

also keep in mind this bug https://github.com/magento/magento2/issues/5146 that might be the cause for your problem

4
  • This is not the only option, index state can be reset from the m2 cli which is more satisfactory than tinkering with tables. Commented Jan 25, 2017 at 10:41
  • no, it can't. try and you'll see. but i agree with you, would be best if it worked from cli
    – springerin
    Commented Jan 25, 2017 at 12:56
  • With indexer:reset (not indexer:reindex)? Works fine for me. I can cause the error situation that causes the reindex to fail and am able to recover to the state of invalidated. I can then re-run the reindex (which without the command would have just been skipped as it was marked as processing) in a situation it will not error and all is fine. Commented Jan 25, 2017 at 16:02
  • 1
    my bad, i didn't know about indexer:reset. i'll check that out, thanks in case it works :)
    – springerin
    Commented Jan 25, 2017 at 16:28
1

I've just had this issue and it turned out that it was because the "innodb_buffer_pool_size" mysql size was not big enought (we had too many comples sales_rules).

2
  • solution of this problem?
    – Hiren
    Commented Mar 23, 2022 at 8:45
  • @Hiren, it is obvious, just make innodb_buffer_pool_size bigger.
    – Black
    Commented Nov 8, 2022 at 13:58
0

In Magento 2 indexer states are stored in indexer_state table.

In case in the CLI reset does not work, change the state directly from the table.

If Product Price is stuck for long time, use following. And so on.

update indexer_state set status = 'invalid' where indexer_id = 'catalog_product_price';

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.