Skip to content

Cron not Reindexing Index #5836

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
ghost opened this issue Jul 27, 2016 · 147 comments
Closed

Cron not Reindexing Index #5836

ghost opened this issue Jul 27, 2016 · 147 comments
Labels
bug report Fixed in 2.2.x The issue has been fixed in 2.2 release line Issue: Clear Description Gate 2 Passed. Manual verification of the issue description passed Issue: Confirmed Gate 3 Passed. Manual verification of the issue completed. Issue is confirmed Issue: Format is valid Gate 1 Passed. Automatic verification of issue format passed

Comments

@ghost
Copy link

ghost commented Jul 27, 2016

The indexes are not being reindexed with the standard cron:run cron job. This is particularly noticeable when making a change to a category and it not being updated on the front end. I can add a static block or description to a category and save it in the backend and the updates will not appear on the frontend until the indexers have been manually reindexed. This could possibly be related to #2855.

Preconditions

  1. Magento 2.1 CE
  2. CentOS6
  3. PHP 5.6.24
  4. MySQL 5.6
  5. Shared hosting with Plesk control panel
  6. Using flat categories and products

Steps to reproduce

  1. Make a change to a categories description or add a static content block
  2. Save changes
  3. Go to category on frontend to see result

Expected result

  1. Category should be updated with new content

Actual result

  1. Category is not updated with new content

I have noticed that the debug.log has been filling up quite fast with lines like the following:

