I've done a fairly standard release of our application last night and apache refused to start afterwards. This kept on going even after I rolled back the codebase. All I got back was Apache's server error page, and the logs showed the dreaded:
* * *Premature end of script headers: django.wsgi* I've gone through the whole debugging process, ruled out the usual suspects (expat etc.) and when I run the wsgi application via the python debuger I got back the following trace below. The error came from* django/core/handlers/wsgi.py(272)__call__()*: batman:/home/harel# /usr/sbin/apache2 -X ['/usr/local/lib/python2.6/site-packages/setuptools-0.6c11-py2.6.egg', '/usr/local/lib/python26.zip', '/usr/local/lib/python2.6', '/usr/local/lib/python2.6/plat-linux2', '/usr/local/lib/python2.6/lib-tk', '/usr/local/lib/python2.6/lib-old', '/usr/local/lib/python2.6/lib-dynload', '/usr/local/lib/python2.6/site-packages', '/usr/local/lib/python2.6/site-packages/PIL', '/home/glowconsole/', '/home/glowconsole/glowconsole/', '/usr/local/lib/python2.6/site-packages/django'] > /usr/local/lib/python2.6/site-packages/django/core/handlers/wsgi.py(240)__call__() -> from django.conf import settings (Pdb) n > /usr/local/lib/python2.6/site-packages/django/core/handlers/wsgi.py(244)__call__() -> if self._request_middleware is None: (Pdb) n > /usr/local/lib/python2.6/site-packages/django/core/handlers/wsgi.py(245)__call__() -> self.initLock.acquire() (Pdb) n > /usr/local/lib/python2.6/site-packages/django/core/handlers/wsgi.py(246)__call__() -> try: (Pdb) n > /usr/local/lib/python2.6/site-packages/django/core/handlers/wsgi.py(247)__call__() -> try: (Pdb) n > /usr/local/lib/python2.6/site-packages/django/core/handlers/wsgi.py(249)__call__() -> if self._request_middleware is None: (Pdb) n > /usr/local/lib/python2.6/site-packages/django/core/handlers/wsgi.py(250)__call__() -> self.load_middleware() (Pdb) n > /usr/local/lib/python2.6/site-packages/django/core/handlers/wsgi.py(256)__call__() -> self.initLock.release() (Pdb) n > /usr/local/lib/python2.6/site-packages/django/core/handlers/wsgi.py(258)__call__() -> set_script_prefix(base.get_script_name(environ)) (Pdb) n > /usr/local/lib/python2.6/site-packages/django/core/handlers/wsgi.py(259)__call__() -> signals.request_started.send(sender=self.__class__) (Pdb) n > /usr/local/lib/python2.6/site-packages/django/core/handlers/wsgi.py(260)__call__() -> try: (Pdb) n > /usr/local/lib/python2.6/site-packages/django/core/handlers/wsgi.py(261)__call__() -> try: (Pdb) n > /usr/local/lib/python2.6/site-packages/django/core/handlers/wsgi.py(262)__call__() -> request = self.request_class(environ) (Pdb) n > /usr/local/lib/python2.6/site-packages/django/core/handlers/wsgi.py(272)__call__() -> response = self.get_response(request) (Pdb) l 267 'status_code': 400, 268 } 269 ) 270 response = http.HttpResponseBadRequest() 271 else: 272 -> *response = self.get_response(request)* 273 finally: 274 signals.request_finished.send(sender=self.__class__) 275 276 try: 277 status_text = STATUS_CODE_TEXT[response.status_code] (Pdb) n Segmentation fault I've got more information in this StackOverflow question: http://stackoverflow.com/questions/9158776/django-wsgi-apache-throws-premature-end-of-script-errors-and-none-of-the-usual-s I've been batting my head agains the wall since midnight last night. No sleep till this is sorted. Any ideas? I can't get why this would segfault apache. Thanks, Harel -- You received this message because you are subscribed to the Google Groups "Django users" group. To view this discussion on the web visit https://groups.google.com/d/msg/django-users/-/Hv7-Dne0fCQJ. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/django-users?hl=en.

