I’ve been having some very weird problems. Yesterday I updated my master branch on a project and after that, when I tried to do manage.py runserver the runserver wouldn’t serve any page. I had to ctrl + c to exit the server and I would later receive this message.
Exception happened during processing of request from ('127.0.0.1', 53975)
Unhandled exception in thread started by <function inner_run at 0x2ec8488>
Traceback (most recent call last):
File "/home/marco/virtualenvs/designersenv/lib/python2.7/site-packages/django/core/management/commands/runserver.py", line 60, in inner_run
run(addr, int(port), handler)
File "/home/marco/virtualenvs/designersenv/lib/python2.7/site-packages/django/core/servers/basehttp.py", line 721, in run
httpd.serve_forever()
File "/usr/lib/python2.7/SocketServer.py", line 227, in serve_forever
self._handle_request_noblock()
File "/usr/lib/python2.7/SocketServer.py", line 286, in _handle_request_noblock
self.handle_error(request, client_address)
File "/usr/lib/python2.7/SocketServer.py", line 342, in handle_error
import traceback
ImportError: No module named traceback
I found out by experimentation that erasing the database(sqlite) and recreating it with syncdb and migrate removed the issue, but once I add something to the models via the admin page, I would get the same error again, no pages would be served.
I also noticed that when this was going on, python starting to occupy around 40-60% of my CPU and RAM. I later noticed on the project folder, where database.db is located, a database.db-journal file would be created every 2-3 seconds, get deleted and then reappear. Googling didn’t bring me any results so I am laying my hands on SO wisdom. Thanks.
A couple months late but anyway, here is what my problem was:
A django app was messing up and getting stuck in a bug. I believe it was Django Cache Bot.
Cheers.