SaaS CMS has officially launched! Learn more now.

Service API bulk import: Issue with duplicate node entry relations



We have quite a few issues with bulk import of catalog content and node entry relations. We get exceptions like these:

Violation of PRIMARY KEY constraint 'PK_NodeEntryRelation'. Cannot insert duplicate key in object 'dbo.NodeEntryRelation'. The duplicate key value is (19, 62413, 1091).

This seems to be happening even if we clear the relations before import, so the question is: Is this related to cache invalidation issues?

How can we work around this issue?

Ping Quan Mai. :)

Jun 01, 2022 12:58

Ha, thought I heard something.

Could you please reach out to support service? we need to look into the import file to see if there is anything interesting there. it could be some edge cases and sounds like it might have something to do with COM-14908 (not yet public), but that's with entry associations. 

Jun 02, 2022 15:26

Did also reach out to support and have shared the import file which appears to look good. They are referring to COM-14420 which is fixed in 13.32.1, but we are running 13.32.2.

Jun 07, 2022 6:55

Was there a resolution to this.   We also are seeing the same issue and are running 13.32.3

Jun 28, 2022 17:26

@Mattias - do you have a ticket number. I can ask one of my guys to look into it 

Jul 05, 2022 8:38

@Quan Mai: Ticket number is 918496. It's marked as "Solved" now but that's because we haven't had time to follow up yet. The last thing I read in the ticket was this:

"After exporting the catalog, I realized that the element NodeEntryRelations always show on top of EntryRelations
So I change it accordingly in your XML file, it could be imported successfully then."

Does the sort order matter? :)

We implemented a "sort of" workaround that deletes all relations prior to import. But we don't want to do that in the long run so please look into it if you have the chance.

Jul 05, 2022 11:23

Looking for a resolution as well.  We are on 13.32.3.  This is breaking our PIM integration.  Any new files from the PIM that have NodeEntryRelations, and already have the NodeEntryRelation in the DB, throw the following error. Violation of PRIMARY KEY constraint 'PK_NodeEntryRelation'. Cannot insert duplicate key in object 'dbo.NodeEntryRelation'. The duplicate key value is...

I tried upgrading to 13.32.4, and it is still broken in that build. 

We aren’t running this through the service API, it is going through the Mediachase.Commerce.Catalog.ImportExport.CatalogImportExport.  

Edited, Jul 19, 2022 13:23

@Mattias: your bug has been looked into. A bugfix is now under review for the 13.x 

Jul 23, 2022 8:51
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.