CDbCommand failed to execute the SQL statement:

I’ve tried numerous times to get past step 3 -- import attribute data but I keep getting errors for “product details”. I reset the step each time but I receive an error each time.
2018/04/04 11:57:41 [error] [ub_data_migration] CDbCommand failed to execute the SQL statement: SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry ‘300-product-details’ for key ‘YS4_CAT_CTGR_PRD_ATTR_SET_ID_ATTR_GROUP_CODE’. The SQL statement executed was: INSERT INTO `ys4_eav_attribute_group` (`attribute_set_id`, `sort_order`, `default_id`, `attribute_group_name`, `attribute_group_code`, `tab_group_code`) VALUES (:yp0, :yp1, :yp2, :yp3, :yp4, :yp5)
2018/04/04 11:59:52 [info] [ub_data_migration] Resetting data migration in the step #3…
2018/04/04 11:59:52 [info] [ub_data_migration] Step #3 was reset successfully
2018/04/04 11:59:58 [info] [ub_data_migration] Start running step #3
2018/04/04 11:59:58 [info] [ub_data_migration] [Processing] Step #3 migration completed with 17 Attribute Sets
2018/04/04 11:59:58 [error] [ub_data_migration] CDbCommand failed to execute the SQL statement: SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry ‘317-product-details’ for key ‘YS4_CAT_CTGR_PRD_ATTR_SET_ID_ATTR_GROUP_CODE’. The SQL statement executed was: INSERT INTO `ys4_eav_attribute_group` (`attribute_set_id`, `sort_order`, `default_id`, `attribute_group_name`, `attribute_group_code`, `tab_group_code`) VALUES (:yp0, :yp1, :yp2, :yp3, :yp4, :yp5)
2018/04/04 12:00:03 [info] [ub_data_migration] Resetting data migration in the step #3…
2018/04/04 12:00:03 [info] [ub_data_migration] Step #3 was reset successfully
2018/04/04 12:00:10 [info] [ub_data_migration] Start running step #3
2018/04/04 12:00:10 [info] [ub_data_migration] [Processing] Step #3 migration completed with 17 Attribute Sets
2018/04/04 12:00:10 [error] [ub_data_migration] CDbCommand failed to execute the SQL statement: SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry ‘334-product-details’ for key ‘YS4_CAT_CTGR_PRD_ATTR_SET_ID_ATTR_GROUP_CODE’. The SQL statement executed was: INSERT INTO `ys4_eav_attribute_group` (`attribute_set_id`, `sort_order`, `default_id`, `attribute_group_name`, `attribute_group_code`, `tab_group_code`) VALUES (:yp0, :yp1, :yp2, :yp3, :yp4, :yp5)
2018/04/04 12:00:16 [info] [ub_data_migration] Resetting data migration in the step #3…
2018/04/04 12:00:16 [info] [ub_data_migration] Step #3 was reset successfully
2018/04/04 12:00:22 [info] [ub_data_migration] Start running step #3
2018/04/04 12:00:22 [info] [ub_data_migration] [Processing] Step #3 migration completed with 17 Attribute Sets
2018/04/04 12:00:22 [error] [ub_data_migration] CDbCommand failed to execute the SQL statement: SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry ‘351-product-details’ for key ‘YS4_CAT_CTGR_PRD_ATTR_SET_ID_ATTR_GROUP_CODE’. The SQL statement executed was: INSERT INTO `ys4_eav_attribute_group` (`attribute_set_id`, `sort_order`, `default_id`, `attribute_group_name`, `attribute_group_code`, `tab_group_code`) VALUES (:yp0, :yp1, :yp2, :yp3, :yp4, :yp5)
2018/04/04 12:00:27 [info] [ub_data_migration] Resetting data migration in the step #3…
2018/04/04 12:00:27 [info] [ub_data_migration] Step #3 was reset successfully
2018/04/04 12:00:38 [info] [ub_data_migration] Start running step #3
2018/04/04 12:00:38 [info] [ub_data_migration] [Processing] Step #3 migration completed with 17 Attribute Sets
2018/04/04 12:00:38 [error] [ub_data_migration] CDbCommand failed to execute the SQL statement: SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry ‘368-product-details’ for key ‘YS4_CAT_CTGR_PRD_ATTR_SET_ID_ATTR_GROUP_CODE’. The SQL statement executed was: INSERT INTO `ys4_eav_attribute_group` (`attribute_set_id`, `sort_order`, `default_id`, `attribute_group_name`, `attribute_group_code`, `tab_group_code`) VALUES (:yp0, :yp1, :yp2, :yp3, :yp4, :yp5)
2018/04/04 12:03:10 [info] [ub_data_migration] Resetting data migration in the step #3…
2018/04/04 12:03:10 [info] [ub_data_migration] Step #3 was reset successfully
2018/04/04 12:09:38 [info] [ub_data_migration] Start running step #3
2018/04/04 12:09:38 [info] [ub_data_migration] [Processing] Step #3 migration completed with 17 Attribute Sets
2018/04/04 12:09:38 [error] [ub_data_migration] CDbCommand failed to execute the SQL statement: SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry ‘385-product-details’ for key ‘YS4_CAT_CTGR_PRD_ATTR_SET_ID_ATTR_GROUP_CODE’. The SQL statement executed was: INSERT INTO `ys4_eav_attribute_group` (`attribute_set_id`, `sort_order`, `default_id`, `attribute_group_name`, `attribute_group_code`, `tab_group_code`) VALUES (:yp0, :yp1, :yp2, :yp3, :yp4, :yp5)
2018/04/04 12:11:51 [info] [ub_data_migration] Resetting data migration in the step #3…
2018/04/04 12:11:51 [info] [ub_data_migration] Step #3 was reset successfully
2018/04/04 12:15:48 [info] [ub_data_migration] Start running step #3
2018/04/04 12:15:48 [info] [ub_data_migration] [Processing] Step #3 migration completed with 17 Attribute Sets
2018/04/04 12:15:49 [error] [ub_data_migration] CDbCommand failed to execute the SQL statement: SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry ‘402-product-details’ for key ‘YS4_CAT_CTGR_PRD_ATTR_SET_ID_ATTR_GROUP_CODE’. The SQL statement executed was: INSERT INTO `ys4_eav_attribute_group` (`attribute_set_id`, `sort_order`, `default_id`, `attribute_group_name`, `attribute_group_code`, `tab_group_code`) VALUES (:yp0, :yp1, :yp2, :yp3, :yp4, :yp5)
2018/04/04 12:15:56 [info] [ub_data_migration] Resetting data migration in the step #3…
2018/04/04 12:15:56 [info] [ub_data_migration] Step #3 was reset successfully
2018/04/04 12:27:49 [info] [ub_data_migration] Start running step #3
2018/04/04 12:27:49 [info] [ub_data_migration] [Processing] Step #3 migration completed with 17 Attribute Sets
2018/04/04 12:27:49 [error] [ub_data_migration] CDbCommand failed to execute the SQL statement: SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry ‘419-product-details’ for key ‘YS4_CAT_CTGR_PRD_ATTR_SET_ID_ATTR_GROUP_CODE’. The SQL statement executed was: INSERT INTO `ys4_eav_attribute_group` (`attribute_set_id`, `sort_order`, `default_id`, `attribute_group_name`, `attribute_group_code`, `tab_group_code`) VALUES (:yp0, :yp1, :yp2, :yp3, :yp4, :yp5)
2018/04/04 12:28:46 [info] [ub_data_migration] Resetting data migration in the step #3…
2018/04/04 12:28:46 [info] [ub_data_migration] Step #3 was reset successfully
 

