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 FilesMicrosoft CRM EmailService
• 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.
About this file Microsoft.Crm.Tools.EmailAgent.SystemState.xml in the folder C:\Program Files\Microsoft CRM Email\Service >> It simple just u look in service check if MSCRMEmail running or stop,then u check the size of file Microsoft.Crm.Tools.EmailAgent.SystemState.xml in the folder C:\Program Files\Microsoft CRM Email\Service if 0 kb u must rename the extention ex: Microsoft.Crm.Tools.EmailAgent.SystemState.xml2 then if the service run u must stop it first then run the service again, if already stop u just run the service andsee the size of file Microsoft.Crm.Tools.EmailAgent.SystemState.xml in the folder C:\Program Files\Microsoft CRM Email\Service it will have size notin 0 kb again.. I know this so weird I don’t use this solution… because email in CRM 4.0 is the hearth of the CRM applications it self, CRM 4.0 without email is not good application… it’s just like ordinary develop in house software only use dan reuse data…does anyone help me with other better wise solutions, I have this problem on my production server, if email not work, my email workflow will be stuck and Sales team in my company will kill me :(. I’m already update from 1-9 ( 9 is the latest)….pleaseeeee help me………
I have had this on several servers. The solution is that I have found is to uninstall the email connector then reinstall. I know it sucks, but Microsoft have on their support page for this type of problem “take a backup so you can replace the directory when it screws up”. Never mind fixing it, their solution is good backup of a working directory. Go figure!
Anyway, if we made DotNetNuke Modules that needed a good backup for when they break, we would not be in good shape.