Error event when you try to start the Microsoft Dynamics CRM E-mail Router Service in Microsoft Dynamics CRM: "The E-mail Router service could not run the service main background thread"
The E-mail Router service could not run the service main background thread.
The E-mail Router service cannot continue and will now shut down.
System.Configuration.ConfigurationErrorsException: The E-mail router service cannot access system state file Microsoft.Crm.Tools.EmailAgent.SystemState.xml. The file may be missing or may not be accessible. The E-mail Router service cannot continue and will now shut down. ---> System.Xml.XmlException: Root element is missing.
at System.Xml.XmlTextReaderImpl.Throw(Exception e)
at System.Xml.XmlTextReaderImpl.ThrowWithoutLineInfo(String res)
at System.Xml.XmlLoader.Load(XmlDocument doc, XmlReader reader, Boolean preserveWhitespace)
at System.Xml.XmlDocument.Load(XmlReader reader)
at System.Xml.XmlDocument.Load(String filename)
at Microsoft.Crm.Tools.Email.Providers.ConfigFileReader..ctor(String filePath, ServiceLogger serviceLogger)
at Microsoft.Crm.Tools.Email.Providers.SystemState.Initialize(ServiceLogger serviceLogger)
at Microsoft.Crm.Tools.Email.Providers.SystemState..ctor(ServiceLogger serviceLogger)
--- End of inner exception stack trace ---
For more information, see Help and Support Center at http://go.microsoft.com/fwlink/events.as
This issue has been addressed in Dynamics CRM 4.0 Update Rollup 13. See KB http://support.microsoft.com/kb/2308072 for more information. This has also been addressed in Dynamics CRM 2011.
If you are not on Update Rollup 13, to resolve this problem, follow these steps:
- Delete the Microsoft.Crm.Tools.EmailAgent.SystemState.xml file.
- By default, the Microsoft.Crm.Tools.EmailAgent.SystemState.xml file is in the following folder: C:\Program Files\Microsoft CRM Email\Service
- By default, the Service folder is a hidden folder. To see this folder, you must change the Windows Explorer settings to display hidden files and hidden folders.
- By default, the Microsoft.Crm.Tools.EmailAgent.SystemState.xml file is in the following folder:
- Restart the Microsoft Dynamics CRM E-mail Router Service.
The Microsoft.Crm.Tools.EmailAgent.SystemState.xml file is re-created.
If Microsoft Dynamics CRM users are set to use the Email Router, and not a Forward Mailbox, for incoming email, there is a possibility of deleted emails returning to Microsoft Dynamics CRM after implementing this resolution. If an email has not been deleted from the user's mailbox, the Email Router could find a user's email in their Inbox, not find it in Microsoft Dynamics CRM, and create the email in Microsoft Dynamics CRM again. To avoid this, the email should also be deleted from the user's mailbox along with Microsoft Dynamics CRM.
To avoid this situation, regularly take a backup of the following files and store them on the desktop of the same server.
If the Microsoft Dynamics CRM Email Router Configuration Manager fails at launch or the Microsoft Dynamics CRM Email Router service fails to start, replace the above 2 files in C:\Program Files\Microsoft CRM Email\Service. Restart the Microsoft Dynamics CRM Email Router service and then launch the Microsoft Dynamics CRM Email Router Configuration Manager. If the back up of these files is latest, then it will have the complete configuration of the Email Router.
Article ID: 954522 - Last Review: 09/12/2011 00:13:00 - Revision: 4.0
- kbmbsemail kberrmsg kbtshoot kbmbsmigrate kbbug kbexpertiseinter kbsurveynew KB954522