Fix Product Flat Data index process unknown error in Magento

A client mentioned that he kept having to reindex the Product Flat Data but the notification in the admin section never went away. While trying to reindex from command line I was greeted with the following error:

Turns out this problem was caused by products which were deleted but still existed in the product flat data table.
To find these products you can run this query:

In this case it was nearly 80 products! To fix it you can just delete them with this query:

2 comments

  1. Hey, thanks for posting this up, those db queries were exactly what I needed to be able to update my indexes.

Leave a Reply