Friday, May 30, 2008

Email router doesn't start (Microsoft.Crm.Tools.EmailAgent.SystemState.xml is empty)

We ran into this issue in our production environment. Thanks to Jonas' blog, we were able to fix it.

Published Thursday, March 13, 2008 11:31 PM by Jonas Deibe
-------------------------------------------

Suddenly my email router stopped working in my VPC. A look in the event viewer showed


#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()


The file Microsoft.Crm.Tools.EmailAgent.SystemState.xml has been corrupted? Don’t know why or how it happened but I simple renamed my damaged file from the C:\Program Files\Microsoft CRM Email\Service folder (it's hidden) and started my Email router service. A new Microsoft.Crm.Tools.EmailAgent.SystemState.xml file is generated and populated with my <State> settings information.



Published Thursday, March 13, 2008 11:31 PM by Jonas Deibe

No comments: