Monday, May 31, 2021

Sitecore 10 -SCS -An exception occurred while processing the request. ---> Sitecore.Exceptions.DuplicateItemNameException

 This is a very common issue while working on the Sitecore content serialization, 


sitecore ser validate --fix command didn't resolve the issue, so what's next?

We have to remove that item manually, You can see item name in the error message, As example below

[master] Applying changes...

GraphQL.ExecutionError: An exception occurred while processing the request. ---> Sitecore.Exceptions.DuplicateItemNameException: 

The item name "Your Item Name" is already defined on this level.

   at Sitecore.Data.Items.ItemUtil.AssertDuplicateItemName(Item destinationItem, Item sourceItem, String name)

   at Sitecore.Data.Items.ItemUtil.AssertItemName(Item destinationItem, Item sourceItem, String name)

   at Sitecore.Data.Items.Item.set_Name(String value)

   at Sitecore.Services.GraphQL.Serialization.Mutations.SerializationCommands.RenameItemCommand.Execute(SerializationCommandData command, String dataModel)

   at Sitecore.Services.GraphQL.Serialization.Mutations.SerializationCommands.CommandExtensions.TryExecute(IEnumerable`1 commands, IList`1& results)

   at Sitecore.Services.GraphQL.Serialization.Mutations.ExecuteSerializationCommandsMutation.Resolve(ResolveFieldContext context)

   --- End of inner exception stack trace ---

GraphQL.ExecutionError: Cannot return null for non-null type. Field: name, Type: String!.

   at GraphQL.Execution.ExecutionStrategy.ValidateNodeResult(ExecutionContext context, ExecutionNode node)

   at GraphQL.Execution.ExecutionStrategy.<ExecuteNodeAsync>d__7.MoveNext()


Note - Try to remove just first parent node of the content and push the serialization again, that has resolve my issue.

No comments:

Post a Comment