[2016-07-27 11:33:01] main.DEBUG: cache_invalidate:  {"method":"GET","url":"http:/","invalidateInfo":{"identifier":"DB_PDO_MYSQL_DDL_design_config_grid_flat_1"},"is_exception":false} []
[2016-07-27 11:33:01] main.DEBUG: cache_invalidate:  {"method":"GET","url":"http:/","invalidateInfo":{"identifier":"DB_PDO_MYSQL_DDL_design_config_grid_flat_2"},"is_exception":false} []
[2016-07-27 11:33:01] main.DEBUG: cache_invalidate:  {"method":"GET","url":"http:/","invalidateInfo":{"identifier":"DB_PDO_MYSQL_DDL_design_config_grid_flat_3"},"is_exception":false} []
[2016-07-27 11:33:01] main.DEBUG: cache_invalidate:  {"method":"GET","url":"http:/","invalidateInfo":{"identifier":"DB_PDO_MYSQL_DDL_design_config_grid_flat_4"},"is_exception":false} []
[2016-07-27 11:33:01] main.DEBUG: cache_invalidate:  {"method":"GET","url":"http:/","invalidateInfo":{"identifier":"DB_PDO_MYSQL_DDL_design_config_grid_flat_1"},"is_exception":false} []
[2016-07-27 11:33:01] main.DEBUG: cache_invalidate:  {"method":"GET","url":"http:/","invalidateInfo":{"identifier":"DB_PDO_MYSQL_DDL_design_config_grid_flat_2"},"is_exception":false} []
[2016-07-27 11:33:01] main.DEBUG: cache_invalidate:  {"method":"GET","url":"http:/","invalidateInfo":{"identifier":"DB_PDO_MYSQL_DDL_design_config_grid_flat_3"},"is_exception":false} []
[2016-07-27 11:33:01] main.DEBUG: cache_invalidate:  {"method":"GET","url":"http:/","invalidateInfo":{"identifier":"DB_PDO_MYSQL_DDL_design_config_grid_flat_4"},"is_exception":false} []
[2016-07-27 11:33:02] main.DEBUG: cache_invalidate:  {"method":"GET","url":"http:/","invalidateInfo":{"identifier":"DB_PDO_MYSQL_DDL_customer_grid_flat_1"},"is_exception":false} []
[2016-07-27 11:33:02] main.DEBUG: cache_invalidate:  {"method":"GET","url":"http:/","invalidateInfo":{"identifier":"DB_PDO_MYSQL_DDL_customer_grid_flat_2"},"is_exception":false} []
[2016-07-27 11:33:02] main.DEBUG: cache_invalidate:  {"method":"GET","url":"http:/","invalidateInfo":{"identifier":"DB_PDO_MYSQL_DDL_customer_grid_flat_3"},"is_exception":false} []
[2016-07-27 11:33:02] main.DEBUG: cache_invalidate:  {"method":"GET","url":"http:/","invalidateInfo":{"identifier":"DB_PDO_MYSQL_DDL_customer_grid_flat_4"},"is_exception":false} []
[2016-07-27 11:33:02] main.DEBUG: cache_invalidate:  {"method":"GET","url":"http:/","invalidateInfo":{"identifier":"DB_PDO_MYSQL_DDL_customer_grid_flat_1"},"is_exception":false} []
[2016-07-27 11:33:02] main.DEBUG: cache_invalidate:  {"method":"GET","url":"http:/","invalidateInfo":{"identifier":"DB_PDO_MYSQL_DDL_customer_grid_flat_2"},"is_exception":false} []
[2016-07-27 11:33:02] main.DEBUG: cache_invalidate:  {"method":"GET","url":"http:/","invalidateInfo":{"identifier":"DB_PDO_MYSQL_DDL_customer_grid_flat_3"},"is_exception":false} []
[2016-07-27 11:33:02] main.DEBUG: cache_invalidate:  {"method":"GET","url":"http:/","invalidateInfo":{"identifier":"DB_PDO_MYSQL_DDL_customer_grid_flat_4"},"is_exception":false} []
[2016-07-27 11:33:02] main.DEBUG: cache_invalidate:  {"method":"GET","url":"http:/","invalidateInfo":{"identifier":"DB_PDO_MYSQL_DDL_catalog_product_entity_tmp_indexer_1"},"is_exception":false} []
[2016-07-27 11:33:02] main.DEBUG: cache_invalidate:  {"method":"GET","url":"http:/","invalidateInfo":{"identifier":"DB_PDO_MYSQL_DDL_catalog_product_entity_tmp_indexer_2"},"is_exception":false} []
[2016-07-27 11:33:02] main.DEBUG: cache_invalidate:  {"method":"GET","url":"http:/","invalidateInfo":{"identifier":"DB_PDO_MYSQL_DDL_catalog_product_entity_tmp_indexer_3"},"is_exception":false} []
[2016-07-27 11:33:02] main.DEBUG: cache_invalidate:  {"method":"GET","url":"http:/","invalidateInfo":{"identifier":"DB_PDO_MYSQL_DDL_catalog_product_entity_tmp_indexer_4"},"is_exception":false} []
[2016-07-27 11:33:02] main.DEBUG: cache_invalidate:  {"method":"GET","url":"http:/","invalidateInfo":{"identifier":"DB_PDO_MYSQL_DDL_catalog_product_entity_decimal_tmp_indexer_1"},"is_exception":false} []
[2016-07-27 11:33:02] main.DEBUG: cache_invalidate:  {"method":"GET","url":"http:/","invalidateInfo":{"identifier":"DB_PDO_MYSQL_DDL_catalog_product_entity_decimal_tmp_indexer_2"},"is_exception":false} []
[2016-07-27 11:33:02] main.DEBUG: cache_invalidate:  {"method":"GET","url":"http:/","invalidateInfo":{"identifier":"DB_PDO_MYSQL_DDL_catalog_product_entity_decimal_tmp_indexer_3"},"is_exception":false} []
[2016-07-27 11:33:02] main.DEBUG: cache_invalidate:  {"method":"GET","url":"http:/","invalidateInfo":{"identifier":"DB_PDO_MYSQL_DDL_catalog_product_entity_decimal_tmp_indexer_4"},"is_exception":false} []
[2016-07-27 11:33:02] main.DEBUG: cache_invalidate:  {"method":"GET","url":"http:/","invalidateInfo":{"identifier":"DB_PDO_MYSQL_DDL_catalog_product_entity_text_tmp_indexer_1"},"is_exception":false} []
[2016-07-27 11:33:02] main.DEBUG: cache_invalidate:  {"method":"GET","url":"http:/","invalidateInfo":{"identifier":"DB_PDO_MYSQL_DDL_catalog_product_entity_text_tmp_indexer_2"},"is_exception":false} []
[2016-07-27 11:33:02] main.DEBUG: cache_invalidate:  {"method":"GET","url":"http:/","invalidateInfo":{"identifier":"DB_PDO_MYSQL_DDL_catalog_product_entity_text_tmp_indexer_3"},"is_exception":false} []
[2016-07-27 11:33:02] main.DEBUG: cache_invalidate:  {"method":"GET","url":"http:/","invalidateInfo":{"identifier":"DB_PDO_MYSQL_DDL_catalog_product_entity_text_tmp_indexer_4"},"is_exception":false} []
[2016-07-27 11:33:02] main.DEBUG: cache_invalidate:  {"method":"GET","url":"http:/","invalidateInfo":{"identifier":"DB_PDO_MYSQL_DDL_catalog_product_entity_varchar_tmp_indexer_1"},"is_exception":false} []
[2016-07-27 11:33:02] main.DEBUG: cache_invalidate:  {"method":"GET","url":"http:/","invalidateInfo":{"identifier":"DB_PDO_MYSQL_DDL_catalog_product_entity_varchar_tmp_indexer_2"},"is_exception":false} []
[2016-07-27 11:33:02] main.DEBUG: cache_invalidate:  {"method":"GET","url":"http:/","invalidateInfo":{"identifier":"DB_PDO_MYSQL_DDL_catalog_product_entity_varchar_tmp_indexer_3"},"is_exception":false} []
[2016-07-27 11:33:02] main.DEBUG: cache_invalidate:  {"method":"GET","url":"http:/","invalidateInfo":{"identifier":"DB_PDO_MYSQL_DDL_catalog_product_entity_varchar_tmp_indexer_4"},"is_exception":false} []
[2016-07-27 11:33:02] main.DEBUG: cache_invalidate:  {"method":"GET","url":"http:/","invalidateInfo":{"identifier":"DB_PDO_MYSQL_DDL_catalog_product_entity_int_tmp_indexer_1"},"is_exception":false} []
[2016-07-27 11:33:02] main.DEBUG: cache_invalidate:  {"method":"GET","url":"http:/","invalidateInfo":{"identifier":"DB_PDO_MYSQL_DDL_catalog_product_entity_int_tmp_indexer_2"},"is_exception":false} []
[2016-07-27 11:33:02] main.DEBUG: cache_invalidate:  {"method":"GET","url":"http:/","invalidateInfo":{"identifier":"DB_PDO_MYSQL_DDL_catalog_product_entity_int_tmp_indexer_3"},"is_exception":false} []
[2016-07-27 11:33:02] main.DEBUG: cache_invalidate:  {"method":"GET","url":"http:/","invalidateInfo":{"identifier":"DB_PDO_MYSQL_DDL_catalog_product_entity_int_tmp_indexer_4"},"is_exception":false} []
[2016-07-27 11:33:02] main.DEBUG: cache_invalidate:  {"method":"GET","url":"http:/","invalidateInfo":{"identifier":"DB_PDO_MYSQL_DDL_catalog_product_entity_int_tmp_indexer_value_1"},"is_exception":false} []
[2016-07-27 11:33:02] main.DEBUG: cache_invalidate:  {"method":"GET","url":"http:/","invalidateInfo":{"identifier":"DB_PDO_MYSQL_DDL_catalog_product_entity_int_tmp_indexer_value_2"},"is_exception":false} []
[2016-07-27 11:33:02] main.DEBUG: cache_invalidate:  {"method":"GET","url":"http:/","invalidateInfo":{"identifier":"DB_PDO_MYSQL_DDL_catalog_product_entity_int_tmp_indexer_value_3"},"is_exception":false} []
[2016-07-27 11:33:02] main.DEBUG: cache_invalidate:  {"method":"GET","url":"http:/","invalidateInfo":{"identifier":"DB_PDO_MYSQL_DDL_catalog_product_entity_int_tmp_indexer_value_4"},"is_exception":false} []
[2016-07-27 11:33:02] main.DEBUG: cache_invalidate:  {"method":"GET","url":"http:/","invalidateInfo":{"identifier":"DB_PDO_MYSQL_DDL_catalog_product_entity_datetime_tmp_indexer_1"},"is_exception":false} []
[2016-07-27 11:33:02] main.DEBUG: cache_invalidate:  {"method":"GET","url":"http:/","invalidateInfo":{"identifier":"DB_PDO_MYSQL_DDL_catalog_product_entity_datetime_tmp_indexer_2"},"is_exception":false} []
[2016-07-27 11:33:02] main.DEBUG: cache_invalidate:  {"method":"GET","url":"http:/","invalidateInfo":{"identifier":"DB_PDO_MYSQL_DDL_catalog_product_entity_datetime_tmp_indexer_3"},"is_exception":false} []
[2016-07-27 11:33:02] main.DEBUG: cache_invalidate:  {"method":"GET","url":"http:/","invalidateInfo":{"identifier":"DB_PDO_MYSQL_DDL_catalog_product_entity_datetime_tmp_indexer_4"},"is_exception":false} []
[2016-07-27 11:33:02] main.DEBUG: cache_invalidate:  {"method":"GET","url":"http:/","invalidateInfo":{"identifier":"DB_PDO_MYSQL_DDL_catalog_product_flat_1_tmp_indexer_1"},"is_exception":false} []
[2016-07-27 11:33:02] main.DEBUG: cache_invalidate:  {"method":"GET","url":"http:/","invalidateInfo":{"identifier":"DB_PDO_MYSQL_DDL_catalog_product_flat_1_tmp_indexer_2"},"is_exception":false} []
[2016-07-27 11:33:02] main.DEBUG: cache_invalidate:  {"method":"GET","url":"http:/","invalidateInfo":{"identifier":"DB_PDO_MYSQL_DDL_catalog_product_flat_1_tmp_indexer_3"},"is_exception":false} []
[2016-07-27 11:33:02] main.DEBUG: cache_invalidate:  {"method":"GET","url":"http:/","invalidateInfo":{"identifier":"DB_PDO_MYSQL_DDL_catalog_product_flat_1_tmp_indexer_4"},"is_exception":false} []
[2016-07-27 11:33:02] main.DEBUG: cache_invalidate:  {"method":"GET","url":"http:/","invalidateInfo":{"identifier":"DB_PDO_MYSQL_DDL_catalog_product_flat_1_tmp_indexer_1"},"is_exception":false} []
[2016-07-27 11:33:02] main.DEBUG: cache_invalidate:  {"method":"GET","url":"http:/","invalidateInfo":{"identifier":"DB_PDO_MYSQL_DDL_catalog_product_flat_1_tmp_indexer_2"},"is_exception":false} []
[2016-07-27 11:33:02] main.DEBUG: cache_invalidate:  {"method":"GET","url":"http:/","invalidateInfo":{"identifier":"DB_PDO_MYSQL_DDL_catalog_product_flat_1_tmp_indexer_3"},"is_exception":false} []
[2016-07-27 11:33:02] main.DEBUG: cache_invalidate:  {"method":"GET","url":"http:/","invalidateInfo":{"identifier":"DB_PDO_MYSQL_DDL_catalog_product_flat_1_tmp_indexer_4"},"is_exception":false} []
[2016-07-27 11:33:02] main.DEBUG: cache_invalidate:  {"method":"GET","url":"http:/","invalidateInfo":{"identifier":"DB_PDO_MYSQL_DDL_catalog_product_flat_1_drop_indexer_1"},"is_exception":false} []
[2016-07-27 11:33:02] main.DEBUG: cache_invalidate:  {"method":"GET","url":"http:/","invalidateInfo":{"identifier":"DB_PDO_MYSQL_DDL_catalog_product_flat_1_drop_indexer_2"},"is_exception":false} []
[2016-07-27 11:33:02] main.DEBUG: cache_invalidate:  {"method":"GET","url":"http:/","invalidateInfo":{"identifier":"DB_PDO_MYSQL_DDL_catalog_product_flat_1_drop_indexer_3"},"is_exception":false} []
[2016-07-27 11:33:02] main.DEBUG: cache_invalidate:  {"method":"GET","url":"http:/","invalidateInfo":{"identifier":"DB_PDO_MYSQL_DDL_catalog_product_flat_1_drop_indexer_4"},"is_exception":false} []

