locked
Cannot start CRM Email Router service

    Question

  • I have an issue with the CRM Email Router that I'm stuck on and I was hoping that someone out there could offer some advice.

    I noticed that the CRM Email Router service was stopped, I attempted to start it but got the following message:

    The Microsoft CRM Email Router service on Local Computer started and then stopped. Some services stop automatically if they are not in use by other services or programs.

    I went into Event Viewer to get some details about the issue. There were 2 errors in there relating to this:

    Error accesing SystemState.xml. Restore file with last backup.

    followed by:

    #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: System information was not specified in the E-mail Router service configuration file. The E-mail Router service cannot continue and will now shut down. ---> System.Xml.XmlException: Root element is missing.
       at System.Xml.XmlTextReaderImpl.ThrowWithoutLineInfo(String res)
       at System.Xml.XmlTextReaderImpl.ParseDocumentContent()
       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.SystemConfiguration.Initialize(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()

    I have tried to delete the Microsoft.Crm.Tools.EmailAgent.SystemState.xml file but this has no effect and is not recreated. As we've only had this running for a few weeks there was only 1 back up of this file made which, also, has no effect. I am now lost as to what this could be and any help would be much appreciated. Thanks.

    Friday, October 19, 2012 10:13 AM

Answers

  • Just to close this thread off - I did a re-install of the email router and, once done, the service started without a problem. I entered in all the deployments to work with, restarted the service again and tested it and, again, it's working fine.
    Monday, November 12, 2012 11:58 AM

All replies

  • Hi,

    What does the SystemState.xml look like - can you post the content of the file? I guess that there was an error at the last modification of the config during the write process...

    Best regards,

    Andreas


    Andreas Buchinger
    Microsoft Dynamics Certified Technology Specialist
    MCPD: SharePoint Developer 2010

    Friday, October 19, 2012 11:07 AM
  • Hi Andreas,

    Thanks for replying. When I went on there, the SystemState.xml file had a zero size. There was one back up version which contained data, which I've posted below. I tried deleting the SystemState.xml file and renaming the back up but this produced the same error. It's interesting that this file has entries about servers being busy and forbidden access - the server it's on is running well within capacity and I can't think of a reason why it would give a forbidden access. 

    <State>
      <HJa99OviDl84jzz5HGIB7zzSvC81A>
        <Info>SMTP: https://**************************</Info>
        <UserIds>1</UserIds>
        <QueuesIds>1</QueuesIds>
        <Index>0</Index>
        <LastError>The HTTP service located at https://*********************/xrmservices/2011/Organization.svc is too busy. </LastError>
      </HJa99OviDl84jzz5HGIB7zzSvC81A>
      <H6bII5oFaavnLmAuCIIZthwdyX5TM>
        <EmailAddress>noreply@*****************</EmailAddress>
        <LastError>10/17/2012 19:54:46 : System.Net.WebException: The request failed with HTTP status 403: Forbidden.
       at System.Web.Services.Protocols.SoapHttpClientProtocol.ReadResponse(SoapClientMessage message, WebResponse response, Stream responseStream, Boolean asyncCall)
       at System.Web.Services.Protocols.SoapHttpClientProtocol.Invoke(String methodName, Object[] parameters)
       at Microsoft.Crm.Tools.Email.Providers.ExchangeServiceBinding.ResolveNames(ResolveNamesType ResolveNames1)
       at Microsoft.Crm.Tools.Email.Providers.ExchangeWSConnector.IsCurrentUser()
       at Microsoft.Crm.Tools.Email.Providers.ExchangeWSConnector.GetService()
       at Microsoft.Crm.Tools.Email.Providers.ExchangeWSConnector.OpenMailbox()
       at Microsoft.Crm.Tools.Email.Providers.ExchangePollingMailboxProvider.InitExchangeConnector()
       at Microsoft.Crm.Tools.Email.Providers.ExchangePollingMailboxProvider.OpenMailbox()
       at Microsoft.Crm.Tools.Email.Providers.CrmPollingMailboxProvider.Run()</LastError>
      </H6bII5oFaavnLmAuCIIZthwdyX5TM>
      <HRC0hW4Z7ctr6S1Hz5ZkegD75D0s>
        <Info>SMTP: https:*******************************</Info>
        <UserIds>0</UserIds>
        <QueuesIds>1</QueuesIds>
        <LastError>
        </LastError>
      </HRC0hW4Z7ctr6S1Hz5ZkegD75D0s>
      <HPNny2xDlpaJxe7tHUY9nuCuuYHQ>
        <Info>SMTP: https://***************************</Info>
        <UserIds>0</UserIds>
        <QueuesIds>1</QueuesIds>
        <LastError>
        </LastError>
      </HPNny2xDlpaJxe7tHUY9nuCuuYHQ>
    </State>

    Friday, October 19, 2012 11:33 AM
  • The 403 Forbidden seems to come from when the router is trying to resolve names (DNS names, I'd presume), rather than when communicating with CRM. So, it may be a DNS issue

    It is possible to get file locking problems on the email router xml files if the Email router config tool is running at the same time as the router


    Microsoft CRM MVP - http://mscrmuk.blogspot.com/ http://www.excitation.co.uk

    Friday, October 19, 2012 2:19 PM
    Moderator
  • I have exactly the same issue. When I try to restart the service I get an entry in Event Viewer with

    Event 0
    MSCRMEmail
    Error accesing SystemState.xml. Restore file with last backup.

    Although I am using CRM 2011 I followed these instructions: http://support.microsoft.com/kb/954522 i.e. I deleted the file and tried to restart the service with the same error.

    Note that I am running CRM on WMware Player with the Network Adapter set to NAT. In DNS Manager I had created a forward lookup zone [domain].com (there is also the default [domain].local). On [domain].com I have auth, crm, dev, internalcrm and sts CNames pointing to [servername].[domain].local. I don't use IFD so those are probably unecessary.

    There is also a Reverse Lookup Zones entry that has 
    host ip address: 192.168.189.3
    FQDN: 3.189.168.192.in-addr.arpa
    host name: [servername].[domain].local

    However, the IP address of my server is 192.168.131.130 as reported by ipconfig. Also when I look at the properties for the Name Server under "IP Address" for [servername].[domain].local it says Unknown (after doing a search for a few seconds). Could all of this have something to do with this? Note that otherwise my system works just fine.

    Sunday, October 21, 2012 7:34 PM
  • Hi,

    Sure that the credentials for login on SMTP are ok?!

    br,

    Andreas


    Andreas Buchinger
    Microsoft Dynamics Certified Technology Specialist
    MCPD: SharePoint Developer 2010

    Monday, October 22, 2012 8:09 AM
  • I am pretty sure the login information is right. I am using a live.com account for testing which is configured as smtp.live.com, SSL, clear text, 587.

    Anyways, does an error in this information prevent the CRM Email Router service from starting? I believe it should still start but you will get login errors.

    Monday, October 22, 2012 7:53 PM
  • I tried a repair of the Email Router but the issue persisted. I then did

    * uninstall the Email Router
    * rebooted
    * installed the email router again (service was now running)
    * installed rollup 6 and rebooted (service was still running)
    * installed rollup 8 and rebooted (service was still running)

    I now could configure the email router incl doing the test which failed before. Note that before my Microsoft.Crm.Tools.EmailAgent.SystemState.Xml file only showed <State></State>. Now it shows me a "mailbox unavailable" error but several emails that were stuck before now have been delivered. It looks like it is working now.

    • Proposed as answer by hfaun Tuesday, October 23, 2012 5:46 AM
    Tuesday, October 23, 2012 5:46 AM
  • I think I'm getting pretty close to doing a re-install too. It looks like it's all there is left to try.
    Wednesday, October 24, 2012 4:16 PM
  • Just to close this thread off - I did a re-install of the email router and, once done, the service started without a problem. I entered in all the deployments to work with, restarted the service again and tested it and, again, it's working fine.
    Monday, November 12, 2012 11:58 AM