11 answers

Profile photo of Mall Staff 184060.00 $tone April 5, 2018
Public

Hi there,

2018/04/04 11:57:41 [error] [ub_data_migration] CDbCommand failed to execute the SQL statement: SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry ‘300-product-details’ for key ‘YS4_CAT_CTGR_PRD_ATTR_SET_ID_ATTR_GROUP_CODE’. The SQL statement executed was: INSERT INTO `ys4_eav_attribute_group` (`attribute_set_id`, `sort_order`, `default_id`, `attribute_group_name`, `attribute_group_code`, `tab_group_code`) VALUES (:yp0, :yp1, :yp2, :yp3, :yp4, :yp5)

That issue because your data has special settings on Attribute Group Names on at least one product Attribute Set. Kindly provide me information about your instance as followings:
+ Admin credentials and back-end url
+ SSH credentials and web root path to your Magento2 folder
I will help to check further and help you out.
Regards,
Mall.

#1
Profile photo of Mall Staff 184060.00 $tone April 5, 2018
Public

Hi there,
After checked in your instance, I saw the root issue related to specials case on attribute group names of attribute sets. To handle for that case, you could do steps as followings:
Step 1: Open the php file at path: pub/ub-tool/protected/controllers/Step3Controller.php
and find to the code line:

$attributeGroupCode2 = (preg_match("/(general)/i", $attributeGroupCode2)) ? 'product-details' : $attributeGroupCode2;

