[bug] Users CSV Import Error #17451
Description
I am using release 6.5
While importing Users.csv file to create/merge users, I get administrator error
while checking system.log file, I noticed error, given in bold. SQL query checking data in crmentity table does not have users table values and returns null, hence throw error.
2024-05-05 08:34:35.8816 [info][[yii\db\Command::query]] - SHOW FULL COLUMNS FROM vtiger_import_queue
2024-05-05 08:34:35.8845 [info][[yii\db\Command::query]] - SELECT
kcu
.CONSTRAINT_NAME
AS constraint_name
,
kcu
.COLUMN_NAME
AS column_name
,
kcu
.REFERENCED_TABLE_NAME
AS referenced_table_name
,
kcu
.REFERENCED_COLUMN_NAME
AS referenced_column_name
FROM information_schema
.REFERENTIAL_CONSTRAINTS
AS rc
JOIN information_schema
.KEY_COLUMN_USAGE
AS kcu
ON
(
kcu
.CONSTRAINT_CATALOG
= rc
.CONSTRAINT_CATALOG
OR
(kcu
.CONSTRAINT_CATALOG
IS NULL AND rc
.CONSTRAINT_CATALOG
IS NULL)
) AND
kcu
.CONSTRAINT_SCHEMA
= rc
.CONSTRAINT_SCHEMA
AND
kcu
.CONSTRAINT_NAME
= rc
.CONSTRAINT_NAME
WHERE rc
.CONSTRAINT_SCHEMA
= database() AND kcu
.TABLE_SCHEMA
= database()
AND rc
.TABLE_NAME
= 'vtiger_import_queue' AND kcu
.TABLE_NAME
= 'vtiger_import_queue'
2024-05-05 08:34:35.8874 [info][[yii\db\Command::execute]] - INSERT INTO vtiger_import_queue
(userid
, tabid
, field_mapping
, default_values
, merge_type
, merge_fields
, temp_status
) VALUES (1, 29, '{"user_name":0,"is_admin":1,"first_name":2,"last_name":3,"roleid":4,"status":5,"user_password":6,"confirm_password":7,"super_user":8,"email1":9,"secondary_email":10,"primary_phone":11,"emailoptout":12,"date_format":13,"hour_format":14,"time_zone":15,"dayoftheweek":16,"activity_view":17,"defaultactivitytype":18,"defaulteventstatus":19,"view_date_format":20,"reminder_interval":21,"othereventduration":22,"calendar_all_users_by_default":23,"currency_id":24,"currency_decimal_separator":25,"currency_symbol_placement":26,"truncate_trailing_zeros":27,"currency_grouping_pattern":28,"currency_grouping_separator":29,"no_of_currency_decimals":30,"start_hour":31,"end_hour":32,"language":33,"rowheight":34,"leftpanelhide":35,"default_record_view":36,"theme":37,"login_method":38,"force_password_change":39,"internal_mailer":40,"sync_carddav":41,"sync_caldav":42,"default_search_override":43,"default_search_operator":44,"available":45,"auto_assign":46,"records_limit":47,"reports_to_id":48,"is_owner":49}', '[]', 3, '["user_name"]', 0)
2024-05-05 08:34:35.8887 [info][[yii\db\Command::query]] - SELECT * FROM vtiger_import_queue
WHERE (tabid
=29) AND (userid
=1) LIMIT 1
2024-05-05 08:34:35.8893 [info][[yii\db\Command::query]] - SELECT * FROM vtiger_import_locks
WHERE tabid
=29 LIMIT 1
2024-05-05 08:34:35.8895 [info][[yii\db\Command::query]] - SHOW FULL COLUMNS FROM vtiger_import_locks
2024-05-05 08:34:35.8904 [info][[yii\db\Command::query]] - SELECT
kcu
.CONSTRAINT_NAME
AS constraint_name
,
kcu
.COLUMN_NAME
AS column_name
,
kcu
.REFERENCED_TABLE_NAME
AS referenced_table_name
,
kcu
.REFERENCED_COLUMN_NAME
AS referenced_column_name
FROM information_schema
.REFERENTIAL_CONSTRAINTS
AS rc
JOIN information_schema
.KEY_COLUMN_USAGE
AS kcu
ON
(
kcu
.CONSTRAINT_CATALOG
= rc
.CONSTRAINT_CATALOG
OR
(kcu
.CONSTRAINT_CATALOG
IS NULL AND rc
.CONSTRAINT_CATALOG
IS NULL)
) AND
kcu
.CONSTRAINT_SCHEMA
= rc
.CONSTRAINT_SCHEMA
AND
kcu
.CONSTRAINT_NAME
= rc
.CONSTRAINT_NAME
WHERE rc
.CONSTRAINT_SCHEMA
= database() AND kcu
.TABLE_SCHEMA
= database()
AND rc
.TABLE_NAME
= 'vtiger_import_locks' AND kcu
.TABLE_NAME
= 'vtiger_import_locks'
2024-05-05 08:34:35.8926 [info][[yii\db\Command::execute]] - INSERT INTO vtiger_import_locks
(userid
, tabid
, importid
, locked_since
) VALUES (1, 29, 12, '2024-05-05 08:34:35')
2024-05-05 08:34:35.8934 [info][[yii\db\Command::query]] - SELECT * FROM u_yf_import_1
WHERE temp_status
=0 LIMIT 250
2024-05-05 08:34:35.8942 [trace][] - Entering getColumnFields(Users) method ...
2024-05-05 08:34:35.8943 [info][[yii\db\Command::query]] - SELECT * FROM vtiger_field
LEFT JOIN s_yf_fields_anonymization
ON vtiger_field.fieldid = s_yf_fields_anonymization.field_id WHERE tabid
=29
2024-05-05 08:34:35.895 [trace][] - Exiting getColumnFields method ...
2024-05-05 08:34:35.8951 [trace][] - Entering to operatorE in App\Conditions\QueryFields\BaseField
2024-05-05 08:34:35.8953 [info][[yii\db\Command::query]] - SELECT vtiger_users
.id
AS id
FROM vtiger_users
WHERE vtiger_users
.user_name
='amarendra.jaltare' LIMIT 1
2024-05-05 08:34:35.9006 [info][[yii\db\Command::query]] - SELECT crmid
, setype
, deleted
, smcreatorid
, smownerid
, createdtime
, private
FROM vtiger_crmentity
WHERE crmid
=9
2024-05-05 08:34:35.9011 [error][] - App\Cache::staticHas(): Argument #2 ($key) must be of type string, null given, called in /www/wwwroot/default/crm/yf/modules/Vtiger/models/Module.php on line 202
TypeError: App\Cache::staticHas(): Argument #2 ($key) must be of type string, null given, called in /www/wwwroot/default/crm/yf/modules/Vtiger/models/Module.php on line 202 and defined in /www/wwwroot/default/crm/yf/app/Cache.php:141
Stack trace:
#0 /www/wwwroot/default/crm/yf/modules/Vtiger/models/Module.php(202): App\Cache::staticHas()
#1 /www/wwwroot/default/crm/yf/modules/Vtiger/models/Record.php(772): Vtiger_Module_Model::getInstance()
#2 /www/wwwroot/default/crm/yf/modules/Import/actions/Data.php(305): Vtiger_Record_Model::getInstanceById()
#3 /www/wwwroot/default/crm/yf/modules/Import/actions/Data.php(159): Import_Data_Action->importRecords()
#4 /www/wwwroot/default/crm/yf/modules/Import/views/Main.php(81): Import_Data_Action->importData()
#5 /www/wwwroot/default/crm/yf/modules/Import/views/Main.php(61): Import_Main_View->triggerImport()
#6 /www/wwwroot/default/crm/yf/modules/Vtiger/views/Import.php(192): Import_Main_View::import()
#7 /www/wwwroot/default/crm/yf/app/Controller/ExposeMethod.php(68): Vtiger_Import_View->import()
#8 /www/wwwroot/default/crm/yf/modules/Vtiger/views/Import.php(72): Vtiger_Import_View->invokeExposedMethod()
#9 /www/wwwroot/default/crm/yf/include/main/WebUI.php(188): Vtiger_Import_View->process()
#10 /www/wwwroot/default/crm/yf/index.php(26): Vtiger_WebUI->process()
#11 {main}
When I tried to run below SQL query in crmentity table, not record found
SELECT crmid
, setype
, deleted
, smcreatorid
, smownerid
, createdtime
, private
FROM vtiger_crmentity
WHERE crmid
=9
further checking 9 is the id of the existing user already in the system returned by below query.
SELECT vtiger_users
.id
AS id
FROM vtiger_users
WHERE vtiger_users
.user_name
='amarendra.jaltare' LIMIT 1
Can not test on https://gitdeveloper.yetiforce.com as file size 0 error shows, probably not allowed to import data.
Please assist how to solve.
Jeevan Pendhari