magento2 icon indicating copy to clipboard operation
magento2 copied to clipboard

Saving Product Configuration with many colors and lengths fails

Open joebusby opened this issue 10 years ago • 18 comments

I have a product with 20 colors in 16 lengths and the large number of items fails to save with the following error: SQLSTATE[23000]: Integrity constraint violation: 1452 Cannot add or update a child row: a foreign key constraint fails (magento2.catalog_product_entity, CONSTRAINT CAT_PRD_ENTT_ATTR_SET_ID_EAV_ATTR_SET_ATTR_SET_ID FOREIGN KEY (attribute_set_id) REFERENCES eav_attribute_set (attribute_set_id) ON DELE), query was: INSERT INTO catalog_product_entity (type_id, sku) VALUES (?, ?)

Configurations with small numbers of results (up to 30 or more) work fine. The problem only crops up when the Product record number get high (like over 300) Running on debian 8 with 6 cores

joebusby avatar Jan 27 '16 02:01 joebusby

@joebusby Thanks for reporting, definitely sounds like a bug. Would you mind sharing your PHP version, MySql version, version of Magento (2.0.0 or 2.0.1 at this point), and installation method used when installing the application to help the Magento team successfully reproduce the bug?

davidalger avatar Jan 27 '16 15:01 davidalger

Looks like the same problem: https://community.magento.com/t5/Admin-Configuration-Questions/Magento-2-Create-Product-Configurations/m-p/26456

dmitrii-fediuk avatar Jan 27 '16 18:01 dmitrii-fediuk

The problems seems very consistent with large product generation, although sometimes (trying different things) the system would just hang forever with no error. The rest of the things I did before I ran into this problem worked well. Here is what I have: OpenVZ instance on debian with 3GB of ram and 6 cores Magento Version 2.0.1
PhP version: PHP Version 5.6.17-0+deb8u1 MySQL version 5.6.28 installed with composer PHP memory 1GB

joebusby avatar Jan 28 '16 04:01 joebusby

Have you tried to increase your max_input_vars Php Setting?

schnappenberger avatar Jan 30 '16 16:01 schnappenberger

Thanks schnappenberger, that did it. I changed max_input_vars to 5000 and it worked! Problem Solved. Maybe make that part of the installation instructions for people that have a lot of attributes?

joebusby avatar Jan 30 '16 19:01 joebusby

@joebusby I'm glad you found a workaround to the issue, but I'm re-opening because I believe this is something which still needs addressing. The sql error should not really be allowed to occur. The max_input_vars is something which has affected assigning attribute option values in the admin in the past as well. My opinion is that the admin should be sending this information in a serialized format to avoid randomly exceeding these limits, so they can stay at a sane (i.e. lower) level and so the admin will work seamlessly regardless of the quantity of associations. Server configuration such as this shouldn't have to change IMO in order to accommodate a day-to-day admin function.

davidalger avatar Feb 01 '16 02:02 davidalger

Also, thanks for providing the detail of your installation! :)

davidalger avatar Feb 01 '16 02:02 davidalger

Okay,

Thanks for the help. I tried E_NOTICE disable, but could get no success.

Maybe this will be fixed in the next release.

Joe.

On 2016-01-31 21:54, David Alger wrote:

Also, thanks for providing the detail of your installation! :)

Reply to this email directly or view it on GitHub [1].

Links:

[1] https://github.com/magento/magento2/issues/3154#issuecomment-177726133

joebusby avatar Feb 01 '16 13:02 joebusby

Hello, I have the same problem with Magento 2.0.2 Server Deb8 PHP 5.6 max_input_vars -> 5000

I try with only 2 configurations

Julien

julien30 avatar Feb 04 '16 11:02 julien30

unfortunately this issue is still present within magento 2. Same as Julien30 but attempted to create 130 configurable products. system errors, with the sql issue. resets the product to simple, then ask you to reenter price. then allows you to save never notifying you until you see the product screen that it saved as a simple product.

dmcmillin avatar Mar 15 '16 19:03 dmcmillin

Internal ticket for this issue: MAGETWO-51772

mslabko avatar Apr 28 '16 17:04 mslabko

Any update on this ticket? In my case problem was fixed updating max_input_vars to 5000.

PieterCappelle avatar Aug 23 '16 08:08 PieterCappelle

For develop was fixed in b75fc4f8 For 2.0 - Internal ticket MAGETWO-57645

veloraven avatar Oct 26 '16 07:10 veloraven

Is this slated for 2.1.3?

claridgicus avatar Nov 02 '16 00:11 claridgicus

Yes; it's fixed in 2.1.3. Closing this Github issue.

choukalos avatar Jan 25 '17 21:01 choukalos

It is stil present in 2.1.3 when trying to save 150+ configurations with images i got Notice: Undefined index: weight

peexl-dev avatar Feb 08 '17 08:02 peexl-dev

@peexl-dev I think you have a different issue - just check you have a weight in all your simple product >0 and same for your config product before you save

rudik99 avatar Feb 08 '17 09:02 rudik99

@rkhoury82 wheight is> 0 and if you do the same thing but without images everything is OK

peexl-dev avatar Feb 08 '17 09:02 peexl-dev