I have setup a cron job just for reindexing as a work around for now and it seems to be working. My cron jobs are setup as follows:

* * * * * /opt/plesk/php/5.6/bin/php -d memory_limit=1G -c /opt/plesk/php/5.6/etc/php.ini /magento2/bin/magento cron:run >> /magento2/var/log/magento.cron.log
* * * * * /opt/plesk/php/5.6/bin/php -d memory_limit=1G -c /opt/plesk/php/5.6/etc/php.ini /magento2/update/cron.php >> /magento2/var/log/update.cron.log
* * * * * /opt/plesk/php/5.6/bin/php -d memory_limit=1G -c /opt/plesk/php/5.6/etc/php.ini /magento2/bin/magento setup:cron:run >> /magento2/var/log/setup.cron.log
* * * * * /opt/plesk/php/5.6/bin/php -d memory_limit=1G -c /opt/plesk/php/5.6/etc/php.ini /magento2/bin/magento indexer:reindex
@hostep
Copy link
Contributor

hostep commented Jul 27, 2016

We also see this using CE 2.1.0 - PHP 7.0.8 - Mysql 5.7.13

When adding products, they don't appear on the frontend, until we manually run a bin/magento indexer:reindex every time.

Cronjobs are setup correctly and indexers are set to 'Update by Schedule'.

