6

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
    Aug 12, 2016 at 3:37
  • Try reindexing only one of the problematic ones and see if errors display. Aug 14, 2016 at 14:17
  • @RyanH. I'm getting an err msg 'Command "indexer:reset" is not defined'
    – Nikkawat
    Aug 15, 2016 at 17:10
  • @SteveJohnson They're still stuck in processing, let's see what Magento forums say
    – Nikkawat
    Aug 15, 2016 at 17:11

4 Answers 4

17

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.

2
  • This command doesn't exist in 2.0.4
    – jtate
    Feb 20, 2017 at 14:26
  • but answer is absolutly right its work for me thanks in 2.1.6 Jun 5, 2017 at 4:57
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. 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
    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. 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
    Jan 25, 2017 at 16:28
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';
0

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).

1
  • solution of this problem?
    – Hiren
    Mar 23 at 8:45

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.