Search code examples
djangoamazon-web-servicesbotoamazon-sessentry

Boto error repeatedly appearing on Sentry server


I've configured a Sentry (https://github.com/getsentry/sentry) server to log and manage all the uncaught exceptions on my Django application, that uses Boto to send e-mail via Amazon SES. It is working well and sending e-mail alerts whenever something wrong occurs.

The problem is, almost everytime an error happens and Sentry sends me an alert, it also notifies me of another error (an exception on Boto while sending an email), but it doesn't show me what is the e-mail. I've tried all the bits of my code that send e-mail, and they are all ok. My SES config is also fine, since my application is sending e-mails to a lot of different customers daily

The error reported by Sentry is:

boto in _handle_error
<ErrorResponse xmlns="http://ses.amazonaws.com/doc/2010-12-01/">
  <Error>
    <Type>Sender</Type>
    <Code>MessageRejected</Code>
    <Message>Email address is not verified.</Message>
  </Error>
  <RequestId>4a085303-817a-11e4-b846-79819d3408ac</RequestId>
</ErrorResponse>

After this, i usually receive another error, but all it says is

boto in _handle_error
400 Bad Request

But besides all this MessageRejected warnings, when i go to my AWS Dashboard to check on SES, it shows no Rejects or Complaints, and just a really small number of Bounces (smaller than the amount of warnings i receive)

If i could at least see what email is he trying to send, it would help me debug this, but i can't find any clue about what's happening.


Solution

  • The problem was the default email that Django sends to the emails on the ADMINS setting. Everytime we had an exception, it was trying to email root@localhost (the default value for ADMINS), but since this emails does not exists, it was failing to do so.