Sounds like a pretty important bug.

@grasdaggel
Copy link

We are experiencing the same problem on lower Mage2 versions (2.0.4 and 2.0.6). So far we haven't found a solution for that.

@nmallepally
Copy link

Yes, it is a important bug. I am experiencing the same issue as well, Magento 2.1 v, The cron is setup properly, but does not show products until it is re indexed.

@boldhedgehog
Copy link

boldhedgehog commented Jul 29, 2016

Works for me if I set 'Use Separate Process' to 'No' for the index CRON group.

@hostep
Copy link
Contributor

hostep commented Jul 29, 2016

@boldhedgehog: tnx, but unfortunately it doesn't seem to fix our issue :(

@ghost
Copy link
Author

ghost commented Jul 29, 2016

Setting 'Use Separate Process' to 'No' for the index CRON group does not work for me either.

@boldhedgehog
Copy link

@hostep I had to wait a little and after 5-10 runs of cron:run Magento had added indexer tasks to cron_schedule:

schedule_id job_code status messages created_at scheduled_at executed_at finished_at
1106 indexer_update_all_views success NULL 2016-07-29 15:34:45 2016-07-29 15:34:00 2016-07-29 15:34:47 2016-07-29 15:34:47
1105 indexer_reindex_all_invalid success NULL 2016-07-29 15:34:45 2016-07-29 15:34:00 2016-07-29 15:34:47 2016-07-29 15:34:47

