Sitemap Error After Removing a Managed Solution from CRM 2011
Greetings, fellow CRMers! After removing a managed solution, have you received the following error when attempting to login to the CRM website?
If you have, look no further for the solution.
This particular error is due to a leftover sitemap reference to a deleted entity. Keep in mind that CRM will normally remove all references from the sitemap when removing a solution. If CRM is unable to do so, it will throw an error and prevent the solution from being removed. However, instances have occurred where this is not the case when removing a managed solution.
Here's how to remedy a situation like this step by step:
Once you have downloaded and extracted the above tool, you will see a screen like the one shown below.
Within the above window, click on SiteMap Editor.
For the purposes of this demonstration, let's say you want to connect to a CRM On-Premise organization. However, this tool also works with CRM Online. Enter in the server name and login information and then click Get Orgs. Select the organization from the drop-down and click OK.
Once the tool connects, click Load SiteMap.
Important! Make sure you back up a copy of your sitemap before you edit it. Once you have clicked Load SiteMap, you will have an option to save a copy of the sitemap locally. Please click Save SiteMap before editing it.
Once you have saved a copy locally of the sitemap, you can then proceed to remove the leftover reference. In this instance, I created a test reference to highlight how to locate the leftover sitemap entity reference and named it reference AATest. Once I located the SubArea in question which references the entity that no longer exists, I clicked Delete. After I have confirmed that the entity was not referenced in any other areas or groups, I published the changed by clicking Update SiteMap.
After reloading refreshing the browser, the sitemap was able to load properly and I was able to login to CRM as usual.
If you want to know how to modify the sitemap without using the tool mentioned above, check out our blog All About Sitemap Editing in CRM 2011. If you need any additional help with the above steps or would like us to fix it for you, please do not hesitate to reach out to our support staff.
Sitemap Contains Reference to an Entity Not Found in the Metadata Cache
You may encounter an error where the sitemap for Organzation xxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx contains a reference to the entity "entity_name," but that entity was not found in the metadata cache.
This error shows up in the Application Event Log of the CRM web server when there are references to entities that do not exist in the sitemap. The most common reason for this issue may be when customizations are moved between environments and entities get deleted in this process, but the sitemap still has references to them. Below are the steps to resolve this error and stop the errors from appearing in the Event Log. It's a good way to keep things clean in the CRM sitemap.
Go to the Application Event Log of the CRM server and copy the GUID of the Organization and the entity name which is throwing the error. (Ignore this step if there is only one organization.)
Find the name of the Organization by querying the CRM database using the following statements. (Again, ignore if there is only one Organization.)
select * from Organization where ID= 'xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx'[Enter the organization ID you found in the event log]
Create a new unmanaged solution with just the sitemap and export the solution for the organization identified in step 2 (or just the organization if it is the only one).
Make a back-up of this solution if something goes wrong with editing the XML and you need to revert to its original state before the change. Unzip the files of the solution and open the customizations.xml file.
In the XML, search for the entity name found in the event log and see if there are any tags that start with "<SubArea Id="entity_name_found_in_event_logs" " or "<Area Id=" entity_name_found_in_event_logs" " or "<Group Id=" entity_name_found_in_event_logs" ". Basically, look for all the references of this entity name, and remove those sections from the sitemap.
Once all the reference are removed, re-package the solution (remember, you need to create a zip file of all the files in the unzipped folder) into a new .zip file and import it back into CRM.
Finally publish the customization upon successful import. This should fix the error.
It's important to note that the user performing the above process must have the following privileges:
System Administrator/System Customizer role in CRM
Local Administrator access on CRM web server machine
Local Administrator on SQL server for CRM and select permission on the MSCRM_CONFIG database
Also, when deleting anything in Microsoft Dynamics CRM, always back up the customizations. You might specifically back up the sitemap before editing and re-import this solution in case something goes wrong with the sitemap update.