Advanced Search

— Forum Scope —




— Match —





— Forum Options —





Minimum search word length is 3 characters - maximum search word length is 84 characters

mail_open
Magmi Erroring Out
David Siemers

Excellent
March 12, 2015 - 4:32 am
Member Since: November 30, 2014
Forum Posts: 18
sp_UserOfflineSmall Offline

Hey Guys!

Have an odd one here.
I was importing about 15 or so bundled products into Magento using Magmi when I encountered this error:
error 1:SQLSTATE[23000]: Integrity constraint violation: 1452 Cannot add or update a child row: a foreign key constraint fails (`nostalgi_mage2`.`mage_catalog_product_bundle_selection`, CONSTRAINT `FK_F2950E3208607C12E1E60C564D60F7D7` FOREIGN KEY (`option_id`) REFERENCES `mage_catalog_product_bundle_option` (`option_id) – INSERT INTO mage_catalog_product_bundle_selection (option_id, parent_product_id, product_id, position, is_default, selection_qty, selection_can_change_qty, selection_price_value, selection_price_type) VALUES(:option_id, :parent_product_id, :product_id, :position, :is_default, :selection_qty, :selection_can_change_qty, :selection_price_value, :selection_price_type)
error 2:SQLSTATE[23000]: Integrity constraint violation: 1452 Cannot add or update a child row: a foreign key constraint fails (`nostalgi_mage2`.`mage_catalog_product_bundle_selection`, CONSTRAINT `FK_F2950E3208607C12E1E60C564D60F7D7` FOREIGN KEY (`option_id`) REFERENCES `mage_catalog_product_bundle_option` (`option_id) – ERROR ON RECORD #1

This repeats for each record I was trying to import.

I attempted to create these items initially, but they were imported as simple, rather than a bundled product.
I deleted them and then reimported them as bundled products.

Could that be the cause of the issue?
Potentially an indexing issue, or left-over data in the DB?

Not entirely sure, so I’m looking to you guys on some insight on this :-).

Regards,

Dave

Avatar
Jim @ Moogento
Global

Partner
March 12, 2015 - 5:04 am
Member Since: November 7, 2013
Forum Posts: 688
sp_UserOfflineSmall Offline

Hi Dave,

This does sound like a database issue. Have a look at your System>Index and see if any are showing an error. Try re-indexing if there are.

First: backup your database!

If no issues showing or still issues after re-indexing try these steps inside phpMyAdmin or equivalent:

See if any products are connected to a category which doesn’t exist:

SELECT * FROM `catalog_category_product` WHERE product_id not in (select entity_id from catalog_product_entity);

See if any categories are connected to a product which doesn’t exist:

SELECT * FROM `catalog_category_product` WHERE category_id not in (select entity_id from catalog_category_entity);

At this point double-check that you have a database backup and it works!

You can then get dangerous, if the first query returned a result:

DELETE FROM `catalog_category_product` WHERE product_id not in (select entity_id from catalog_product_entity);

If the second query returned a result:

DELETE FROM `catalog_category_product` WHERE category_id not in (select entity_id from catalog_category_entity);
  • pickPack - smarter Magento packing sheets and warehouse picklists
  • shipEasy - process multiple orders with no sweat & get a visual sales overview easily

David Siemers

Excellent
March 12, 2015 - 9:06 pm
Member Since: November 30, 2014
Forum Posts: 18
sp_UserOfflineSmall Offline

Hey Jim!

Thanks for the prompt reply, I really appreciate it!
I both re-indexed the data and ran the SQL queries, but the data re-indexing didn’t work and the SQL results returned nothing.

Do you have anymore ideas?

Also, would it help to turn off the MYSQL foreign key check, or is that a bad idea?

Looking forward to your reply,

David

P.S: I am looking to start using Moogento’s products soon, so it’s reassuring knowing that the staff is responsive and friendly :-).

Avatar
Jim @ Moogento
Global

Partner
March 13, 2015 - 10:09 am
Member Since: November 7, 2013
Forum Posts: 688
sp_UserOfflineSmall Offline

Hi David

Hmm, at this point I usually hire someone who is more knowledgeable about this specific issue. I’ve spent days on it before and then found people that just sort it in an hour or less!

You could try one more thing – try reindexing from the command line (h/t @matt !). If you don’t have access to the command line, ask your host. That should return more detailed errors.

Good to hear you’re interested in our stuff, we try to make them as time-saving and useful as possible. (And try to respond in a working day to all queries)

  • pickPack - smarter Magento packing sheets and warehouse picklists
  • shipEasy - process multiple orders with no sweat & get a visual sales overview easily

Avatar
Matthew Ogborne

Founder
March 13, 2015 - 10:23 am
Member Since: July 18, 2013
Forum Posts: 4565
sp_UserOfflineSmall Offline

Howdy Dave,

I’ve not used the Magmi bundles extension that much I’m afraid, however what I would strongly suggest is raising this as an issue with Magmi directly.

You can do that here https://github.com/dweeves/magmi-git/issues

The Magmi code is maintained by @Sebastien BRACQUEMONT and always sharing such errors is suggested!

Matt

"Selling an item online is easy, but making living from a business that sells online, well that’s something different entirely!"

Ultimo Magento Theme

 

Why Should You Join UnderstandingE?

 
  • Access to over 500 step-by-step video tutorials
  • +20 video courses available
  • Magento, M2E Pro, Magmi, eBay, Amazon & Design all covered
  • Everything is in 100% Plain English
  • Learn how to build your own multi-channel software for eBay & Amazon
  • Access to the community forums, meet fellow business owners like yourself

Join Now with 2 Clicks

 

Join now for less that £1 per day you can gain access to over 400 step-by-step video tutorials & learn how to build your very own multi-channel software.

 

Forum Timezone: Europe/London

Most Users Ever Online: 1012

Currently Online:
33 Guest(s)

Currently Browsing this Page:
1 Guest(s)

Top Posters:

Jim @ Moogento: 688

Steve Froggatt: 514

Badeth - UE: 513

Jimbob: 453

Paul Cartwright: 414

Forum Stats:

Groups: 6

Forums: 37

Topics: 5221

Posts: 27486

Administrators: Matthew Ogborne: 4565, Dave Furness: 4606