How to Fix Magento Product Flat Data Index Stuck on Processing

If you’ve ever gone in to re-index your Product Flat Data index, and noticed that the orange Processing… status icon won’t go away, you are not alone! It’s quite a common problem, especially for those that have backed-up and restored any piece of the Magento database, especially anything relating to emptying or truncating the product tables to remove all products in Magento and reset product IDs to 0. Luckily, there’s *usually* a simple fix!

A simple way that typically works is to truncate (empty) the catalog_product_flat_1 table that Magento uses for it’s product flat data index. To do that:
1. Login to phpMyAdmin if you have it.
2. Locate your Magento database, and run this SQL query:

TRUNCATE `catalog_product_flat_1`

3. Run the query (**Don’t forget to append any table prefixes that you may be using!! If your tables look like: “mymagento_catalog_product_flat_1” for instance**)

Another thing that might be happening is that your /var/locks folder may have stale locks, which need to be removed.

1. Find /var/locks folder in your file structure, and delete everything within the locks folder.
Posted in Magento, Magento Enterprise, Magento Fixes, Magento Professional, MySQL
  • Aarchi

    It’s awesome.

  • Pingback: Run Indexes whilst integrity constraint occurs « Magento Backstage()

  • Thanks Man Great Work.. It works for me

  • Pm6

    Thanks your very much !!!

  • Adiln420

    This only works temporarily for me, i have to do it each time i want to reindex product flat data. Is there a permanent fix?

    Thank you

  • Getitonfancydress

    AMAZING!! Worked for me after so many other things didnt!! Cant thank you enough

  • Daredevil

    It didn’t help me.

  • not helping

    • Hi Alexander,

      Once you truncate the database, do you get an error when trying to re-index after? Same problem as before? Did you remove any locks that you may have? Magento Version?

      • My magento version is 1.6.2
        I did both: trancate the database and removed locks, Thank you!

  • Dan Kelley

    Thanks for this tip!   So what is the best way to delete all your products in Magento 1.6 ?  
    It takes such a long time from the admin.

    • Hey Dan, There are a few ways, but one method would be to use the delete() method from the Mage class. Mage::getModel(’catalog/product’)->load($product_id)->delete(); Loop through each product in your catalog, pass the product ID into the $product_id into the method, and voila! This method takes use of Magento’s class, so I prefer these types of methods rather than truncating mysql tables.
      Check out http://www.fortwaynewebdevelop… – a post I just wrote up using the SOAP API to delete products!

      • LuizSantos

        Hi Brad, I have the same issue, but the store so far is working fine. Do I really need to delete all products in order to make it work? Or is there any other solution? Sorry, but I am quite afraid of using this method and lose all my products.

        • Hi Luiz,

          Dan’s question was off-topic from this post itself, so don’t think you have to delete your products to get the index working properly again!

        • LuizSantos

          Ok, so how do I do it without deleting anything? Do u know where there’s a step by step guide or a video? I mean, I know I have to truncate, but I have no experience in PHPMyadmin

  • Maarten Van Ruitenburg

    Awesome! I had this problem forever and this actually fixed it!

    • Maarten – glad it solved the problem for you!

    • Glad to hear it fixed it for you 🙂