and replace by code line:

//$attributeGroupCode2 = (preg_match("/(general)/i", $attributeGroupCode2)) ? 'product-details' : $attributeGroupCode2;

Step 2: Reset and restart data migration in the step #3
And tell me know how it goes.
Regards,
Mall.
 

#3
Profile photo of refueledinc 310.00 $tone April 5, 2018
Public

Yes, That seems to have resolved the issue with step 3, but now when I go to step 4 I get a new error:
2018/04/05 05:51:14 [error] [ub_data_migration] CDbCommand failed to execute the SQL statement: SQLSTATE[22007]: Invalid datetime format: 1292 Incorrect datetime value: ‘0000-00-00 00:00:00’ for column ‘updated_at’ at row 1. The SQL statement executed was: INSERT INTO `ys4_catalog_category_entity` (`attribute_set_id`, `parent_id`, `level`, `created_at`, `updated_at`, `path`, `position`, `children_count`) VALUES (:yp0, :yp1, :yp2, :yp3, :yp4, :yp5, :yp6, :yp7)

#4
Profile photo of Mall Staff 184060.00 $tone April 5, 2018
Public

Hi there

 Invalid datetime format: 1292 Incorrect datetime value: ‘0000-00-00 00:00:00’ for column ‘updated_at’ at row 1. The SQL statement executed was: INSERT INTO `ys4_catalog_category_entity

That issue because your database has at least one record which has bad data in the value of field catalog_category_entity.updated_at
To solve that issue, you could run below SQL statement in your Magento1’s database:

UPDATE `ys4_catalog_category_entity` SET `updated_at` = NULL WHERE `updated_at` = '0000-00-00 00:00:00' OR `updated_at` = '';

Once done, you could continue with data migration in the step #4 of our tool.
Regards,
Mall.

#5
Profile photo of refueledinc 310.00 $tone April 5, 2018
Public

I got to the import products step but we have many products and it was very slow to import so I enabled the memcache option but now I get an error: 

CMemCache requires PHP memcache extension to be loaded.

I already have memcached running on the server after following this updated guide for ubuntu 16.04 

https://www.digitalocean.com/community/tutorials/how-to-install-and-secure-memcached-on-ubuntu-16-04
Any idea why it’s saying PHP extension is not loaded?

#6
Profile photo of Mall Staff 184060.00 $tone April 6, 2018
Public

Hi there,

CMemCache requires PHP memcache extension to be loaded.

That is a issue with PHP memcache in PHP7.

I already have memcached running on the server after following this updated guide for ubuntu 16.04 

Please note that, our tool required PHP memcache extension. It isn’t PHP memcached
And there isn’t stable PHP memcache extension for PHP7 at this time. If you want to use memcache on PHP7, you must install the PHP memcache version 3.0.9-dev like as in this screenshots: https://prnt.sc/j1je3s
If you couldn’t install that version, please continue with cache file option.
Regards,
Mall.
 

#7
Profile photo of Mall Staff 184060.00 $tone April 6, 2018
Public

Hi there,

Do you have a link of where I can get that package? I can only seem to find v3.0.8

Please try download it at this link.
Regards,
Mall.

#9
Profile photo of refueledinc 310.00 $tone April 9, 2018
Public

Are you sure it’s not possible to use memcacheD with your extension with php7? 
 
In the error comments it says this:

**
105      * @throws CException if extension isn't loaded
106      * @return Memcache|Memcached the memcache instance (or memcached if {@link useMemcached} is true) used by this component.
107      */
#10
Profile photo of Mall Staff 184060.00 $tone April 9, 2018
Public

Hi there,

Are you sure it’s not possible to use memcacheD with your extension with php7? 

 
Yes, I’m sure. If you couldn’t install the PHP memcache as required, you should continue using cache files option though.
Regards,
Mall.

#11

Please login or Register to Submit Answer

Written By

Comments