This article will cover an error that occurs for some customers when importing eCommerce catalog into the EPI commerce system. The complete error message would like the following below.
System.Data.SqlClient.SqlException (0x80131904): Violation of PRIMARY KEY constraint 'PK_MetaMultiValueDictionary'. Cannot insert duplicate key in object 'dbo.MetaMultiValueDictionary'. The duplicate key value is (2999, 756).
The statement has been terminated.
This issue has appeared when customers have used the InRiver connector to create an XML package for import into the EPI Commerce platform.
The catalog.xml file contains the information from the export generated by the inRiver.
If you look into the import file you will see countless empty
<dictionary></dictionary> tags that would cause an issue. The noted resolution steps for this are:
- Restore the eCommerce database.
- Edit the catalog file and remove all empty dictionary tags. This is the critical part.
- Retry the import.
- Contact inRiver for follow up on issue as they generated the XML and not EPI export / import function.
The other method that has been revealed is to go into the InRiver endpoint, clear the metafields and to prevent inRiver from generating the empty dictionary entries which cause the issue in the first place.