Cannot insert duplicate key row in object 'dbo.umbracoNode' with unique index 'IX_umbracoNodeUniqueID'
After performing a USync import to update some content we are getting the following error when trying to courier a PDF file in our media section:
Server was unable to process request. --->
Error extracting item, ID: 2eba4892-59ff-4b71-b630-1b73c3e061aa_d8e6ad84-e73a-11df-9492-0800200c9a66,
Name: PDF, Type: Umbraco.Courier.ItemProviders.DocumentType ---> could not insert:
[Umbraco.Courier.Persistence.V6.NHibernate.EntityClasses.UmbracoNode
[SQL: INSERT INTO umbracoNode (createDate, level, nodeObjectType, path, sortOrder, text, trashed, uniqueID, nodeUser, parentID) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?); select SCOPE_IDENTITY()]
---> Cannot insert duplicate key row in object 'dbo.umbracoNode' with unique index 'IX_umbracoNodeUniqueID'. The duplicate key value is (2eba4892-59ff-4b71-b630-1b73c3e061aa).
The 2eba4892-59ff-4b71-b630-1b73c3e061aa is the uniqueID for the PDF in the umbracoNode table and I have cross reference the databases that courier is deploying from and to and this record is identical.
Both on uSync and Courier nodes are matched over uniqueId values in umbracoNode table. So whenever you try to transfer/import something, it checks if there is a match or any conflicts. Mostly occurs on if both recipient and receiver ends of courier has content changes. You can think about this as a merge conflict in git.
In years we did following;
Dirty way 1: Content change; remove pdf node and recreate it, it will get a new uniqueId.
Dirty way 2: uSync change; create a new item for conflicting uniqueId, in this case a doc type, data type or dictionary item. Depending on how in depth you are using usync. In this way you will need to move any item using that type to new one; imho quite nasty.
Cleanish Way: Synchronize environments, move db from one to another and use usync. Then apply content changes and use Courier. Quite risky to loose content.
Hacky Way: Update conflicting uniquId properly in db, refresh uSync data and move on.
Hope these help, but imho quite a bad thing to face .
Thanks Mehmet, I forgot to add this screenshot last time
If I untick the Document types > PDF then I can courier. Upon looking at the record with a uniqueID of 2EBA4892-59FF-4B71-B630-1B73C3E061AA this is not a document type but is the media type of PDF, hence my confusion.
Looking at your suggestions:
Dirty way 1: My Media type > PDF media type inherits the properties from media type > File with an additional thumbnail property. I have over 1000 PDF files uploaded where the thumbnail is essentially a second media type > File. If remove the PDF node and readd it will all the PDF and the related thumbnail mapping be retained? Also would I need to courier all PDF file again
Dirty way 2: Not sure I quite understand this one, apart from the last bit where moving any item (over 1000 PDF) to the new one sounds complex and time consuming
Cleanish Way: We have taken our a copy of our prod db and overwritten our non-prod to ensure synronisation in the past - so if all else fails this will be the method I will use.
Hacky Way: This option is most appealing but I am not sure what I am looking for in the databases as the record for 2EBA4892-59FF-4B71-B630-1B73C3E061AA are identical in both
I believe you already know this from previous post but I wanted to drop a reminder on it. Since you had this issue on live environment, when you copied over you will carry it back to non-prod. You will also need to export all and overwrite usync data.
Cannot insert duplicate key row in object 'dbo.umbracoNode' with unique index 'IX_umbracoNodeUniqueID'
After performing a USync import to update some content we are getting the following error when trying to courier a PDF file in our media section:
The 2eba4892-59ff-4b71-b630-1b73c3e061aa is the uniqueID for the PDF in the umbracoNode table and I have cross reference the databases that courier is deploying from and to and this record is identical.
Does anybody know how to resolve this issue?
Many thanks in advance
Hi,
Both on uSync and Courier nodes are matched over uniqueId values in umbracoNode table. So whenever you try to transfer/import something, it checks if there is a match or any conflicts. Mostly occurs on if both recipient and receiver ends of courier has content changes. You can think about this as a merge conflict in git.
In years we did following;
Hope these help, but imho quite a bad thing to face .
-Best,
Mehmet
Thanks Mehmet, I forgot to add this screenshot last time
If I untick the Document types > PDF then I can courier. Upon looking at the record with a uniqueID of 2EBA4892-59FF-4B71-B630-1B73C3E061AA this is not a document type but is the media type of PDF, hence my confusion.
Looking at your suggestions:
Dirty way 1: My Media type > PDF media type inherits the properties from media type > File with an additional thumbnail property. I have over 1000 PDF files uploaded where the thumbnail is essentially a second media type > File. If remove the PDF node and readd it will all the PDF and the related thumbnail mapping be retained? Also would I need to courier all PDF file again
Dirty way 2: Not sure I quite understand this one, apart from the last bit where moving any item (over 1000 PDF) to the new one sounds complex and time consuming
Cleanish Way: We have taken our a copy of our prod db and overwritten our non-prod to ensure synronisation in the past - so if all else fails this will be the method I will use.
Hacky Way: This option is most appealing but I am not sure what I am looking for in the databases as the record for 2EBA4892-59FF-4B71-B630-1B73C3E061AA are identical in both
Many thanks
Hi David,
Well, I believe faster way you would be to follow up cleanish one here. Then you can take an usync export which will carry you on just fine.
-Best
Hi Mehmet, We are planning to overwrite the non-prod with prod DB soon. Will let you know if that works. Kind Regards David
Hi David,
I believe you already know this from previous post but I wanted to drop a reminder on it. Since you had this issue on live environment, when you copied over you will carry it back to non-prod. You will also need to export all and overwrite usync data.
Good luck!
Hi Mehmet, Yes plan to do this on prod and then copy uSync folder and DB back to non-prod. Cheers for the reminder Kind Regards David
That worked, thanks for your help
is working on a reply...