@hostep
Copy link
Contributor

hostep commented Jul 29, 2016

@boldhedgehog: yes, I see them too, even with 'Use separate process' on 'Yes'. So this means the indexers are correctly executed through the cron, but something in the execution itself goes wrong I guess...

If I find some time in the coming days, I'll debug and try figure out what exactly goes wrong.

Tnx for the hints!

@ghost
Copy link
Author

ghost commented Jul 29, 2016

This is the same behaviour for me as well. The cron_schedule table says success for the status but the frontend does not update.

@boldhedgehog
Copy link

boldhedgehog commented Jul 29, 2016

It has rebuilt my Elasticsearch index. This can be an index/caching issue, not a CRON/index issue you have now, in addition.

@ojhaujjwal
Copy link

ojhaujjwal commented Aug 10, 2016

I have the same problem in 2.1.0. I have setup the cron job nicely. I even tried to run cron:run manually more than once but the indexing was not done. However, running indexer:reindex did all the reindexing. So, I think that means a bug in cron:run which does not do the job of indexing.

@ojhaujjwal
Copy link

This seems a critical issue. Is there any workaround for fixing this until an official fix is done?

@ghost
Copy link
Author

ghost commented Aug 13, 2016

@ojhaujjwal I setup an additional cron job to run the indexer:reindex command for now. It fills up the debug.log file quite quickly when it's run though.

