Saving Product Configuration with many colors and lengths fails
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 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?
Looks like the same problem: https://community.magento.com/t5/Admin-Configuration-Questions/Magento-2-Create-Product-Configurations/m-p/26456
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
Have you tried to increase your max_input_vars Php Setting?
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 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.
Also, thanks for providing the detail of your installation! :)
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
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
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.
Internal ticket for this issue: MAGETWO-51772
Any update on this ticket? In my case problem was fixed updating max_input_vars to 5000.
For develop was fixed in b75fc4f8 For 2.0 - Internal ticket MAGETWO-57645
Is this slated for 2.1.3?
Yes; it's fixed in 2.1.3. Closing this Github issue.
It is stil present in 2.1.3 when trying to save 150+ configurations with images i got Notice: Undefined index: weight
@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
@rkhoury82 wheight is> 0 and if you do the same thing but without images everything is OK