0

I added 2000 + products for magento2 , but Magento2 doesn't reindex index.

Run the reindex command bin/magento indexer:reindex successfully. But my store's front doesn't display product.

My Magento 2 version is 2.0.7 , PHP 7.0.8 ,mysql 5.6

var/log

[2016-09-02 13:02:02] main.INFO: Cache file with merged layout: LAYOUT_frontend_STORE1_4c6b6eeafea885c0042386fe963c20026: Please correct the XML data and try again.  [] []
[2016-09-02 13:02:02] main.INFO: Cache file with merged layout: LAYOUT_frontend_STORE1_40a98983867a1770682b48d9a0ad63441: Please correct the XML data and try again.  [] []
[2016-09-02 13:02:02] main.CRITICAL: Broken reference: the 'catalog.compare.sidebar' element cannot be added as child to 'sidebar.additional', because the latter doesn't exi$
[2016-09-02 13:02:02] main.CRITICAL: Broken reference: the 'sale.reorder.sidebar' element cannot be added as child to 'sidebar.additional', because the latter doesn't exist $
[2016-09-02 13:02:02] main.CRITICAL: Broken reference: the 'wishlist_sidebar' element cannot be added as child to 'sidebar.additional', because the latter doesn't exist [] []
[2016-09-02 13:02:02] main.CRITICAL: Broken reference: the 'catalog.compare.link' tries to reorder itself towards 'top.links', but their parents are different: 'header.links$
[2016-09-02 13:02:02] main.CRITICAL: Broken reference: the 'store.settings.currency' tries to reorder itself towards 'store_language', but their parents are different: 'stor$
[2016-09-02 13:02:03] main.INFO: SELECT `e`.*, IF(at_custom_use_parent_settings.value_id > 0, at_custom_use_parent_settings.value, at_custom_use_parent_settings_default.valu$
 LEFT JOIN `catalog_category_entity_int` AS `at_custom_use_parent_settings_default` ON (`at_custom_use_parent_settings_default`.`entity_id` = `e`.`entity_id`) AND (`at_custo$
 LEFT JOIN `catalog_category_entity_int` AS `at_custom_use_parent_settings` ON (`at_custom_use_parent_settings`.`entity_id` = `e`.`entity_id`) AND (`at_custom_use_parent_set$
[2016-09-02 13:02:03] main.INFO: Cache file with merged layout: LAYOUT_frontend_STORE1_46f1b068ec7ccf4878f9284dd1137afd1: Please correct the XML data and try again.  [] []
[2016-09-02 13:02:03] main.INFO: Cache file with merged layout: LAYOUT_adminhtml_STORE1_3e6fe115ba31d500509103893a62701cf: Please correct the XML data and try again.  [] []
[2016-09-02 13:02:03] main.CRITICAL: Broken reference: the 'header' tries to reorder itself towards 'global.notices', but their parents are different: 'page.wrapper' and 'no$
[2016-09-02 13:02:03] main.CRITICAL: Broken reference: the 'page.breadcrumbs' tries to reorder itself towards 'notifications', but their parents are different: 'page.wrapper$
[2016-09-02 13:02:03] main.CRITICAL: Broken reference: the 'notification.messages' tries to reorder itself towards 'user', but their parents are different: 'header.inner.rig$
[2016-09-02 13:02:03] main.INFO: Cache file with merged layout: LAYOUT_adminhtml_STORE1_36f1b068ec7ccf4878f9284dd1137afd1: Please correct the XML data and try again.  [] []
[2016-09-02 13:02:03] main.INFO: Cache file with merged layout: LAYOUT_frontend_STORE1_4a456e24e9e0ef145439d526f18fb8b48: Please correct the XML data and try again.  [] []
[2016-09-02 13:02:03] main.INFO: Cache file with merged layout: LAYOUT_frontend_STORE1_4c6690f29cb80c2b881a7311e8632bc3e: Please correct the XML data and try again.  [] []
[2016-09-02 13:02:03] main.CRITICAL: Broken reference: the 'catalog.compare.link' tries to reorder itself towards 'top.links', but their parents are different: 'header.links$
[2016-09-02 13:02:03] main.CRITICAL: Broken reference: the 'store.settings.currency' tries to reorder itself towards 'store_language', but their parents are different: 'stor$
[2016-09-02 13:02:03] main.CRITICAL: Broken reference: the 'product.info.price' tries to reorder itself towards 'product.info.review', but their parents are different: 'prod$
[2016-09-02 13:02:03] main.CRITICAL: Broken reference: the 'product.price.final' tries to reorder itself towards 'product.info.sku', but their parents are different: 'produc$
[2016-09-02 13:02:03] main.CRITICAL: Broken reference: the 'product.info.social' tries to reorder itself towards 'product.info.overview', but their parents are different: 'p$
[2016-09-02 13:02:03] main.CRITICAL: Broken reference: the 'bml.right.logo' tries to reorder itself towards 'product.info.addtocart.paypal', but their parents are different:$

debug.log

2016-09-02 13:04:02] main.DEBUG: cache_invalidate:  {"method":"GET","url":"http:/","invalidateInfo":{"identifier":"DB_PDO_MYSQL_DDL_customer_grid_flat_3"},"is_exception":fa$
[2016-09-02 13:04:02] main.DEBUG: cache_invalidate:  {"method":"GET","url":"http:/","invalidateInfo":{"identifier":"DB_PDO_MYSQL_DDL_customer_grid_flat_4"},"is_exception":fa$
[2016-09-02 13:04:02] main.DEBUG: cache_invalidate:  {"method":"GET","url":"http:/","invalidateInfo":{"identifier":"DB_PDO_MYSQL_DDL_customer_grid_flat_1"},"is_exception":fa$
[2016-09-02 13:04:02] main.DEBUG: cache_invalidate:  {"method":"GET","url":"http:/","invalidateInfo":{"identifier":"DB_PDO_MYSQL_DDL_customer_grid_flat_2"},"is_exception":fa$
[2016-09-02 13:04:02] main.DEBUG: cache_invalidate:  {"method":"GET","url":"http:/","invalidateInfo":{"identifier":"DB_PDO_MYSQL_DDL_customer_grid_flat_3"},"is_exception":fa$
[2016-09-02 13:04:02] main.DEBUG: cache_invalidate:  {"method":"GET","url":"http:/","invalidateInfo":{"identifier":"DB_PDO_MYSQL_DDL_customer_grid_flat_4"},"is_exception":fa$
[2016-09-02 13:04:32] main.DEBUG: cache_invalidate:  {"method":"GET","url":"http:/","invalidateInfo":{"tags":["catalog_category","catalog_product"],"mode":"matchingAnyTag"},$
[2016-09-02 13:04:32] main.DEBUG: cache_invalidate:  {"method":"GET","url":"http:/","invalidateInfo":{"tags":["catalog_category","catalog_product"],"mode":"matchingAnyTag"},$
[2016-09-02 13:04:32] main.DEBUG: cache_invalidate:  {"method":"GET","url":"http:/","invalidateInfo":{"identifier":"DB_PDO_MYSQL_DDL_catalogsearch_fulltext_scope1_1"},"is_ex$
[2016-09-02 13:04:32] main.DEBUG: cache_invalidate:  {"method":"GET","url":"http:/","invalidateInfo":{"identifier":"DB_PDO_MYSQL_DDL_catalogsearch_fulltext_scope1_2"},"is_ex$
[2016-09-02 13:04:32] main.DEBUG: cache_invalidate:  {"method":"GET","url":"http:/","invalidateInfo":{"identifier":"DB_PDO_MYSQL_DDL_catalogsearch_fulltext_scope1_3"},"is_ex$
[2016-09-02 13:04:32] main.DEBUG: cache_invalidate:  {"method":"GET","url":"http:/","invalidateInfo":{"identifier":"DB_PDO_MYSQL_DDL_catalogsearch_fulltext_scope1_4"},"is_ex$
[2016-09-02 13:04:32] main.DEBUG: cache_invalidate:  {"method":"GET","url":"http:/","invalidateInfo":{"identifier":"DB_PDO_MYSQL_DDL_catalogsearch_fulltext_scope1_1"},"is_ex$
[2016-09-02 13:04:32] main.DEBUG: cache_invalidate:  {"method":"GET","url":"http:/","invalidateInfo":{"identifier":"DB_PDO_MYSQL_DDL_catalogsearch_fulltext_scope1_2"},"is_ex$

root@ubuntu:

    /var/www/magento2# php -d memory_limit=8192M bin/magento indexer:reindex && php bin/magento cache:clean
    Customer Grid index has been rebuilt successfully in 00:00:00
    Category Products index has been rebuilt successfully in 00:00:49
    Product Categories index has been rebuilt successfully in 00:00:56
    SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry '5893-0-1' for key 'PRIMARY', query was: INSERT INTO `catalog_product_index_price_idx` SELECT catalog_product_index_price_final_idx`.`entity_id`,
catalog_product_index_price_final_idx`.`customer_group_id`, catalog_product_index_price_final_idx`.`website_id`, catalog_product_index_price_final_idx`.`tax_class_id`, catalog_product_index_price_final_idx`.`orig_price` AS `price`, catalog_product_index_price_final_idx`.`price` AS `final_price`, catalog_product_index_price_final_idx`.`min_price`, catalog_product_index_price_final_idx`.`max_price`, catalog_product_index_price_final_idx`.`tier_price` FROM catalog_product_index_price_final_idx

My database table "cron_schedule" show message :

indexer_update_all_views
Can't create directory /var/www/magento2/var/generation/Magento/Indexer/Model/Processor/.
indexer_reindex_all_invalid
Can't create directory /var/www/magento2/var/generation/Magento/Indexer/Model/Processor/.
indexer_update_all_views
Can't create directory /var/www/magento2/var/generation/Magento/Indexer/Model/Processor/.
indexer_reindex_all_invalid
Can't create directory /var/www/magento2/var/generation/Magento/Indexer/Model/Processor/.
magento_newrelicreporting_cron
Class Magento\Eav\Model\ResourceModel\Entity\Attribute\CollectionFactory does not exist
Can't create directory
sales_send_order_creditmemo_emails
/var/www/magento2/var/generation/Magento/Framework/Translate/ResourceInterface/.
Can't create directory
 sales_send_order_shipment_emails
/var/www/magento2/var/generation/Magento/Framework/Translate/ResourceInterface/.
Can't create directory
sales_send_order_invoice_emails
/var/www/magento2/var/generation/Magento/Framework/Translate/ResourceInterface/.
Can't create directory
sales_send_order_emails
/var/www/magento2/var/generation/Magento/Framework/Translate/ResourceInterface/.
indexer_update_all_views
Can't create directory /var/www/magento2/var/generation/Magento/Indexer/Model/Processor/.
indexer_reindex_all_invalid
Can't create directory /var/www/magento2/var/generation/Magento/Indexer/Model/Processor/.
  • You added new product via CSV file? – Khoa TruongDinh Sep 2 '16 at 17:30
  • Yes, import product via CSV file. – Patrick-Peng Sep 2 '16 at 23:22
  • After importing with Csv file, product showed properly? And then, after re-indexing, product didn't display? – Khoa TruongDinh Sep 3 '16 at 0:16
  • SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry '5893-0-1' for key 'PRIMARY', query was: INSERT INTO catalog_product_index_price_idx SELECT catalog_product_index_price_final_idx.entity_id, – Patrick-Peng Sep 3 '16 at 10:03
0

In the admin got to System->Cache Management, select all cache types and refresh them. Then reload your shop page. Should be there then.

If this does not help, check your products stock. Are your products active, in stock and if you use magento´s stock management make sure you set the stock amount > 0.

PS: The log outputs you posted look fine! At least that is how they look most of the time in magento even in 100% running shops.

  • Before the products are displayed, now the index is broken , I have no problem setting product, before or displayed. – Patrick-Peng Sep 2 '16 at 23:48
  • How do you know the index is broken? Did you get an error message? – Jérôme Sep 3 '16 at 0:29
  • use cli bin/magento indexer:reindex && php bin/magento cache:clean,display index has been rebuilt successfully in 0:00 ,But , Don't display product , I cleaned cache . – Patrick-Peng Sep 3 '16 at 0:33
  • Did you check that you import was used with the correct stock settings? – Jérôme Sep 3 '16 at 6:14
  • yes, but ,don't diplayed products. – Patrick-Peng Sep 3 '16 at 8:49
0

First re-index data using Command Prompt

/opt/plesk/php/5.6/bin/php bin/magento indexer:reindex

After this use below content Deploy command.

/opt/plesk/php/5.6/bin/php -dmemory_limit=6g  bin/magento setup:static-content:deploy

Then Check it works.

0

There are several issues open issues on Magento Github

#3507

#5627

All of these issues are closed but without solution yet.

If you are now using these blocks I recomended to "reorder" following the instruction or just remove it.

  • Please add what version release fixes those bugs, it greatly improves the value of the site, for anyone trying to fix a problem. – J. M. Becker Dec 14 '18 at 20:51
0

Run below commands again:

php bin/magento setup:upgrade

php bin/magento setup:static-content:deploy(if this command don't work than try this: php bin/magento setup:static-content:deploy -f)

php bin/magento indexer:reindex

php bin/magento cache:clean

if it doesn't help then check your directory writes and try running below command in your root magento directory:

chmod -R 0777 pub var generated

And also check quantity and stock status of your products.

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.