A managed solution cannot overwrite the AttributeMap component with Id=[guid] which has an unmanaged base instance

Facing this message?

A managed solution cannot overwrite the AttributeMap component with Id=b648bf03-102f-e611-80d3-e1543fac8121 which has an unmanaged base instance. The most likely scenario for this error is that an unmanaged solution has installed a new unmanaged AttributeMap component on the target system, and now a managed solution from the same publisher is trying to install that same AttributeMap component as managed. This will cause an invalid layering of solutions on the target system and is not allowed.

Then you can quickly find the problematic mapping using the following query:

select SourceEntityName, SourceAttributeName, TargetEntityName, TargetAttributeName from AttributeMap am
left outer join entitymap em on em.entitymapid = am.EntityMapId
where am.AttributeMapId='b648bf03-102f-e611-80d3-e1543fac8121'

Just remove the mapping from the target system and reimport the solution and you're ready to go.

Should be exactly 1 MessageProcessingStep registered for workflow

Having duplicate processes (usually business rules) can cause issues during import of a solution containing the same process. One of the error messages is:

Should be exactly 1 MessageProcessingStep registered for workflow

If you face this situation, then it's easiest to identify the duplicate processes by using the advanced find. Search for the processes and remove the default filter. Then add "Category equals Business Rule" and view the results ordered by name. If you see any duplicate, then you can remove the oldest Business Rule(s).

If you've got too many processes to visually identify the duplicates, then you can always export to Excel and use the duplicate features there.

In some cases the duplicates exist due to the holding solution approach. In this case, removing the Business Rules will eventually give you other error messages such as:

- Crm Exception: Message: processtrigger With Id = 3922b595-8637-e511-80d3-b13ac3e6ed07 Does Not Exist, ErrorCode: -2147220969
- 0x80040203 Could not retrieve parent object id for label with id 1f26a158-cf40-e511-80d6-f0b8a7508109 and label type code 19
- Cannot find a top solution for ProcessTrigger:3922b595-8637-e511-80d3-b13ac3e6ed07

If this is the case, then the next post will help:

Generic errors while importing solution in Dynamics CRM 2016

While importing an update for a solution or a new solution that is building on top of another solution, then you might face generic error messages. This blog post provides a possible solution for the scenario when the CRM solution import dialog mentions a "Generic SQL error" while downloading the log file serves you the message "0x80044150: Object reference not set to an instance of an object.".

I have found that for some reason it is possible that the Description attribute of an entity is not included in the customizations file when exporting from Dynamics CRM 2015. If this is the case, then the system will crash during import when it tries to determined if the LabelDescriptionHasChanged.

You can confirm that this is the issue by running the following SQL script:
SELECT objectcolumnname, s.FriendlyName 'Solution FriendlyName', label, objectid, LanguageId
FROM [LocalizedLabelAsIfPublishedView] l
LEFT OUTER JOIN solution s ON l.solutionid = s.solutionid
LEFT OUTER JOIN entity e ON l.ObjectId = e.EntityId
WHERE e.name = 'new_entity'

Of course you'll need to change the new_entity to the schemaname of your entity. If this query results only the LocalizedName and LocalizedCollectionName but no "Description", then this is could very well be the cause of the error messages. Another way to confirm is to check the customizations file, search for the entity and determine if the tag <Descriptions> is present.

The way to solve this is quite easy. In your source system, go to the correct entity, add a description and export the solution again. You will need to remove the previous solution from the target environment though.

Workflow With Id = fe31a1bb-949e-e511-80c3-0050569c18ec Does Not Exist

Similar to some of my previous blog articles, there can be some leftovers which limit you in removing a solution from your organization. This article helps you in determining the cause of the error when you face the following error.

ErrorCode: -2147220969
Message: Workflow With Id = fe31a1bb-949e-e511-80c3-0050569c18ec Does Not Exist.

Most likely there is a process, not necessarily a workflow, which hasn't been removed completely. The following query will help you identify which process is causing the error:

select label from LocalizedLabel where objectid = 'fe31a1bb-949e-e511-80c3-0050569c18ec'

Obviously you'll need to replace the objected with the guid from the error message.

Once you have found the culprit, then you can try to remove the process by using the CRM UI:

- Go to advanced find
- Select the entity 'processes'
- Remove the default query
- Select 'name equals' and paste the name that you retrieved from SQL
- Remove the returned records from CRM

You will want to avoid removing records from the database as much as possible as this generally causes more errors instead of solving them.

Note: I have found this problem to occur in CRM 2015 update 0.1, this might be fixed in CRM 2016.