Magento Forum

Category Products index fails after update
 
Rosivrepus
Jr. Member
 
Total Posts:  12
Joined:  2008-11-25
 

After upgrading to 1.4.2 I am no longer able to index the Category Products (all other indices work fine). Clearing cache, etc, does not work. The error is:

exception ‘PDOException’ with message ‘SQLSTATE[23000]: Integrity constraints violation: 1452 Cannot add or update a child row: a foreign key constraint fails (`magento/catalog_category_product_index`, CONSTRAINT `FK_CATALOG_CATEGORY_PROD_IDX_CATEGORY_ENTITY` FOREIGN KEY (`category_id`) REFERENCES `catalog_category_entity` (`entity_id`) ON D)’ in /home/public_html/lib/Zend/Db/Statement/Pdo.php:228

There are so many topics and weblogs about index errors and foreign key constraints, after reading almost all of them, I still haven’t found the solutions to my problem.

Could somebody please help?

 
Magento Community Magento Community
Magento Community
Magento Community
 
furnitureforyoultd
Enthusiast
 
Total Posts:  833
Joined:  2009-03-09
 

Give the database repair script a try (http://www.magentocommerce.com/download)

you will however need a clean reference database, so you should install a clean copy of magento somewhere. Once you’re finished with it you can remove the directory but keep the database

 
Magento Community Magento Community
Magento Community
Magento Community
 
Rosivrepus
Jr. Member
 
Total Posts:  12
Joined:  2008-11-25
 

Thank you for your reply. At first it seemed to work. After the database was repaired I could reindex the Category Products. Next I tried to refresh the cache to see whether everything was working correctly.

However, now I am locked out of the backend completely! The admin login page gives me an error 404. The front end is still working fine.

I tried accessing the admin panel using index.php/admin, does not work.
I deleted all magento files, reinstalled magento 1.4.2.0 using the previously repaired database, still get the 404 on the admin login page.

I browsed through a lot of topics about error 404 on the admin error page. None of them offer the solution so far.

Anyone experienced this before and knows the solution?

 
Magento Community Magento Community
Magento Community
Magento Community
 
furnitureforyoultd
Enthusiast
 
Total Posts:  833
Joined:  2009-03-09
 

can you access the admin by logging into the downloader and then clicking “return to admin”? also check local.xml to see the admin directory, you can also change it and try logging in with the new name

<admin>
        <
routers>
            <
adminhtml>
                <
args>
                    <
frontName><![CDATA[admin]]></frontName>
                </
args>
            </
adminhtml>
        </
routers>
    </
admin>
 
Magento Community Magento Community
Magento Community
Magento Community
 
Rosivrepus
Jr. Member
 
Total Posts:  12
Joined:  2008-11-25
 

Logging in to the downloader works, but clicking on “go back to admin” results in the same “404 error: Page not found.” page.

That section in local.xml looks okay:

<admin>
        <
routers>
            <
adminhtml>
                <
args>
                    <
frontName><![CDATA[admin]]></frontName>
                </
args>
            </
adminhtml>
        </
routers>
    </
admin>

I did not change any of that. Just repaired the database and flushed the cache…

Do you have any other suggestions?

 
Magento Community Magento Community
Magento Community
Magento Community
 
furnitureforyoultd
Enthusiast
 
Total Posts:  833
Joined:  2009-03-09
 

change admin to something like admin123, remove anything in var/sessions and var/cache

 
Magento Community Magento Community
Magento Community
Magento Community
 
Rosivrepus
Jr. Member
 
Total Posts:  12
Joined:  2008-11-25
 

Renaming did not work, neither does emptying the cache and session folder, a combination of both or any of the other default error fixing procedures.

I think I have tried almost all solutions that are discribed on the web. And I am getting tired of these upgrade bugs, 404 and fatal errors.

Tomorrow I will start with a fresh install. Reconfigure all the stores, recreate all attribute sets, categories, etc and import the 500 products via import/export. Ow, and reupload the product images and of course restore the related/cross/upsells.

Hopefully Magento will become more sustainable from this version on.

 
Magento Community Magento Community
Magento Community
Magento Community
 
anjordan77
Sr. Member
 
Total Posts:  79
Joined:  2009-11-18
 

I fixed mine in the latest allged stable build.  Granted it’s still putting tons of out of stock items as available and allowing people to purchase them, but at least my site is back up sorta. 

Make sure you go in and disable all of the Cache then once that’s done go to the index and re-index.

I’m still having issues with products showing up in the main categories though.  When you go down to the specific sub-category you can view products, but when at the general category you can’t view any products.

Example:
http://www.allpaintballsupplies.com/paintball-clothing/knee-elbow.html

vs
http://www.allpaintballsupplies.com/paintball-clothing.html

It seems like sometimes it works, others it does not.  Make sure you get all of the re-indexed items done in order otherwise it bonks out.

 
Magento Community Magento Community
Magento Community
Magento Community
Magento Community
Magento Community
Back to top