3

Django will email ADMINS upon 500 errors.

Reading app-engine-patch docs, it claims to enable mail support, but I can't tell if it does so enough to support 500 emailing.

I tried it and it doesn't seem to be working, but it is a silent failure with no log messages, so I might have misconfigured something.

Does anyone have experience with app-engine-patch emailing ADMINS upon 500?

dfrankow
  • 20,191
  • 41
  • 152
  • 214
  • Hi Dan, is this guy's problem related to yours? His issue is that the email was not coming from a "logged in user or ADMIN". http://www.mail-archive.com/google-appengine@googlegroups.com/msg11317.html Have you tried just sending a normal email, unrelated to a 500? What was the result? – mcassano Sep 15 '09 at 18:47
  • Thanks! This is not my problem. I indeed encountered that problem as well. If GAE cannot send mail, it logs an error in the GAE log. This failure was silent, no error. – dfrankow Sep 16 '09 at 20:00

2 Answers2

3

Turns out I had misconfigured.

BAD configuration:

ADMINS = ['email1@example.com', 'email2@example.com']

GOOD configuration:

ADMINS = (('name1', 'email1@example.com'), \
          ('name2', 'email2@example.com'))

See the docs about ADMINS.

Also, be cautious about a tuple with a single entry, which due to Python requires a trailing comma:

ADMINS = (('name1', 'email1@example.com'),)
dfrankow
  • 20,191
  • 41
  • 152
  • 214
0

I was getting silent errors just as you describe; the only clue I had was that the sent email quota was getting used.

I already had DEBUG and ADMIN configured in my settings.py; after adding SERVER_EMAIL to specify the sender everything started working:

DEBUG= false
SERVER_EMAIL = 'a_valid_app_admin_email_address@gmail.com'
ADMINS = (
    ('Reporting email', 'email_that_will_received_reports@gmail.com'),
)

Now I'm receiving emails on 500 errors.

morais
  • 2,951
  • 5
  • 27
  • 27