There can be numerous factors for such errors i.e.
php.ini maximum execution time & script input time error
apache/lighttpd timeout setting issue
number of products and store views
lock file from previous time preventing indexing to take place
Getting Rid Of Magento ReIndexing Errors
If even after trying multiple times Magento Indexer fails to respond or keep throwing same errors you can take the following steps resolve Magento ReIndexing errors.
Locate var/locks directory and remove all files under this directory. This will clear all the locks for re-indexing to take place again.
Now, login to your MysQSL/phpMyAdmin to run the following MySQL query (Ensure that your have taken full backup before committing this MySQL query)
DELETE cpop.* FROM catalog_product_option_price AS cpop
INNER JOIN catalog_product_option AS cpo
ON cpo.option_id = cpop.option_id
WHERE
cpo.type = 'checkbox' OR
cpo.type = 'radio' OR
cpo.type = 'drop_down';
DELETE cpotp.* FROM catalog_product_option_type_price AS cpotp
INNER JOIN catalog_product_option_type_value AS cpotv
ON cpotv.option_type_id = cpotp.option_type_id
INNER JOIN catalog_product_option AS cpo
ON cpotv.option_id = cpo.option_id
WHERE
cpo.type <> 'checkbox' AND
cpo.type <> 'radio' AND
cpo.type <> 'drop_down';
Log back in to your Magento Admin panel and go to System tab > Index Management hit index again and you will notice no such errors will appear again. You can follow these same steps again if re-indexing stops in future to resolve Magento ReIndexing issues.
I would love to hear your experiences and questions about Magento Indexing, ReIndexing and indexing errors. Please leave me a comment and let me know.
The var/locks/ (note the "s") directory is created whenever you start an indexing process. Magento writes out a lock file to this directory. Removing the lock files may resolve issues with reindexing.
Like in previous Magento versions, in Magento 1.9 you can find this directory here:
[your Magento install dir]/var/
If the directory isn't there, Magento hasn't created it. If this is the case, then you should look for other solutions for fixing the reindexing issue.
Maybe your var directory doesn't have the right permissions. Magento needs sufficient permissions to be able to create the var/locks directory and write out the lock files. Try setting permissions for var to (at least) 755.
If this doesn't help, maybe you can reindex via SSH or try restarting your webserver.