-
Notifications
You must be signed in to change notification settings - Fork 9.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Cannot create new product M2.1 sql error #6101
Comments
This could be related to MySQL version. Currently magento 2.1 supports 5.6: http://devdocs.magento.com/guides/v2.1/install-gde/system-requirements-tech.html Here you can see a notice that it does not support 5.7: |
I guess you're reporting this for Magento EE (sequence_product being table only relevant and available on EE). What type of a product were you trying to create? Could you provide more specific steps because i could create simple product in 2.1 EE without any problems. Here's what I did:
EXPECTED: Product created System: Ubuntu 16.04 VB image / Apache 2.4.18 / Mysql 5.6.31-77.0 / PHP7.0.8-4 What kind of product should be created? More detailed steps would help (starting from "Install fresh copy of Magento 2.1 CE/EE) as it would make it easier to figure out what's happening and catch the error :) I have a feeling that it might be that there's a item in the sequence_product that is not matched with a catalog_product_entity row. Was something done with the DB disabled constraints? Could you check that rows in catalog_product_entity and sequence_product match up? |
@allanpaiste I was creating simple product, same problem appears for creating category. I changed mysql to 5.6.32 same problem appears on install, so probably on creating product/category also. |
Same problem appears for me when i want to add new row directly in sql / phpmyadmin.
|
@adamaoo thank you for your report. |
According to contributor guide, tickets without response for two weeks should be closed. |
For future readers. it's not an issue. It's related how works Magento EE. You need to get the entity_id from the sequence_product table. The id is based on the next auto increment value from this sequence_product table. You need to insert a new value and reuse it while inserting a new product into the catalog_product_entity table. See the class \Magento\CatalogStaging\Model\ResourceModel\ProductSequence |
MC-37065: [Magento Admin] Fix CSP Issue
Preconditions
5.7.11 - MySQL
Steps to reproduce
Expected result
Actual result
Cannot add or update a child row: a foreign key constraint fails (
magento2
.catalog_product_entity
, CONSTRAINTCATALOG_PRODUCT_ENTITY_ENTITY_ID_SEQUENCE_PRODUCT_SEQUENCE_VALUE
FOREIGN KEY (entity_id
) REFERENCESsequence_product
(sequence_value
) )The text was updated successfully, but these errors were encountered: