Boto error repeatedly appearing on Sentry server - django

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.

Boto config
The Boto section is used to specify options that control the operation
of boto itself. This section defines the following options:
debug: Controls the level of debug messages that will be printed by
the boto library. The following values are defined:
0 - no debug messages are printed
1 - basic debug messages from boto are printed
2 - all boto debugging messages plus request/response messages from httplib
Make sure you restart your Django server for the log level to take effect

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.

Related

What does the logger 'django.server' do? Is the logger 'django' not enough?

I need to only add the logger which logs all the api requests coming to my server.
In the documentation,
django.request
Log messages related to the handling of requests. 5XX responses are raised as ERROR messages; 4XX responses are raised as WARNING messages. Requests that are logged to the django.security logger aren’t logged to django.request.
django.server
Log messages related to the handling of requests received by the server invoked by the runserver command. HTTP 5XX responses are logged as ERROR messages, 4XX responses are logged as WARNING messages, and everything else is logged as INFO.
I tried disabling django.server but I could not see any difference in my logs. So, I thought maybe it is for requests emanating from my server. Nope. Still nothing.
So what does django.server do?
I had a similar problem and got clarification from Django guys - configuration in settings.pay is only for the dev server invoked by run server command. Otherwise you need to call logger in the code. See this ticket https://code.djangoproject.com/ticket/34236#comment:4

Email Forwarding on Amazon Web Service SES

I'm trying to set up an email to go to my custom domain name, which I will call "mydomainname". Currently I can send emails to "contact#mydomainname.com" and receive no error from sending the email, but the received email does not show up in my bucket or spam folder.
I've been following instructions on this github and this tutorial .
I don't understand what the github instructions mean for the instruction that states
"Modify the values in the config object at the top of index.js to specify the S3 bucket and object prefix for locating emails stored by SES. Also provide
the email forwarding mapping from original destinations to new destination."
I've tried to guess at what that means by changing the index.js file to the as shown here
I suspect there is an error in the code above,
As well, I receive the following error for the JSON in my lambda-basic-execution
And the error that I receive
.
.
.
I've included the following screenshots for reference
This is my recipient rule
This shows some information on the settings of my lambda page
The error you show is just a warning for the resource not existing, you should still be able to create the policy for the same.
See if you actually did create the policy and test it again.
Also make sure there are no invalid or duplicate rules which may be causing the issue

Partially Delivered Email Causes Error in CF10

My company just turned on sender validation for the SMTP relay. So in the old days, I could send an email to nobody#company.com and it would not result in any error. Now, that email results in this:
"Error","scheduler-2","10/31/16","09:04:49",,
"com.sun.mail.smtp.SMTPSendFailedException:
250 2.0.0 xxxxxxxx-1 Message accepted for delivery ;
nested exception is: com.sun.mail.smtp.SMTPAddressFailedException:
550 5.1.1 User Unknown on Mail Relay"
Is there anything I can do via JVM arguments or anything else to ignore these errors and consider the email sent? There's a box where we send out 2-3K emails a day and there's about 1K of "undelivered" emails now on a daily basis. :(
The exception SMTPAddressFailedException is a result of a failed authentication on the mail server, so this is not related to the JVM configuration at all. ColdFusion simply builds mail content and adds it to the mail spooler. Due to the async. nature of a spooler, you cannot catch these errors at runtime.
Your only option is to communicate with the actual mail server before using cfmail (and ask if the sender is legit). However, as far as I know there is no built-in function/tag/tool in CF to do so.

How can I get a detailed log of django csrf failure?

I am troubleshooting a Django app.
Recently the app seems to Randomly generate CSRF verification errors:
CSRF verification failed. Request aborted.
(Resulting in a 403)
Where can I find detailed information on the cause of the verification failure?
The error you're seeing is on the client side - which won't by default know what's going wrong on your server unless you have set DEBUG = True (which you don't want to do in production).
If it was replicable on your staging server it would be easy to fix, since you could replicate the error with DEBUG = True on staging and quickly see where the verification fails in Django's csrf.py.
What you're looking for is the output of which of these error is occurring on your server.
If you implement logging in Django you'll be able to investigate and determine which of these errors was triggered on your production site. A service like Sentry makes this even simpler since it will send you the traceback anytime an error happens.

How can I make hoptoad in Django 1.2 log errors to log file as well as send airbrake notifications?

We're using django 1.2.7 and the hoptoad logging middleware (hoptoad.middleware.HoptoadNotifierMiddleware).
When an error occurs, the error message gets sent to airbrake, but it does not seem to get logged to the django log file. It seems like it's intercepted by hoptoad exclusively.
Does anyone know how to also get the errors logged to the local django log file on disk? I couldn't find any such option in the hoptoad documentation.
Is there a custom modification needed to the hoptoad middleware class?