Dynamics CRM 2015: Invalid Argument error encountered while merging records

This morning one of my customers ran into this error while merging two Accounts:

clip_image001

Not very descriptive and since the normal Download Log File button was disabled, also not a lot of help.

I turned on platform tracing and repeated the merge process so that I could hopefully capture the real error.  Here is what showed up (in order of appearance):

Web Service Plug-in failed in SdkMessageProcessingStepId: {27CBBB1B-EA3E-DB11-86A7-000A3A5473E8}; EntityName: none; Stage: 30; MessageName: InitializeFrom; AssemblyName: Microsoft.Crm.Extensibility.InternalOperationPlugin, Microsoft.Crm.ObjectModel, Version=7.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35; ClassName: Microsoft.Crm.Extensibility.InternalOperationPlugin;


MessageProcessor fail to process message ‘InitializeFrom’ for ‘none’.


Error: There is no entity map defined for the given entities
Error Number: 0x80040E01
Error Message: There is no entity map defined for the given entities
Error Details: There is no entity map defined for the given entities
Source File: Not available
Line Number: Not available
Request URL:
Stack Trace Info: [CrmException: There is no entity map defined for the given entities]
   at Microsoft.Crm.Application.Platform.ServiceCommands.PlatformCommand.XrmExecuteInternal()
   at Microsoft.Crm.Application.Platform.ServiceCommands.InitializeFromCommand.Execute()


Error: The role is invalid for this entity combination.
Error Number: 0x80040203
Error Message: The role is invalid for this entity combination.
Error Details: The role is invalid for this entity combination.
Source File: Not available
Line Number: Not available


It was, of course, the final exception that was the key.

It turns out that both Account had Relationship Roles associated with them and I am assuming that the two sets of roles were incompatible with each other.

I removed the roles from the second Account and the merge was correctly performed.