Skip to content
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

SQL Exception while importing more than 100 products #415

Open
nishantraut35 opened this issue Oct 26, 2017 · 3 comments
Open

SQL Exception while importing more than 100 products #415

nishantraut35 opened this issue Oct 26, 2017 · 3 comments

Comments

@nishantraut35
Copy link

Hi,

I am trying to import products csv with 3 attributes.
I am trying to update products attributes with CSV with 420 entries it is giving the following error.
SQLSTATE[23000]: Integrity constraint violation: 1452 Cannot add or update a child row: a foreign key constraint fails (jrs_05.catalog_product_entity_int, CONSTRAINT FK_CAT_PRD_ENTT_INT_ENTT_ID_CAT_PRD_ENTT_ENTT_ID FOREIGN KEY (entity_id) REFERENCES catalog_product_entity (entity_id) ON DELETE CASCA)

Import is working fine up-to 100 products in sheet but not more than that.
Please let me know what can be the issue with it.

Thanks and Regards
Nishant

@barryvdh
Copy link

barryvdh commented Dec 4, 2017

I'm getting the same error, even when I chunk it to small amounts (eg. 10):

SQLSTATE[23000]: Integrity constraint violation: 1452 Cannot add or update a child row: a foreign key constraint fails (`cellofood`.`cataloginventory_stock_item`, CONSTRAINT `FK_CATINV_STOCK_ITEM_PRD_ID_CAT_PRD_ENTT_ENTT_ID` FOREIGN KEY (`product_id`) REFERENCES `catalog_product_entity` (`entity_id`) ON DELETE ), query was: INSERT INTO `cataloginventory_stock_item` (`product_id`,`stock_id`,`manage_stock`,`use_config_manage_stock`,`qty`,`min_qty`,`use_config_min_qty`,`min_sale_qty`,`use_config_min_sale_qty`,`max_sale_qty`,`use_config_max_sale_qty`,`is_qty_decimal`,`backorders`,`use_config_backorders`,`notify_stock_qty`,`use_config_notify_stock_qty`,`enable_qty_increments`,`use_config_enable_qty_inc`,`qty_increments`,`use_config_qty_increments`,`is_in_stock`,`low_stock_date`,`stock_status_changed_auto`,`is_decimal_divided`) VALUES ...

Did you find out what was causing it?

@barryvdh
Copy link

barryvdh commented Dec 5, 2017

And I'm not even updating the stock..

@daaru00
Copy link

daaru00 commented Jan 24, 2018

Same error as @barryvdh , additional sometimes I receive an other SQL error related to cataloginventory_stock_item table:

Job catalog error: SQLSTATE[23000]: Integrity constraint violation: 1048 Column 'product_id' cannot be null, query was: INSERT INTO `cataloginventory_stock_item` (`product_id`,`stock_id`,`manage_stock`,`use_config_manage_stock`,`qty`,`min_qty`,`use_config_min_qty`,`min_sale_qty`,`use_config_min_sale_qty`,`max_sale_qty`,`use_config_max_sale_qty`,`is_qty_decimal`,`backorders`,`use_config_backorders`,`notify_stock_qty`,`use_config_notify_stock_qty`,`enable_qty_increments`,`use_config_enable_qty_inc`,`qty_increments`,`use_config_qty_increments`,`is_in_stock`,`low_stock_date`,`stock_status_changed_auto`,`is_decimal_divided`) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?) ON DUPLICATE KEY UPDATE `product_id` = VALUES(`product_id`), `stock_id` = VALUES(`stock_id`), `manage_stock` = VALUES(`manage_stock`), `use_config_manage_stock` = VALUES(`use_config_manage_stock`), `qty` = VALUES(`qty`), `min_qty` = VALUES(`min_qty`), `use_config_min_qty` = VALUES(`use_config_min_qty`), `min_sale_qty` = VALUES(`min_sale_qty`), `use_config_min_sale_qty` = VALUES(`use_config_min_sale_qty`), `max_sale_qty` = VALUES(`max_sale_qty`), `use_config_max_sale_qty` = VALUES(`use_config_max_sale_qty`), `is_qty_decimal` = VALUES(`is_qty_decimal`), `backorders` = VALUES(`backorders`), `use_config_backorders` = VALUES(`use_config_backorders`), `notify_stock_qty` = VALUES(`notify_stock_qty`), `use_config_notify_stock_qty` = VALUES(`use_config_notify_stock_qty`), `enable_qty_increments` = VALUES(`enable_qty_increments`), `use_config_enable_qty_inc` = VALUES(`use_config_enable_qty_inc`), `qty_increments` = VALUES(`qty_increments`), `use_config_qty_increments` = VALUES(`use_config_qty_increments`), `is_in_stock` = VALUES(`is_in_stock`), `low_stock_date` = VALUES(`low_stock_date`), `stock_status_changed_auto` = VALUES(`stock_status_changed_auto`), `is_decimal_divided` = VALUES(`is_decimal_divided`)

I'm not importing anything that is related to the stock..

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants