2

With my M2 instance indexers in "Update on Schedule" mode... var/log/cron.log receives this warning near constantly:

Could not acquire lock for cron job: indexer_update_all_views [] []

The cron process in the process list terminates... plus I have a constant "X in the backlog" message for a few indexes.

I cannot figure out what this problem is about... I've tried truncating all *_cl tables and rebuilding the index... but still the site eventually goes back to items permanently stuck the backlog, a cron job not terminating, and this log message always appearing.

The only solution I have right now to restore the site's performance is to leave the indexer in Update on Save mode.

Thoughts?

1
  • Any solution for this?
    – chdzma
    Jun 17, 2020 at 15:48

3 Answers 3

0

Same thing here on 2.3.5 . Any solution would be nice.

My catalogsearch_fulltext is constantly running it seems (every run takes about 6 minutes). Maybe related? Using Elasticsearch. Maybe it is just a warning, because the search process is still running?

0

Before doing this, disable crons and enter maintenance mode.

I ended up truncating all _cl tables. Then I ran UPDATE mview_state SET version_id = '0'; in order to reset all statusses and versions to their starting position. In my case they did not increment anymore and index_all_invalid gave the lock error.

Then truncate cron_schedule

After this, reset/reindex from cli, clear cache, disable maintenance and re-enable crons.

In my case: after migration I had a lot of attributes that had their values saved per storeview (not using default setting anymore). I think that caused a lot of troubles.

Anyway before I did the above, I cleaned out a lot of product and category rubble (attribute_id where store_id <> 0 in entity varchar, text, int, decimal, mediagallery, datetime, etc.

Hope it works for you or points you in the right direction.

0

I fixed it in Magento 2.3 changing the cron schedule as you can see below.

Then I ran this command in the database.

TRUNCATE TABLE `cataloginventory_stock_cl`;
TRUNCATE TABLE `catalogrule_product_cl`;
TRUNCATE TABLE `catalogrule_rule_cl`;
TRUNCATE TABLE `catalogsearch_fulltext_cl`;
TRUNCATE TABLE `catalog_category_product_cl`;
TRUNCATE TABLE `catalog_product_attribute_cl`;
TRUNCATE TABLE `catalog_product_category_cl`;
TRUNCATE TABLE `catalog_product_price_cl`;
TRUNCATE TABLE `customer_dummy_cl`;
TRUNCATE TABLE `design_config_dummy_cl`;
TRUNCATE TABLE `salesrule_rule_cl`;
TRUNCATE TABLE `targetrule_product_rule_cl`;
TRUNCATE TABLE `targetrule_rule_product_cl`;
TRUNCATE TABLE `inventory_cl`;

/* reset view_state */
UPDATE `mview_state` SET `version_id` = '0';

/* reset cron jobs schedule */
TRUNCATE TABLE `cron_schedule`;

And in the root folder I ran it:

wget https://files.magerun.net/n98-magerun2.phar && chmod +x ./n98-magerun2.phar && alias n98="PHP -d memory_limit=-1 ./n98-magerun2.phar"
n98 index:reset;
n98 index:reindex;
n98 cache:flush;

If you wanna understand better this solution, you can check these references:

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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