﻿id	summary	reporter	owner	description	type	status	component	version	severity	resolution	keywords	cc	stage	has_patch	needs_docs	needs_tests	needs_better_patch	easy	ui_ux
21130	Bad EMAIL_HOST results in cryptic error, no Django 500 page	mark@…	nobody	"The error itself is not an bug per se as it is the result of mis-configuration, but it took me a long time to diagnose because of the cryptic error. The fact that the 500 error template was not invoked might be a bug. Regardless, handling this error better might prevent others from having their time similarly wasted. The cryptic error:

    heroku[router]: at=info method=POST path=/signup/ host=tradecraft.herokuapp.com fwd=""50.0.36.150"" dyno=web.1 connect=10ms service=264ms status=500 bytes=135
    app[web.1]: 2013-09-20 15:26:11 [9] [ERROR] Error handling request
    app[web.1]: Traceback (most recent call last):
    app[web.1]:   File ""/app/.heroku/python/lib/python2.7/site-packages/gunicorn/workers/sync.py"", line 131, in handle_request
    app[web.1]:     respiter = self.wsgi(environ, resp.start_response)
    app[web.1]:   File ""/app/.heroku/python/lib/python2.7/site-packages/dj_static.py"", line 59, in __call__
    app[web.1]:     return self.application(environ, start_response)
    app[web.1]:   File ""/app/.heroku/python/lib/python2.7/site-packages/django/core/handlers/wsgi.py"", line 201, in __call__
    app[web.1]:     response._handler_class = self.__class__
    app[web.1]: AttributeError: 'NoneType' object has no attribute '_handler_class'

The underlying cause: EMAIL_HOST was set to a FQN that didn't exist, so line 48 of django/core/mail/backends/smtp.py which calls smtplib.SMTP() was raising a gaierror from Python's socket library. Somehow this wasn't triggering the usual Django 500 error response, but rather resulted in the WSGI get_response() returning None."	Uncategorized	closed	Core (Mail)	1.6-beta-1	Normal	needsinfo			Unreviewed	0	0	0	0	1	0
