Recently i had to deal with a duplicate key error which was caused by a email activity inside a journey that somehow made me question a whole approach i have set up for templates and email across a whole business unit.
Email Triggered Send Job Error An error occurred when attempting to evaluate a ContentBlockByKey function call. Function Call: ContentBlockByKey("SERVICE_BLOCK_2021") See inner exception for details.
More Detailled error from Support:
"Cannot insert duplicate key row in object 'dbo.JobContentBlock' with unique index 'IX_JobContentBlock_JobID_ListID_CustomerKey_u'. The duplicate key value is (1029680, 358, SERVICE_BLOCK_2021)."
We have dynamic ContentBlocks or AMPScriptBlocks that output content. I do not put these blocks directly into the template. I am using ContentBlockByKey("KeyName") to reference these ContentBlocks (in this example SERVICE_BLOCK_2021). When i have to change these ContentBlocks i usually try to edit them in one go. Unfortunately sometimes this is not possible because the new block has a different layout or something similar (original content block not raw html). That's when i create a new content block and swap the KeyNames of the existing and the new block as fast as possible. And that's when this error occured.
Do you guys have more details about dbo.JobContentBlock and the snapshotting of journeys? Do you have a suggestion what i can do better?
This is a topic where you rarely find details. Sometimes its not even clear if snapshotting is done on a journey level or on a job / activity level.