Posting in the Magento forums has been disabled pending the implementation of a new and improved forum solution which should better serve the community.

For new questions please post at magento.stackexchange.com, the community-run support site for the Magento community. We will be providing updates on the new forum solution soon. For questions or concerns please email community@magento.com.

Magento Forum

Page 2 of 5
[FIXED] When saving a product there is an SQLSTATE[23000]: Integrity constraint violation error message
 
redpen
Sr. Member
 
Total Posts:  254
Joined:  2008-01-23
 
Gabrusch - 10 September 2008 04:32 AM

redpen can you explain this al little more detaild as I get the same error and get results for this query

Yep.

Run the SQL in PHPMyAdmin, and delete the rows it reports.  Then run it again but change catalog_category_product_index to catalog_category_product (I think) and delete the rows it reports this time.

That should fix the issue until it happens again (about once a week for me).  Back-up before, of course.

 
Magento Community Magento Community
Magento Community
Magento Community
 
Gabrusch
Member
 
Avatar
Total Posts:  44
Joined:  2008-03-26
Wuerzburg, Germany
 

Thank you, this is ridiculous.

What exactly will happen when I have deleted the rows? Will the products get lost?

 
Magento Community Magento Community
Magento Community
Magento Community
 
redpen
Sr. Member
 
Total Posts:  254
Joined:  2008-01-23
 
Gabrusch - 10 September 2008 04:41 AM

Thank you, this is ridiculous.

What exactly will happen when I have deleted the rows? Will the products get lost?

Yes.

 
Magento Community Magento Community
Magento Community
Magento Community
 
Gabrusch
Member
 
Avatar
Total Posts:  44
Joined:  2008-03-26
Wuerzburg, Germany
 

Unfortunately your workaround did not fix it for me. It’s unbelievable, what calls this error

NEWS:
Just a quick update. I deleted the whole catalog_category_product_index row and manually reentered it wath all the indexes and now everythingis working (I hope this will last)

 
Magento Community Magento Community
Magento Community
Magento Community
 
sherrie
Moderator
 
Avatar
Total Posts:  1655
Joined:  2007-12-14
Waterloo, ON
 

I’ve been having this same issue .. it’s on the roadmap for 1.1.6 now, but I’m going to need new categories before then.

@ redpen: your fix did not work for me unfortunately, it returned no results.
@ Gabrusch: Did you run into any errors after deleting catalog_category_product_index and manually reentering it?

 
Magento Community Magento Community
Magento Community
Magento Community
 
keadie
Jr. Member
 
Total Posts:  7
Joined:  2008-08-14
 

I finally gave in and started over.  I needed to anyway because the OSCommerce import module doesn’t import all the fields I need, so I am just using the standard import tool built in.  Luckily I am not live yet!

 
Magento Community Magento Community
Magento Community
Magento Community
 
sherrie
Moderator
 
Avatar
Total Posts:  1655
Joined:  2007-12-14
Waterloo, ON
 

Unfortunately I am live, but I need new categories ...

 
Magento Community Magento Community
Magento Community
Magento Community
 
Gabrusch
Member
 
Avatar
Total Posts:  44
Joined:  2008-03-26
Wuerzburg, Germany
 

Yes, after I fixed it I for the catalog_category_product_index row it started the same issue with sales_flat_order_item.

So I suggest not to mess with the database

 
Magento Community Magento Community
Magento Community
Magento Community
 
redpen
Sr. Member
 
Total Posts:  254
Joined:  2008-01-23
 
sherrie - 11 September 2008 08:49 AM

I’ve been having this same issue .. it’s on the roadmap for 1.1.6 now, but I’m going to need new categories before then.

@ redpen: your fix did not work for me unfortunately, it returned no results.
@ Gabrusch: Did you run into any errors after deleting catalog_category_product_index and manually reentering it?

Really naff bug.  Just had it hit us again on our live site.  Crazy.

Also, could whoever added [FIXED] to the thread remove it please, because it’s clearly not fixed, at all. We’re losing products here randomly from our live site and there’s no fix that I can see apart from a fudge to remove corrupt records…

