Microsoft CRM 4.0 Email Router Service Will Not Start
Scenario: The Microsoft CRM 4.0 Email Router Service won’t start and throws an error message stating "The Microsoft CRM Email Router service on Local Computer started and then stopped. Some services stop automatically if they have no work to do, for example, the Performance Logs and Alerts service."
The Application Event log also logs indicates an error like this:
______________________________
Event Type: Error
Event Source: MSCRMEmail
Event Category: None
Event ID: 0
Date:
Time:
User:
Computer:
Description:
#16192 – 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.XmlTextReaderImpl.ParseDocumentContent()
at System.Xml.XmlTextReaderImpl.Read()
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)
at Microsoft.Crm.Tools.Email.Agent.ServiceCore.InitializeSystemConfiguration()
— End of inner exception stack trace —
at Microsoft.Crm.Tools.Email.Agent.ServiceCore.InitializeSystemConfiguration()
at Microsoft.Crm.Tools.Email.Agent.ServiceCore.ExecuteService()
For more information, see Help and Support Center at http://go.microsoft.com/fwlink/events.asp.
If you look at the server services, you will also note that the Microsoft CRM Router service is not running. If you try to start it you will get the normal meaningless error saying it did not start but this could be normal… you guess!
_____________________________
Solution: See KB954522 from Microsoft and perform the steps to resolution, which are:
http://support.microsoft.com/kb/954522
1. Delete the Microsoft.Crm.Tools.EmailAgent.SystemState.xml file.
Notes
• 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.
2. Restart the Microsoft Dynamics CRM E-mail Router Service.
The Microsoft.Crm.Tools.EmailAgent.SystemState.xml file is re-created.
