0

We are getting Integrity constraint violation: 1062 error when we are going to reindex in magento 2. Kindly see the error below and let me know if any update

Category Flat Data indexer process unknown error: SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry '889' for key 'PRIMARY', query was: INSERT INTO `catalog_category_flat_store_1_tmp` (`row_id`,`entity_id`,`created_in`,`updated_in`,`attribute_set_id`,`parent_id`,`created_at`,`updated_at`,`path`,`position`,`level`,`children_count`,`store_id`,`all_children`,`automatic_sorting`,`available_sort_by`,`children`,`custom_apply_to_products`,`custom_design`,`custom_design_from`,`custom_design_to`,`custom_layout_update`,`custom_use_parent_settings`,`default_sort_by`,`description`,`disabled_children`,`display_mode`,`filter_price_range`,`image`,`include_in_menu`,`is_active`,`is_anchor`,`label_value`,`landing_page`,`level_column_count`,`meta_description`,`meta_keywords`,`meta_title`,`mp_meta_robots`,`name`,`page_layout`,`path_in_store`,`static_block_bottom_value`,`static_block_left_value`,`static_block_right_value`,`static_block_top_value`,`url_key`,`url_path`,`use_label`,`use_static_block`,`use_static_block_bottom`,`use_static_block_left`,`use_static_block_right`,`use_static_block_top`,`use_thumbail`) VALUES
  • Try to restart your mysql using this command in the shell sudo service mysql restart and try again php bin/magento indexer:reindex – Usman Yousaf Oct 26 '18 at 10:09
  • 1
    @UsmanYousaf this is not working for us. Kindly check this once again and it is Integrity constraint violation: 1062 Duplicate entry '889'. – Nilay Kumar Oct 26 '18 at 11:15
0

Apply this command in sequence.

php bin/magento s:up
php bin/magento setup:di:compile
php bin/magento s:s:d -f
php bin/magento ind:rein

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.