Common Sitecore DEF Mistakes

So in this short post, I’ll cover a few common mistakes that you might make when starting out configuring your DEF project, I know I certainly did and a fellow colleague hit the same issues on a recent project he just started. Hopefully, it will prevent you from falling into the same trap and banging your head against the wall.

Error An Item with the same key has already been added.

Symptoms: You see the following error is logged when you run your pipeline batch and you have a Resolve Sitecore Item Pipeline Step. You will probably see something like this in your Sitecore logs:

[Date/Time] ERROR An item with the same key has already been added.

[Date/Time] ERROR Pipeline step processing will abort because a critical error occurred during processing.

Possible Cause: You see this occur during the Resolve Sitecore Item pipeline step processor. It usually means you have duplicate field name on the item you are trying to create in Sitecore. Check the template of the Sitecore item you are attempting to create including any inherited templates and resolve any duplicate fields names.

Item is created in Sitecore but the fields are not populated.

Symptoms: You have a pipeline batch with pipeline steps that read data from a source, iterates the items and create an item in Sitecore. The Item is created with the correct identifier, however, the fields on the Sitecore item are not populated.

Possible Cause: Most likely this is an issue with Data Location field has been set incorrectly on a pipeline step. Go through each step and check the location value.

Error: Pipeline step processing will abort because the pipeline context has no target assigned

Symptoms: You have a Resolve Sitecore Item Pipeline step followed by an Apply Mapping Pipeline step. Your new Item gets created however, all the fields are null. You see something similar to the following in the logs (Debug mode):

[Date/Time] DEBUG Value converted for search. (pipeline: Handle Single Row Pipeline, pipeline step: Resolve Sitecore Item Pipeline Step, field: UniqueId, original value: XXX-XXXX-XXXXX, converted value: XXX-XXXX-XXXXX)
[Date/Time] DEBUG Starting search for item. (pipeline: Handle Single Row Pipeline, pipeline step: Resolve Sitecore Item Pipeline Step, field: UniqueId, value: XXX-XXXX-XXXXX)
[Date/Time] DEBUG Item was not resolved. Will create it. (pipeline: Handle Single Row Pipeline, pipeline step: Resolve Sitecore Item Pipeline Step, identifier: XXX-XXXX-XXXXX)
2/27/2019 9:52:34 PM DEBUG New item was created. (pipeline: Handle Single Row Pipeline, pipeline step: Resolve Sitecore Item Pipeline Step, identifier: XXX-XXXX-XXXXX)
[Date/Time] ERROR Pipeline step processing will abort because the pipeline context has no target assigned. (pipeline: Handle Single Row Pipeline, pipeline step: Apply Mapping Pipeline Step, plugin: Sitecore.DataExchange.Plugins.SynchronizationSettings, property: Target)
[Date/Time] DEBUG Pipeline processor finished processing pipeline steps. (pipeline: Handle Single Row Pipeline, completed pipeline steps: 3)

Possible Cause:  Check the Resolve Sitecore Item Pipeline Step and look the Object Resolution section ensure the Resolved Object Location is set: Pipeline Context Target and not Pipeline Context Source. If that is set correctly then you might want to check you the Converter and Processor Types correctly:

DefTypes

If you are using a custom Processor & Converter ensure you have set the SupportIds attribute on your Converter class so that it matches your custom template.

Hope this helps!

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s