=(

Edit: yeah, we’ve just lost 21 products, an entire categories worth of products.  So is Magento randomly just deleting products?  (not that I expect an answer on this)

 
Magento Community Magento Community
Magento Community
Magento Community
 
Lisa78
Jr. Member
 
Total Posts:  19
Joined:  2008-09-06
 

First i thought that the German-Language Extension produce the Problem, but now it seems to be total randomly.
1. I’ve used the ssh-installation without demo-data.
2. I Import 4000 products over the oscommerce-Tool.
3. I’ve checked the product-save function -> everything is good.
4. I install the german-laguage-pack. OR change one or two things at the storename or categories
5. I’ve checked the product-save function -> then this error appear:

SQLSTATE[23000]Integrity constraint violation1452 Cannot add or update a child rowa foreign key constraint fails (`dbaqua/catalog_product_website`, CONSTRAINT `FK_CATAOLOG_PRODUCT_WEBSITE_WEBSITEFOREIGN KEY (`website_id`) REFERENCES `core_website` (`website_id`) ON DELETE CASCADE ON UPDATE CASCADE)

I’ve reinstalled the hole shop 10 times and after a few changes the MySQL Problem appears.

The Fixes above are not good, because i don’t want refer each of 4000 products from hand to it category.

Info: I’ve make a db-backup direct after the installation, when the SQL-Problem appear and i restore from the backup the SQL-Problem is still there! There is no way to go live, before there is a real fix, because the backup is nothing worth.

Please mark this Thread as not fixed.

If the Magento-Projekt wants the OSCommerce-Users move to Magento then the developer have to react much faster.

Sorry for my bad english..

Greetings for Lisa

Some info’s: PHP 5.2.6, fastcgi-mode, mysql 5.0.26,

 
Magento Community Magento Community
Magento Community
Magento Community
 
redpen
Sr. Member
 
Total Posts:  254
Joined:  2008-01-23
 

It’s not an OSCommerce issue, though, it’s happening to me weekly, if not more often, and it’s corrupting the database and loosing products. 

I really, really wish Magento would actually reply to these forums, like they used to.

 
Magento Community Magento Community
Magento Community
Magento Community
 
aarne
Sr. Member
 
Total Posts:  130
Joined:  2007-09-06
 

This seems bad, if we can’t rely on the software it becomes suddenly totally unusable for production sites and worse kill the trust in general.

As I understand this happens regardless of setup, version or platform?

 
Magento Community Magento Community
Magento Community
Magento Community
 
redpen
Sr. Member
 
Total Posts:  254
Joined:  2008-01-23
 
aarne - 12 September 2008 03:39 AM

This seems bad, if we can’t rely on the software it becomes suddenly totally unusable for production sites and worse kill the trust in general.

As I understand this happens regardless of setup, version or platform?

It’s really bad, yes, but the lack of feedback from Magento is worse.  If I’d have known about these issues I wouldn’t have invested months of dev time into the software and gone live.  Anything past 1.0 should not have bugs like this.

But, hey, it’s free, right?  =(

 
Magento Community Magento Community
Magento Community
Magento Community
 
sherrie
Moderator
 
Avatar
Total Posts:  1655
Joined:  2007-12-14
Waterloo, ON
 

Here are 3 bug reports (the first of which is listed to be fixed on 1.1.6):
http://www.magentocommerce.com/bug-tracking/issue?issue=3120
http://www.magentocommerce.com/bug-tracking/issue?issue=2560
http://www.magentocommerce.com/bug-tracking/issue?issue=2848

 
Magento Community Magento Community
Magento Community
Magento Community
 
redpen
Sr. Member
 
Total Posts:  254
Joined:  2008-01-23
 
sherrie - 12 September 2008 03:56 AM

Here are 3 bug reports (the first of which is listed to be fixed on 1.1.6):
http://www.magentocommerce.com/bug-tracking/issue?issue=3120
http://www.magentocommerce.com/bug-tracking/issue?issue=2560
http://www.magentocommerce.com/bug-tracking/issue?issue=2848

1.1.6 isn’t good enough, this is a problem we’re facing constantly and needs urgent attention.  There’s a bug, somewhere, which is corrupting product records.  It’s destroying maybe half of the tables, leaving floating rows unconnected in there, and stopping us using the categories option.

It’s also a pain in the proverbials having to add the damned products back each time.

 
Magento Community Magento Community
Magento Community
Magento Community
Magento Community
Magento Community
Back to top
Page 2 of 5