Bug #72545 Django crash "'NoneType' object has no attribute 'converter'"
Submitted: 6 May 2014 9:35 Modified: 11 Jul 2014 18:07
Reporter: Anthony Ruhier Email Updates:
Status: Closed Impact on me:
None 
Category:Connector / Python Severity:S2 (Serious)
Version:1.2.1rc OS:Linux (Debian 7.5)
Assigned to: CPU Architecture:Any
Tags: crash, Django

[6 May 2014 9:35] Anthony Ruhier
Description:
On Django 1.6 with python 3.2, after a few hours of inactivity (~ 10 hours), I get a crash in my django application :

Exception Type: AttributeError
Exception Value: 'NoneType' object has no attribute 'converter'

It happens with uWSGI and gunicorn, and the only thing I can do is restart the python server to fix temporary the bug.

It seems I am not the only one getting this bug : https://www.pythonanywhere.com/forums/topic/1270/

How to repeat:
Wait a few hours of inactivity then try to refresh your Django website.

Suggested fix:
One temporary solution has been proposed here : https://www.pythonanywhere.com/forums/topic/1270/#id_post_9109

The problem, as the author explains it, is that is quite "dirty" as it can fall in a recursive loop (even if in python they are not unlimited), but it fixes the bug.
[8 May 2014 8:18] Geert Vanderkelen
Thanks for this bug report. We have to indeed handle the error when connection is gone there.
[26 Jun 2014 17:17] Paul DuBois
Noted in 1.2.3 changelog.

Previously, a RuntimeError exception was raised when a Django
application was inactive for a while. Now, the Django backend
verifies that the database connection is still valid each time a
database request is made.
[11 Jul 2014 14:26] Paul DuBois
Noted in 2.0.0 changelog.
[11 Jul 2014 18:07] Anthony Ruhier
Nice, thank you !