Error: System.InvalidOperationException There is an error in XML document - when sending email or refreshing list

When sending an email message, the email may result in an Exception or Exception on Server. After checking the status log, you see a variation of the following error.

You may also see the error when refreshing a Constituent List. 
 
System.InvalidOperationException: There is an error in XML document (1, 81633). ---> System.IO.IOException: Unable to read data from the transport connection: An existing connection was forcibly closed by the remote host. ---> System.Net.Sockets.SocketException: An existing connection was forcibly closed by the remote host
   at System.Net.Sockets.NetworkStream.Read(Byte[] buffer, Int32 offset, Int32 size)
   --- End of inner exception stack trace ---
   at System.Net.ConnectStream.Read(Byte[] buffer, Int32 offset, Int32 size)
   at System.IO.StreamReader.ReadBuffer(Char[] userBuffer, Int32 userOffset, Int32 desiredChars, Boolean& readToUserBuffer)
   at System.IO.StreamReader.Read(Char[] buffer, Int32 index, Int32 count)
   at System.Xml.XmlTextReaderImpl.ReadData()
   at System.Xml.XmlTextReaderImpl.ParseText(Int32& startPos, Int32& endPos, Int32& outOrChars)
   at System.Xml.XmlTextReaderImpl.ParseText()
   at System.Xml.XmlTextReaderImpl.ParseElementContent()
   at System.Xml.XmlReader.ReadElementString()
   at Microsoft.Xml.Serialization.GeneratedAssembly.XmlSerializationReader1.Read592_PhoneData(Boolean isNullable, Boolean checkType)
   at Microsoft.Xml.Serialization.GeneratedAssembly.XmlSerializationReader1.Read677_AddressData(Boolean isNullable, Boolean checkType)
   at Microsoft.Xml.Serialization.GeneratedAssembly.XmlSerializationReader1.Read678_MainAddressData(Boolean isNullable, Boolean checkType)
   at Microsoft.Xml.Serialization.GeneratedAssembly.XmlSerializationReader1.Read751_ConstitData(Boolean isNullable, Boolean checkType)
   at Microsoft.Xml.Serialization.GeneratedAssembly.XmlSerializationReader1.Read849_GetPagedConstitDataReply(Boolean isNullable, Boolean checkType)
   at Microsoft.Xml.Serialization.GeneratedAssembly.XmlSerializationReader1.Read1091_GetPagedConstitDataResponse()
   at Microsoft.Xml.Serialization.GeneratedAssembly.ArrayOfObjectSerializer401.Deserialize(XmlSerializationReader reader)
   at System.Xml.Serialization.XmlSerializer.Deserialize(XmlReader xmlReader, String encodingStyle, XmlDeserializationEvents events)
   --- End of inner exception stack trace ---
   at System.Xml.Serialization.XmlSerializer.Deserialize(XmlReader xmlReader, String encodingStyle, XmlDeserializationEvents events)
   at System.Xml.Serialization.XmlSerializer.Deserialize(XmlReader xmlReader, String encodingStyle)
   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 Blackbaud.Web.Content.Core.RE7Service.MasterService.GetPagedConstitData(GetPagedConstitDataArgs args)
   at Blackbaud.Web.Content.Core.Data.RecordSearch.GetPublicConstitResultsPage(Int32 pageNumber, Int32& numberFetched, Boolean recursive)
   at Blackbaud.Web.Content.Core.Data.RecordSearch.GetResultsPage(Int32 pageNumber, Int32& numberFetched, Boolean recursive, Boolean bypassPrivacy, Boolean bypassCache)
   at Blackbaud.Web.Content.Core.DataSourceConstituentFetch.GetResultsPage(Int32 PageNumber, Int32& NumberRecordsFetched)
   at Blackbaud.Web.Content.Core.EmailJob.ProcessQuery2(BBQueryType oQuery, String sSourceKey, EmailList oList)
   at Blackbaud.Web.Content.Core.EmailJob.ProcessList(Int32 iListID)
   at Blackbaud.Web.Content.Core.EmailJob.ProcessAddressees()
   at Blackbaud.Web.Content.Core.EmailJob.DoProcessMailBlast()
   at Blackbaud.Web.Content.Core.EmailJob.ProcessMailBlast()

 
Another variation of the error:

System.InvalidOperationException: There is an error in XML document (1, 294260). ---> System.Net.WebException: The operation has timed out. at System.Net.ConnectStream.Read(Byte[] buffer, Int32 offset, Int32 size) at System.IO.StreamReader.ReadBuffer(Char[] userBuffer, Int32 userOffset, Int32 desiredChars, Boolean& readToUserBuffer) at System.IO.StreamReader.Read(Char[] buffer, Int32 index, Int32 count) at System.Xml.XmlTextReaderImpl.ReadData() at System.Xml.XmlTextReaderImpl.ParseElementContent() at System.Xml.XmlReader.ReadElementString()
This error indicates there is an errant character either within the email list or within the email content. The email list or test email address, and email content will need to be reviewed. 

Check the email addresses
  • ​If you're sending a test message, confirm the Test List or Email addresses do not contain any special characters, apostrophes or spaces
  • If you're sending a final message:
    1. Navigate to Email>Lists
    2. Click the Pencil icon next to the list associated with the message experiencing the issue
    3. Click View List
    4. Review the email addresses to confirm they do not contain any special characters, apostrophes or spaces
      • Note: if your list is an imported list, you may need to review the CSV file, make the necessary changes, then Update the Imported List.

Check the email content
  • If you received an Exception error message after sending the message, and you confirmed the email addresses are valid, you will need to check the HTML content for errant characters. 
    1. Navigate to Email>Messages
    2. Click the pencil icon to edit the message
      • If the message was sent as final, click the copy icon of the message which resulted in an error, then click the pencil icon on the copy
    3. Click View>Source Code
    4. Copy all the HTML
    5. Paste the HTML in either an XML reader or a Notepad application
      • Note: save a copy of the original HTML file that can be used as a backup in case something goes awry during editing
    6. Review the HTML for any expected characters. For example, you can scan the HTML looking for ASCII characters. 
    7. Remove the unexpected characters
    8. Copy all the updated HTML and paste it back into the email message, replacing the existing HTML
    9. Click OK
    10. Click Save
Resend the email
  1. If the email was sent as final, resend the email, making a copy if needed. 
  2. If the error persists, you need to review the email list and email content in greater detail, until the error is resolved

 

Steps to Duplicate

For a final email message
  1. Navigate to Email>Messages
  2. Click the Status log button
  3. Click the Details link
For a test message
  1. Navigate to Email>Messages
  2. Click the Pencil icon next to the message in question
  3. Click the Test Messages tab
  4. Click the graph of the test message in question
  5. Click the Status Log button
  6. Click the Details link
For an email list
  1. Navigate to Email>List
  2. Click the Pencil icon next to the list
  3. Under the Properties tab, note the error

Environment

 BBNC: 6.45.2034.27
Raiser's Edge: 792.5508.5

Was this article helpful?