SerializationException: There was an error deserializing the object of type MailChimpAmazon.SES.Results.SendEmailResult. Encountered unexpected character '<'.

3,768 views
Skip to first unread message

Fredrik Dahlén

unread,
Jan 23, 2012, 10:07:02 AM1/23/12
to mailchimp-...@googlegroups.com
Hi,

Would appreciate help with the above error. We're using MailChimpAmazon.SES.SesApi.SendEmail and from the stacktrace it looks like JSON formatted data should be returned. However the call to SendEmail fails with the "Encountered unexpected character '<'" message, perhaps indicating an XML response?

This started happening today at 12 noon (UTC/GMT +1 hour).

Any clues?

System.Runtime.Serialization.SerializationException: There was an error deserializing the object of type MailChimpAmazon.SES.Results.SendEmailResult. Encountered unexpected character '<'. ---> System.Xml.XmlException: Encountered unexpected character '<'.
at System.Xml.XmlExceptionHelper.ThrowXmlException(XmlDictionaryReader reader, XmlException exception)
at System.Runtime.Serialization.Json.XmlJsonReader.ReadAttributes()
at System.Runtime.Serialization.Json.XmlJsonReader.Read()
at System.Xml.XmlBaseReader.IsStartElement()
at System.Xml.XmlBaseReader.IsStartElement(XmlDictionaryString localName, XmlDictionaryString namespaceUri)
at System.Runtime.Serialization.Json.DataContractJsonSerializer.InternalIsStartObject(XmlReaderDelegator reader)
at System.Runtime.Serialization.Json.DataContractJsonSerializer.InternalReadObject(XmlReaderDelegator xmlReader, Boolean verifyObjectName)
at System.Runtime.Serialization.XmlObjectSerializer.ReadObjectHandleExceptions(XmlReaderDelegator reader, Boolean verifyObjectName)
--- End of inner exception stack trace ---
at System.Runtime.Serialization.XmlObjectSerializer.ReadObjectHandleExceptions(XmlReaderDelegator reader, Boolean verifyObjectName)
at System.Runtime.Serialization.Json.DataContractJsonSerializer.ReadObject(XmlDictionaryReader reader)
at System.Runtime.Serialization.Json.DataContractJsonSerializer.ReadObject(Stream stream)
at Hammock.Serialization.HammockDataContractJsonSerializer.Deserialize[T](String content) in D:\My Dropbox\_7_Source_Code\_1_Projects\hammock\src\net35\Hammock\Serialization\HammockDataContractJsonSerializer.cs:line 59
at Hammock.RestClient.DeserializeEntityBody[T](RestBase request, RestResponse`1 response) in D:\My Dropbox\_7_Source_Code\_1_Projects\hammock\src\net35\Hammock\RestClient.cs:line 2302
at Hammock.RestClient.BuildResponseFromResult[T](RestBase request, WebQuery query) in D:\My Dropbox\_7_Source_Code\_1_Projects\hammock\src\net35\Hammock\RestClient.cs:line 2214
at Hammock.RestClient.Request[T](RestRequest request) in D:\My Dropbox\_7_Source_Code\_1_Projects\hammock\src\net35\Hammock\RestClient.cs:line 107
at MailChimpAmazon.SES.SesApi.SendEmail(String subject, String htmlMessage, String textMessage, EmailAddress fromEmail, IEnumerable`1 toEmailAddresses, IEnumerable`1 replyToEmails, Boolean trackOpens, Boolean trackClicks, IEnumerable`1 tags)
...

Best regards,
Fredrik

jesse

unread,
Jan 24, 2012, 9:09:04 AM1/24/12
to MailChimp API Discuss
Are you on us1? If so you may have seen intermittent issues yesterday
there, but they should have all cleared up yesterday afternoon (say,
~GMT 17:00). If not, dumping the actual data returned should help
determine the cause of any ongoing issue we may not have already
tracked down and corrected.


jesse

Fredrik Dahlén

unread,
Jan 25, 2012, 4:43:29 AM1/25/12
to mailchimp-...@googlegroups.com
Hi again,

Thanks Jesse. Yes we are on us1 (http://us1.sts.mailchimp.com/1.0/).

It seems we are no longer seeing the "Encountered unexpected character" problem but instead we have a lot of 400 Bad Request and occasionally a few 500 Internal Server Error. What is the most common cause of 400 Bad Request? Any changes in parameters on your side?

Stacktrace below.

MailChimpAmazon.SES.ApiException: MailChimp Amazon SES Wrapper Exception ---> System.Net.WebException: The remote server returned an error: (400) Bad Request.
at System.Net.HttpWebRequest.GetResponse()
at Hammock.Web.WebQuery.ExecutePostOrPut(PostOrPut method, String url, WebException& exception) in D:\My Dropbox\_7_Source_Code\_1_Projects\hammock\src\net35\Hammock\Web\WebQuery.cs:line 1117


--- End of inner exception stack trace ---

at MailChimpAmazon.SES.SesApi.checkForError(RestResponseBase response) in [...]\MailChimpAmazon.SES\src\MailChimpAmazonSES_b6d6e306fad0\SesApi.cs:line 253


at MailChimpAmazon.SES.SesApi.SendEmail(String subject, String htmlMessage, String textMessage, EmailAddress fromEmail, IEnumerable`1 toEmailAddresses, IEnumerable`1 replyToEmails, Boolean trackOpens, Boolean trackClicks, IEnumerable`1 tags)

Best regards,
Fredrik


jesse

--
You received this message because you are subscribed to the Google Groups "MailChimp API Discuss" group.
To post to this group, send email to mailchimp-...@googlegroups.com.
To unsubscribe from this group, send email to mailchimp-api-di...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/mailchimp-api-discuss?hl=en.

jesse

unread,
Jan 25, 2012, 7:38:51 AM1/25/12
to MailChimp API Discuss
Making legitimately bad requests - those should have nothing to do
with the problems we cleaned up. For those you'll need to look at the
actual data returned to determine why the request failed. 500 requests
in particular will contain more detailed error messages.


jesse

Fredrik Dahlén

unread,
Jan 26, 2012, 6:24:56 AM1/26/12
to mailchimp-...@googlegroups.com
Hi,

In the logs for the 400 Bad Request calls I can find the following response body:

{"aws_type":"Sender","aws_code":"MessageRejected","http_code":400,"message":"Address blacklisted."}

This happens with TO email addresses of ordinary people, seemingly randomly. The FROM email address is a "noreply" address for the site in question, and it's the same address as in all other calls that take place (there are lots more of them and they succeed).

The 500 Internal Server Error calls are much rarer and don't pose the same problems to us. But here is an example of such a response body:

{"aws_type":null,"aws_code":null,"http_code":500,"message":"A backend database error occurred. Reference code: ebcf222dc5e77b6"}

jesse

unread,
Jan 26, 2012, 7:44:07 AM1/26/12
to MailChimp API Discuss
That 400 message is coming from Amazon SES, nothing we can do about
it. I'll see if I can track down the 500 error and correct it.


jesse

jesse

unread,
Jan 26, 2012, 7:50:42 AM1/26/12
to MailChimp API Discuss
The 500 was a general database issue you happened to hit which
resolved itself quickly. You can retry those and then report anything
that happens consistently.


jesse
Reply all
Reply to author
Forward
0 new messages