@ojhaujjwal
Copy link

@crtsl I noticed that if I add magento indexer:reindex to cron, the cache is invalidated everytime the command is run and I have to flush the page cache. This creates even more problems.

@Ctucker9233
Copy link

I have noticed this behavior as well. I have to run indexer:reindex and it makes my debug.log incredibly large. It's a pain but I clear out information that is more than a month old. Magento 1 had an automated function to clear the logs. Wish they would bring that back.

@ojhaujjwal
Copy link

Can anybody tell me the status of this issue? Is there any internal-ticket for the issue? Is there any commits that may fix the issue?

@gman-1986
Copy link

Has anyone found a solution to this problem yet?

@ghost
Copy link
Author

ghost commented Aug 26, 2016

@gman-1986 running php bin/magento indexer:reindex works to reindex but that's a manual approach, far from a fix.

I don't see an internal ticket reference for this issue though which is concerning considering it is an important bug.

@patrickpeng2091
Copy link

I have the same problem in 2.0.7 ,PHP7.0.8 ,mysql 5.6.30
image

running 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:02:17
SQLSTATE[HY000]: General error: 1205 Lock wait timeout exceeded; try restarting transaction, query was: DELETE FROM catalog_product_index_eav_idx
Stock index has been rebuilt successfully in 00:00:30
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
Cleaned cache types:

@gman-1986
Copy link

Does anyone know if this issue is fixed in 2.1.1.

@ghost
Copy link
Author

ghost commented Sep 2, 2016

The issue still appears to be there after upgrading to 2.1.1.

@wildekin
Copy link

wildekin commented Sep 10, 2016

+1 this, so annoying having to manually reindex via ssh every time I make a change to the site!

@ghost
Copy link
Author

ghost commented Sep 12, 2016

@oserediuk is there any update to this issue? Is there an internet ticket?

@mbrehme
Copy link

mbrehme commented Sep 14, 2016

+1 This issue is critical for us

@serzhik
Copy link
Contributor

serzhik commented Sep 14, 2016

I use temporary solution.
Create pub/reindex.php:

<?php
header('Content-Encoding: none;');

set_time_limit(0);

$handle = popen("php /var/www/html/bin/magento indexer:reindex", "r");

if (ob_get_level() == 0)
    ob_start();

while(!feof($handle)) {

    $buffer = fgets($handle);
    $buffer = trim(htmlspecialchars($buffer));

    echo $buffer . "<br />";
    echo str_pad('', 4096);

    ob_flush();
    flush();
    sleep(1);
}

pclose($handle);
ob_end_flush();

Run http://example.com/pub/reindex.php to reindex.

Still waiting for solving of this issue.

@pitangaweb
Copy link

pitangaweb commented Sep 29, 2016

