22

One of the indexers that are configured to be updated on schedule is locked in the state "suspended" and does not get updated anymore.

Output of bin/magento indexer:status

+----------------------------+------------------+-----------+-------------------------------+---------------------+
| Title                      | Status           | Update On | Schedule Status               | Schedule Updated    |
+----------------------------+------------------+-----------+-------------------------------+---------------------+
| ...                        |                  |           |                               |                     |
| IntegerNet_Solr            | Reindex required | Schedule  | suspended (101028 in backlog) | 2018-09-24 15:28:44 |
| ...                        |                  |           |                               |                     |
+----------------------------+------------------+-----------+-------------------------------+---------------------+

Others show idle (0 in backlog) and the current time in the "Schedule Updated" column, so the indexer schedule is generally working.

How can I solve this?

4 Answers 4

19

I found out, that the status is set in \Magento\Framework\Mview\View::suspend() and removed in \Magento\Framework\Mview\View::resume().

These methods are only called in \Magento\Indexer\Model\Indexer::reindexAll() to suspend the scheduled indexing before a forced full reindexing and to resume it afterwards or if an exception occurs.

But if the process is terminated without exception, e.g. killed, segfaulted or even runs into a non-recoverable fatal error, the status stays "suspended" and there are no means to resume it.

Solution: make sure, there really is no full reindex running, then update the status via SQL.

You'll find all the statuses with:

select * from mview_state;

and update it like this:

update mview_state set status='idle' where view_id='integernet_solr';
1
  • 1
    Did you manage to find a full proof solution? Commented Oct 1, 2018 at 14:56
5

You don't need to edit database to do so, you can do the same by resetting and indexers and then reindexing them again by using following commands;

php bin/magento indexer:reset

php bin/magento indexer:reindex
7
  • 3
    That was the first thing I tried, but it only resets the status (i.e. "in progress"), not the mview state Commented Sep 24, 2018 at 18:39
  • 1
    I'm not sure if triggering a full reindex again would have worked, but even if so, I'd like to avoid it Commented Sep 24, 2018 at 18:40
  • I had the same problem in my case where the process was suspended , above worked for me then. It was magento 2.1.x though. Commented Sep 24, 2018 at 18:47
  • Thanks, I'm going to experiment a bit to find out more :) Commented Sep 24, 2018 at 18:49
  • 2
    i found that the reset, php bin/magento indexer:reset, did not change the suspended flag, but did make it so i could reindex properly and that in turn changed the flag back to idle. i suggest using the: php bin/magento indexer:reset suggested above.
    – jrossi
    Commented Feb 22, 2019 at 15:53
1

In my situation (Magento 2.4.0), calling to indexer (either bin/magento indexer:reset or bin/magento indexer:reindex) doesn't get the backlog number of Product Categories and Catalog Product Rule down.

After paying some investigation, I found that my cronjob wasn't run successfully. Calling it would significantly reduce these numbers. You'll want to give it a try:

  • bin/magento cron:run
0

If anyone encounders a "stuck" indexer (probably after a failed import or something like that), a _cl tables clear may be wise.

This article explains the process by clearing the _cl table:

https://www.vannoortproductions.nl/magento-2-indexer-stuck-at-processing/

after that you may:

php bin/magento indexer:reset
php bin/magento indexer:reindex
php bin/magento cron:run

Monitor the above processes for errors an get a DB backup before.

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.