Error "'Row x skipped for data class '<data class name>'. Data class foreign key lookup on column '<column name>' failed." occurs when using a Data Connector import rule that has a foreign key data class mapping
Last Updated December 30, 2011
When using a Data Connector import rule that has a foreign key data class mapping, the error "Row x skipped for data class '<data class name>'. Data class foreign key lookup on column '<column name>' failed." will occur. This can also appear as "The import rule '<import rule name>' failed. Error: 'name' argument cannot be null. Parameter name: name."
Two similar errors may occur:
"Row x skipped for data class '<data class name>'. Data class foreign key lookup on column '<column name>' failed."
"The import rule '<import rule name>' failed. Error: 'name' argument cannot be null. Parameter name: name."
There are multiple causes for this:
Multiple resources allready in the CMDB with an empty string for the name and the datasource being used having an emptry string for a Foriegn key resource.This will cause more rows to be returned than expected during the process.
Multiple resources with the same name, for example John Smith, in the CMDB and the Foreign key using that name. This will cause multiple rows to be returned again causing the error.
When an SQL datasource is being used and the value returned for a Foreign key = NULL.
There are multiple solutions and workarounds that can be implemented.
Apply the attached files to the Symantec Management Platform server and it's database.
Copy the "DataConnector2.config" file to the Symantec Management Platform server
Apply the "DataConnector2.config" file by running the following from a Command Prompt: C:\Program Files\Altiris\Notification Server\Bin\AeXConfig.exe /configure "C:\Program Files\Altiris\DataConnector\Config\DataConnector2.config" Note: If the Symantec Management Platform Server is not installed onto the C: drive, substitute the correct drive letter in the above command.
Copy the "Missing Stored Procs.sql" file to the database server or to where it can be ran against it.
Open SQL Server Management Studio.
Open and run the "Missing Stored Procs.sql" SQL query.
This is not a product defect but a side effect of having multiple resources with the same name:
In the datasource make sure the guid of the resource being used in the foreign key exists and use that in place of the name
If the guid is not available then the data will need to be cleaned up. Meaning if the problem is a department and two departments exist with the name 'Accounting' one of them would need to be deleted. It could be exported, deleted then imported again after the connector import has run.
A product defect has been raised for this issue and will be resolved in a future release. Until that time the datasource will need to be modified so that NULL values are not returned for anything that has a Foreign key reference. The SQL statement ISNULL would be the most likely candidate to do this, replacing the null with ''