web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics CRM (Archived)

Corruption problem with Microsoft.Crm.Tools.EmailAgent.SystemState.Xml in CRM 2011

(0) ShareShare
ReportReport
Posted on by

I am looking for alternative fixes for my email router problems. I have followed this KB support.microsoft.com/.../954522 many times to fix issues when my email router service stops and can not be started. The KB says this is FIXED in CRM 2011 but I still have problems. Any suggestions to track down the cause or anyone else found alternative fixes?

*This post is locked for comments

I have the same question (0)
  • Community Member Profile Picture
    on at

    Log Name:      Application

    Source:        MSCRMEmail

    Date:          6/25/2014 12:00:36 PM

    Event ID:      26234

    Task Category: None

    Level:         Error

    Keywords:      Classic

    User:          N/A

    Computer:    

    Description:

    #26234 - The E-mail Router service could not process a provider work item using assembly: Microsoft.Crm.Tools.EmailProviders.dll and class: Microsoft.Crm.Tools.Email.Providers.SmtpPollingSendEmailProvider. System.IO.IOException: The process cannot access the file 'C:\Program Files\Microsoft CRM Email\Service\Microsoft.Crm.Tools.EmailAgent.SystemState.xml' because it is being used by another process.

      at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)

      at System.IO.FileStream.Init(String path, FileMode mode, FileAccess access, Int32 rights, Boolean useRights, FileShare share, Int32 bufferSize, FileOptions options, SECURITY_ATTRIBUTES secAttrs, String msgPath, Boolean bFromProxy, Boolean useLongPath)

      at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, FileOptions options, String msgPath, Boolean bFromProxy)

      at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share)

      at System.Xml.XmlDocument.Save(String filename)

      at Microsoft.Crm.Tools.Email.Providers.ConfigFileReader.Save()

      at Microsoft.Crm.Tools.Email.Providers.ConfigNodeReader.SetStringValue(String elementName, String setValue)

      at Microsoft.Crm.Tools.Email.Providers.CrmPollingSendEmailProvider.LogErrorToState(Exception exception)

      at Microsoft.Crm.Tools.Email.Providers.CrmPollingSendEmailProvider.HandleRetrieveNextMessageError(Exception exception)

      at Microsoft.Crm.Tools.Email.Providers.CrmPollingSendEmailProvider.Run()

      at Microsoft.Crm.Tools.Email.Agent.ServiceCore.ExecuteProviderWork(Object providerQueueRequestObject)

    Event Xml:

    <Event xmlns="schemas.microsoft.com/.../event">

     <System>

       <Provider Name="MSCRMEmail" />

       <EventID Qualifiers="0">26234</EventID>

       <Level>2</Level>

       <Task>0</Task>

       <Keywords>0x80000000000000</Keywords>

       <TimeCreated SystemTime="2014-06-25T19:00:36.000000000Z" />

       <EventRecordID>1253204</EventRecordID>

       <Channel>Application</Channel>

       <Computer></Computer>

       <Security />

     </System>

     <EventData>

       <Data>#26234 - The E-mail Router service could not process a provider work item using assembly: Microsoft.Crm.Tools.EmailProviders.dll and class: Microsoft.Crm.Tools.Email.Providers.SmtpPollingSendEmailProvider. System.IO.IOException: The process cannot access the file 'C:\Program Files\Microsoft CRM Email\Service\Microsoft.Crm.Tools.EmailAgent.SystemState.xml' because it is being used by another process.

      at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)

      at System.IO.FileStream.Init(String path, FileMode mode, FileAccess access, Int32 rights, Boolean useRights, FileShare share, Int32 bufferSize, FileOptions options, SECURITY_ATTRIBUTES secAttrs, String msgPath, Boolean bFromProxy, Boolean useLongPath)

      at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, FileOptions options, String msgPath, Boolean bFromProxy)

      at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share)

      at System.Xml.XmlDocument.Save(String filename)

      at Microsoft.Crm.Tools.Email.Providers.ConfigFileReader.Save()

      at Microsoft.Crm.Tools.Email.Providers.ConfigNodeReader.SetStringValue(String elementName, String setValue)

      at Microsoft.Crm.Tools.Email.Providers.CrmPollingSendEmailProvider.LogErrorToState(Exception exception)

      at Microsoft.Crm.Tools.Email.Providers.CrmPollingSendEmailProvider.HandleRetrieveNextMessageError(Exception exception)

      at Microsoft.Crm.Tools.Email.Providers.CrmPollingSendEmailProvider.Run()

      at Microsoft.Crm.Tools.Email.Agent.ServiceCore.ExecuteProviderWork(Object providerQueueRequestObject)</Data>

     </EventData>

    </Event>

  • Community Member Profile Picture
    on at

    Log Name:      Application

    Source:        MSCRMEmail

    Date:          6/25/2014 12:01:36 PM

    Event ID:      61346

    Task Category: None

    Level:         Error

    Keywords:      Classic

    User:          N/A

    Computer:  

    Description:

    #61346 - An error occurred while checking for outgoing e-mail messages to process for SMTP: server/orgname . System.IO.IOException: The process cannot access the file 'C:\Program Files\Microsoft CRM Email\Service\Microsoft.Crm.Tools.EmailAgent.SystemState.xml' because it is being used by another process.

      at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)

      at System.IO.FileStream.Init(String path, FileMode mode, FileAccess access, Int32 rights, Boolean useRights, FileShare share, Int32 bufferSize, FileOptions options, SECURITY_ATTRIBUTES secAttrs, String msgPath, Boolean bFromProxy, Boolean useLongPath)

      at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, FileOptions options, String msgPath, Boolean bFromProxy)

      at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share)

      at System.Xml.XmlDocument.Save(String filename)

      at Microsoft.Crm.Tools.Email.Providers.ConfigFileReader.Save()

      at Microsoft.Crm.Tools.Email.Providers.ConfigNodeReader.SetIntValue(String elementName, Int32 setValue)

      at Microsoft.Crm.Tools.Email.Providers.CrmPollingSendEmailProvider.RetrieveNextMessageInternal()

      at Microsoft.Crm.Tools.Email.Providers.CrmPollingSendEmailProvider.RetrieveNextMessage()

      at Microsoft.Crm.Tools.Email.Providers.CrmPollingSendEmailProvider.Run()

    Event Xml:

    <Event xmlns="schemas.microsoft.com/.../event">

     <System>

       <Provider Name="MSCRMEmail" />

       <EventID Qualifiers="0">61346</EventID>

       <Level>2</Level>

       <Task>0</Task>

       <Keywords>0x80000000000000</Keywords>

       <TimeCreated SystemTime="2014-06-25T19:01:36.000000000Z" />

       <EventRecordID>1253206</EventRecordID>

       <Channel>Application</Channel>

       <Computer></Computer>

       <Security />

     </System>

     <EventData>

       <Data>#61346 - An error occurred while checking for outgoing e-mail messages to process for SMTP: server/orgname. System.IO.IOException: The process cannot access the file 'C:\Program Files\Microsoft CRM Email\Service\Microsoft.Crm.Tools.EmailAgent.SystemState.xml' because it is being used by another process.

      at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)

      at System.IO.FileStream.Init(String path, FileMode mode, FileAccess access, Int32 rights, Boolean useRights, FileShare share, Int32 bufferSize, FileOptions options, SECURITY_ATTRIBUTES secAttrs, String msgPath, Boolean bFromProxy, Boolean useLongPath)

      at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, FileOptions options, String msgPath, Boolean bFromProxy)

      at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share)

      at System.Xml.XmlDocument.Save(String filename)

      at Microsoft.Crm.Tools.Email.Providers.ConfigFileReader.Save()

      at Microsoft.Crm.Tools.Email.Providers.ConfigNodeReader.SetIntValue(String elementName, Int32 setValue)

      at Microsoft.Crm.Tools.Email.Providers.CrmPollingSendEmailProvider.RetrieveNextMessageInternal()

      at Microsoft.Crm.Tools.Email.Providers.CrmPollingSendEmailProvider.RetrieveNextMessage()

      at Microsoft.Crm.Tools.Email.Providers.CrmPollingSendEmailProvider.Run()</Data>

     </EventData>

    </Event>

  • Suggested answer
    Nina P. Profile Picture
    2,195 on at

    Hi DC,

    Thank you for using Microsoft Dynamics CRM Community. Do you have an Antivirus software running on the machine where the Email Router is installed?  If so, I'd first recommend you to ensure the locations where the XML file is located are excluded from antivirus scanning.

    What is the number of users and Queues that have to be processed with the Router? If the Router is being heavily used, you might want to increase the pooling period and decrease the messages per circle so that the batches don’t overlap.

    Please let me know if this helps and if you need additional information.

    Nina Peneva

    Support Engineer

    Microsoft Dynamics CRM

  • Community Member Profile Picture
    on at

    Thanks for the input, we are already excluding the service directory C:\Program Files\Microsoft CRM Email\Service. We have less than 70 mail enabled users, I don't think they are pushing out that much email. We are currently configured for Port 25, Connection timeout 300, Max messages per cycle 1000, polling period 60.

    Based on this information what settings do you recommend?

  • Suggested answer
    Nina P. Profile Picture
    2,195 on at

    Hi DC,

    many thanks for this Information. The currently applied settings are suitable for the number of enabled users. I'd recommend you run Process Explorer or similar tool while reproducing the issue to check what is blocking that XML.

    Please let me know if this helps and if you need additional information.

    Nina Peneva

    Support Engineer

    Microsoft Dynamics CRM

  • Community Member Profile Picture
    on at

    This problem is random and I don't know how to reproduce it as I don't know the cause / trigger of the corruption. We run for months with no issues and then will get reports of emails not sending and many times the fix is the steps provided in this KB. If there was some extra circular logging we could enable that would be useful. I am not sure how Proc Mon will help and also the time frame for the issue to happen would make this difficult.

    I don't understand the comment about the XML being blocked? The XML gets corrupted and the service wont run/start and we follow the steps in the KB to rebuild it.

    Any other suggestions? Your help is appreciated!

  • Jullian Valondo Profile Picture
    30 on at

    Hi DC, Are you able to resolve this issue?

  • Community Member Profile Picture
    on at

    We never found an actual fix, however we have not had the issue in a long time, its possible MS fixed it with an update. I cant confirm that though unless someone finds a release note in a CU update somewhere...... (We had this issue on 2011 and 2013)

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics CRM (Archived)

#1
SA-08121319-0 Profile Picture

SA-08121319-0 4

#1
Calum MacFarlane Profile Picture

Calum MacFarlane 4

#3
Alex Fun Wei Jie Profile Picture

Alex Fun Wei Jie 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans