0

I've been working with magento for a month now and everything working fine so far. Due to circumstances I need to move magento to another machine. Again everything are working properly after I move it. But then when I want to create new category and products I received the below error. I don't think that moving magento was the main cause. I'm using magento version 2.2.4.

Error received when saving new category

adding category error

Error received when saving new simple products

Adding simple products error

Exception log (after saving new category):

*main.CRITICAL: SQLSTATE[23000]: Integrity constraint violation: 1048 Column 'entity_id' cannot be null, query was: INSERT INTO `catalog_category_entity` (`entity_id`, `attribute_set_id`, `parent_id`, `created_at`, `updated_at`, `path`, `position`, `level`, `children_count`) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?) {"exception":"[object] (Zend_Db_Statement_Exception(code: 23000): SQLSTATE[23000]: Integrity constraint violation: 1048 Column 'entity_id' cannot be null, query was: INSERT INTO `catalog_category_entity` (`entity_id`, `attribute_set_id`, `parent_id`, `created_at`, `updated_at`, `path`, `position`, `level`, `children_count`) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?) at magento\\vendor\\magento\\zendframework1\\library\\Zend\\Db\\Statement\\Pdo.php:235, PDOException(code: 23000): SQLSTATE[23000]: Integrity constraint violation: 1048 Column 'entity_id' cannot be null at magento\\vendor\\magento\\zendframework1\\library\\Zend\\Db\\Statement\\Pdo.php:228)"} []*

Exception log (after saving new simple products):

*main.CRITICAL: SQLSTATE[23000]: Integrity constraint violation: 1048 Column 'entity_id' cannot be null, query was: INSERT INTO `catalog_product_entity` (`entity_id`, `attribute_set_id`, `type_id`, `sku`, `has_options`, `required_options`, `created_at`, `updated_at`) VALUES (?, ?, ?, ?, ?, ?, ?, ?) {"exception":"[object] (Zend_Db_Statement_Exception(code: 23000): SQLSTATE[23000]: Integrity constraint violation: 1048 Column 'entity_id' cannot be null, query was: INSERT INTO `catalog_product_entity` (`entity_id`, `attribute_set_id`, `type_id`, `sku`, `has_options`, `required_options`, `created_at`, `updated_at`) VALUES (?, ?, ?, ?, ?, ?, ?, ?) at magento\\vendor\\magento\\zendframework1\\library\\Zend\\Db\\Statement\\Pdo.php:235, PDOException(code: 23000): SQLSTATE[23000]: Integrity constraint violation: 1048 Column 'entity_id' cannot be null at magento\\vendor\\magento\\zendframework1\\library\\Zend\\Db\\Statement\\Pdo.php:228)"} []*

From the exception log, magento was failing due to entity_id.

Do you know what's causing and how to solve the issue? Updating existing products are working fine. Any help will be appreciated.

1 Answer 1

0

I just got that problem and it was because I forgot I had disabled some module in my new environment. You should take a look at that. Personally I had disabled a lot of Magento staging module from the EE edition.

1
  • Hey! Right now, only a theme was installed to my site and I tried to install it (the theme) to a fresh install magento and saving new products/category works just fine. Before I installed quite a few free extensions that wasn't compatible with the magento at all and so I remove it, maybe that's the cause? Im using CE.
    – origin
    Jun 22, 2018 at 1:13

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.