7

I am running Magento 2.1.5 and facing a really strange issue. I have over 6,500 products uploaded to the store but some items are not showing up after performing a complete reindex. Of course, some items are out of stock but many of the products that are not showing up in their respective categories are the similar as others that are showing up just fine. These products are simple (not configurable) and belong to do the same attribute group.

Upon searching for the items in search the missing products show up. Upon saving the item the item appears again only to go missing again upon reindex.

After performing reindex one by one, I noticed the issue is affecting the following tables:

catalog_category_product
catalog_product_category

I even went ahead and added a row which made the product appear again on the front-end but after reindexing the row was deleted.

Does anyone have any clue as to what this issue could be? It's very, very strange but I'm hoping there is a simple solution.

Update 02/27/2017: I am still not able figure out a solution for this bug. If any Magento Expert can gain some insight into this and fix it he or she will be rewarded.

  • As an update to this issue I want to add the following: For a product that was not showing I manually removed the sub-category that it was associated it and only added it to the parent category. When I performed the above action and then did a full reindex the product did not disappear. I will repeat this over many products to see if this is providing any insight as to where exactly the issue is occurring - hopefully someone can find the bug. – SJain Feb 22 '17 at 2:36
  • Were you able to find a solution? We are experiencing the same issue on versions 2.1.4, 2.1.5 and 2.1.6. Several categories are in upper level and lower level (subcategories) at the same time and all categories are set to Anchor to enable filtering. All products are enabled, visibility is set to "Catalog, Search" and all are in stock but most of them disappear after reindexing these indexes; catalog_category_product and catalog_product_category. We are thinking this might be a bug within Magento indexer related to product present both in the same and lower level categories. – ElGatito May 2 '17 at 15:30
  • Got the same problem here. Every time I only use catalog_product_category reindex after product data update import product disappears on fronend. After full reindex it's visible again. This is happening on Magento 2.1.7 – Marceli Po Jan 9 '18 at 13:07
  • im getting the same error and im on magento 2.2.4 and I tried whatever maximum I could do but couldn't resolve the issue. Pls guide - how to solve this problem. More than 350 products are there and after reindex nothing is shown in the frontend, Is there any way we can fix it directly on the database with some SQL. I tried already the suggestion given above but it didnt work may because I couldn't make the changes at right place because the folder structure given above doesnt match with Magento 2.2.4. Pls suggest a solution if possible – Ans Aug 15 '18 at 15:03
1

Seem that we need to increase the memory limit when running re-index a large of number database:

1) Reset db: open your PHP Admin or Mysql GUI tool

update indexer_state set status = 'invalid' where status != 'valid';

2) Re-index again:

php -dmemory_limit=2048M bin/magento indexer:reindex
  • Dear Khoa TruongDinh, – SJain Feb 22 '17 at 14:18
  • @SJain did you try my answer above? – Khoa TruongDinh Feb 22 '17 at 14:19
  • Dear Khoa TruongDinh, Thank you for your reply. I performed the requested tasks but they had no affect. Upon the SQL query, zero rows were affected and the re-index command performed successfully but it did not change. I am going to attempt this again after updating the missing products so they appear and then try this. If they disappear again then we will know the problem lies somewhere else. – SJain Feb 22 '17 at 14:32
  • Ok, the issue still persists. After updating the products so they appear on the store I performed your commands and they have again "disappeared". – SJain Feb 22 '17 at 14:35
  • Yes, I replied above. Please let me know your thoughts regarding this. – SJain Feb 23 '17 at 14:05
1

I have had the same issue, as an answer I am posting a link with a solution that worked for me. Besides, I cannot comment yet.

Reindexing Magento 2 causes products to be missing on the frontend (not the backend) (Solved) - Magento Stackexchange

1

you can run the following;

php bin/magento indexer:reset
php bin/magento indexer:reindex
php bin/magento cache:flush

Which should revive any missing categories.

protected by Community Aug 15 '18 at 16:15

Thank you for your interest in this question. Because it has attracted low-quality or spam answers that had to be removed, posting an answer now requires 10 reputation on this site (the association bonus does not count).

Would you like to answer one of these unanswered questions instead?

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