I have the same issue with Magento 2.1.1 on cPanel.
Cron jobs run everytime without errors
Nothing in log files or php error log
indexer_reindex_all_invalid shows in cron_schedule table

But new products won't show if I do not manually reindex - php bin/magento indexer:reindex

@gman-1986
Copy link

Does anyone know if the latest version 2.1.2 has fixed the problem?

@ghost
Copy link
Author

ghost commented Oct 13, 2016

@gman-1986 I just upgraded from 2.1.1 to 2.1.2 and this issue is not fixed.

@ghost ghost closed this as completed Oct 13, 2016
@romeof1980
Copy link

hi there!
we can confirm we were able to reproduce the issue on 2.1.8 too (after upgrading from 2.1.5).
truncating the table cron_schedule, setting the indexer on "update on save" and re-setting them on "update on schedule" and finally clearing page_cache fixed the issue once again for us (at the first try).
For completeness' sake: we still run with the following settings:
1 Stores -> Configuration -> Advanced -> System -> Cron (Scheduled Tasks) -> Cron configuration options for group:index -> Use Separate Process -> SET TO "YES"
2 Stores -> Configuration -> Advanced -> System -> Cron (Scheduled Tasks) -> Cron configuration options for group:default -> Use Separate Process -> SET TO "NO")

cheers!

@karlsminton
Copy link

karlsminton commented Sep 21, 2017

Can anyone confirm whether or not this is only affecting the indexers? Do any other scheduled tasks work normally?

Edit: From further research it seems to just be affecting indexers

@robbanl
Copy link

robbanl commented Sep 21, 2017

How is it possible that this issue have existed since summer 2016 and not have been fixed by Magento? Following...

@magento-engcom-team magento-engcom-team added the Issue: Clear Description Gate 2 Passed. Manual verification of the issue description passed label Oct 3, 2017
@patadeloso
Copy link

If the indexers work from CLI, but not from cron. Check the default system ulimits. I've found that to be an issue on some systems.

@Nix-id
Copy link

Nix-id commented Nov 7, 2017

I have problem on M2.2.0 with cron job "indexer_update_all_views"
it's stuck in "running" status
also exists process
20404 ? Ss 0:00 /bin/sh -c /usr/bin/php /home/mag/www//bin/magento cron:run | grep -v "Ran jobs by schedule" >> /home/mag/www//var/log/magento.cron.log
20437 ? S 0:05 /usr/bin/php7.0 /home/mag/www/*/bin/magento cron:run --group=index --bootstrap=standaloneProcessStarted=1

i have some configurable products with many simple products assined. ~5k simple products.

I don't see any errors in log files

@magento-engcom-team
Copy link
Contributor

@crtsl, thank you for your report.
The issue is already fixed in 2.2.1

@magento-engcom-team magento-engcom-team added Fixed in 2.2.x The issue has been fixed in 2.2 release line Issue: Confirmed Gate 3 Passed. Manual verification of the issue completed. Issue is confirmed labels Nov 23, 2017
@dnadle
Copy link

dnadle commented Nov 24, 2017

Will the fix be backported to 2.1.x?

@jeffmalterre
Copy link

Not sure if this is related or not... I'm having trouble running cron (2.2.1) I can reindex myself but when I try to run cron it just hangs. I checked php/magento logs and there was nothing in them, however... when I looked into mysql logs im getting (Got an error writing communication packets) timestamped at the exact time I'm trying to run cron.

Thanks,
Jeff

@chlignell
Copy link

Hi everybody!

I had the same problem with indexes (my case product indexes) not being reindexed with cron:run. This caused new products to not being shown on frontend without a manual index:reindex.

The problem was that version_id in mview_state table had a value much higher than the autoincrement value in catalog_product_category_cl table. Everytime magento 2 cron runs it checks whether the changelogs tables have higher values than mview_state indexes (version_id). In my case I was able to resolve my issue by setting version_id in mview_state to 0 for the faulty indexes.

This command solved my problem:
UPDATE mview_state SET version_id = '0' WHERE view_id = 'catalog_product_category';

I hope this can help someone else out there, I hade to spend several frustrating hours on this issue.

/Chris

@gman-1986
Copy link

I still have the issue on 2.2.1 does anyone else?

@rahimalizada
Copy link

In my case column 'status' was stuck in 'suspended' for 'catalog_product_category' view in mview_state. Resetting the value to 'idle' fixed the issue. Additionally i set version_id to 0 and allowed the cron to reindex.
@chlignell Thanks for the tip!

@toddbc
Copy link
Contributor

toddbc commented Feb 3, 2018

Yes - this can happen sometimes when the cron process either crashes or is terminated by oom-killer. For that scenario, you can also use magento indexer:reset instead of manually updating the database.

Note that before doing this, it's best to validate that no cron process is currently running.

@unicoder88
Copy link
Contributor

unicoder88 commented Feb 9, 2018

@magento-engcom-team , is it possible to see some references to commit or task number to understand what can cause this?
Currently I'm having very strange behaviour that sometimes AUTO_INCREMENT numbers are reset back to 1 for some indexes (_cl tables) and update by schedule no longer works for them (M2.1.7).

@toddbc
Copy link
Contributor

toddbc commented Feb 9, 2018

@unicoder88 I've actually just opened #13577 to fix exactly that issue. You can see an explanation of why it happens there.

@franckgarnier21
Copy link

You can check if the status of mview_state is not working after a script crash.

@ericvhileman
Copy link

We wrote an extension to fix these bugs, speed up performance, and control the execution of tasks: https://github.com/magemojo/m2-ce-cron

@somnath12
Copy link

No need to run re indexing. to get instant help please contact here [email protected]

@addinm
Copy link

addinm commented Nov 27, 2018

@crtsl Please see my bug report and the solution here: #19417

@rksh1997
Copy link

rksh1997 commented Mar 27, 2019

I still have this issue on Magento 2.3.0

Crons are setup correctly and my custom indexer is set to update on schedule.

I have to run index:reindex my_custom_indexer everytime I want to run my custom indexer, the indexer is not triggered on save too although I have correct subscriptions in my mview.xml

It only works fine calling it through the command line.

@JaromirMullerQuanti
Copy link

JaromirMullerQuanti commented Jun 12, 2019

I have same issue and found that magento cannot run separated process to execute index job. I had to switch settings to Use Separate Process = No and then scheduled indexes executes fine.

I also noticed that indexer_update_all_views has status run.

Magento 2.3.1

@malwis
Copy link

malwis commented Jun 21, 2019

Hello, i need your Help:
Magento 2.3.1
php /var/www/webroot/ROOT/bin/magento indexer:reindex

Results:
Design Config Grid index has been rebuilt successfully in 00:00:00
Customer Grid index has been rebuilt successfully in 00:00:00

I can't reindex following Position:
catalog_category_product
catalog_product_category

Please tell my what i can to reindex this 2 Position. Thanks

@AdeelMurtaza
Copy link

We are facing similar issue where after a customer purchases items on our store, items gets disappeared on our store front from category pages. Only solution is to manually reindex which is not a solution but strangely it is only happening to one of our stores.

Magneto support yet to come up with a positive answer. We are on Magneto cloud 2.3.1 and yet facing such issue. I was hopeful after Adobe acquisition but no luck.

pdohogne-magento pushed a commit that referenced this issue Jul 28, 2020
[TSG] MC-35316: Pagination products not work in admin create order page
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug report Fixed in 2.2.x The issue has been fixed in 2.2 release line Issue: Clear Description Gate 2 Passed. Manual verification of the issue description passed Issue: Confirmed Gate 3 Passed. Manual verification of the issue completed. Issue is confirmed Issue: Format is valid Gate 1 Passed. Automatic verification of issue format passed
Projects
None yet
Development

No branches or pull requests