Changes between Initial Version and Version 2 of Ticket #17658


Ignore:
Timestamp:
Feb 7, 2012, 6:45:40 AM (13 years ago)
Author:
Ramiro Morales
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #17658 – Description

    initial v2  
    1 After a very standard and minor release, our Apache/Nginx/Django/wsgi setup ceased to function with the only error "Premature end of script headers: django.wsgi" in the apache log.
     1After a very standard and minor release, our `Apache/Nginx/Django/wsgi` setup ceased to function with the only error "Premature end of script headers: django.wsgi" in the apache log.
    22There is no expat problem (checked with sample wsgi app with and without that module include). The server was working fine. The codebase was updated slightly and apache restarted when the horrors began. The codebase was rolled back and still the problem persists.
    33Below are my wsgi file, apache config and a dump from running wsgi under the debuger.
     
    1010
    1111'''wsgi file''':
     12{{{
    1213import sys
    1314import os
     
    2324
    2425application = django.core.handlers.wsgi.WSGIHandler()
    25 
     26}}}
    2627
    2728'''apache config:'''
     29{{{
    2830WSGIScriptAlias / /home/app/topmodule/django.wsgi
    2931WSGIDaemonProcess app user=app group=app processes=6 threads=1
     
    3133Have also tried with :
    3234WSGIApplicationGroup %{GLOBAL}
    33 
    34 '''Django Middleware''':
     35}}}
     36
     37'''Django Middleware''':
     38{{{
    3539'django.middleware.common.CommonMiddleware',
    3640'django.contrib.sessions.middleware.SessionMiddleware',
     
    3943'glowconsole.middleware.ViewNameMiddleware',
    4044'django.middleware.gzip.GZipMiddleware'
    41 
     45}}}
    4246
    4347Debugger dump  when running apache2 -X with the pdb debugger wrapper (also here: http://paste.pocoo.org/show/546803/)
     48{{{
    4449batman:/home/harel# /usr/sbin/apache2 -X
    4550['/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']
     
    99104(Pdb) n
    100105Segmentation fault
    101 
     106}}}
    102107
    103108'''Some var dumps from that debugger session''' (also here: http://paste.pocoo.org/show/546846/):
     109{{{
    104110(Pdb) request
    105111<WSGIRequest
     
    158164 'wsgi.url_scheme': 'http',
    159165 'wsgi.version': (1, 1)}>
    160 
     166}}}
    161167
    162168
    163169(Pdb) locals()
     170{{{
    164171{'start_response': <built-in method start_response of mod_wsgi.Adapter object at 0x7f4f87277990>, 'request': <WSGIRequest
    165172GET:<QueryDict: {}>,
     
    216223 'wsgi.run_once': False,
    217224 'wsgi.url_scheme': 'http',
    218  'wsgi.version': (1, 1)}>, 'self': <django.core.handlers.wsgi.WSGIHandler object at 0x7f4f886a7d90>, 'environ': {'mod_wsgi.listener_port': '8100', 'HTTP_COOKIE': 'ys-ad_preview_window-1332956=o%3Awidth%3Dn%253A532%5Eheight%3Dn%253A472%5Ex%3Dn%253A455%5Ey%3Dn%253A272; ys-account_id=n%3A585; ys-client_id=n%3A202; ys-title=s%3ASlots%20Farm%20-CA%205; csrftoken=6f41c55c934085b286fccb834e910643; sessionid=58a6595013bf69a456a532b318446315', 'mod_wsgi.listener_host': 'batman', 'SERVER_SOFTWARE': 'Apache/2.2.16 (Debian)', 'SCRIPT_NAME': u'', 'mod_wsgi.handler_script': '', 'SERVER_SIGNATURE': '<address>Apache/2.2.16 (Debian) Server at batman Port 8100</address>\n', 'REQUEST_METHOD': 'GET', 'PATH_INFO': u'/', 'SERVER_PROTOCOL': 'HTTP/1.0', 'QUERY_STRING': '', 'HTTP_ACCEPT_CHARSET': 'ISO-8859-1,utf-8;q=0.7,*;q=0.3', 'HTTP_USER_AGENT': 'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/535.11 (KHTML, like Gecko) Chrome/17.0.963.46 Safari/535.11', 'HTTP_CONNECTION': 'close', 'SERVER_NAME': 'batman', 'REMOTE_ADDR': '81.94.195.18', 'mod_wsgi.request_handler': 'wsgi-script', 'wsgi.url_scheme': 'http', 'PATH_TRANSLATED': '/home/glowconsole/glowconsole/django.wsgi/', 'SERVER_PORT': '8100', 'wsgi.multiprocess': True, 'mod_wsgi.input_chunked': '0', 'SERVER_ADDR': '81.94.195.18', 'DOCUMENT_ROOT': '/etc/apache2/htdocs', 'mod_wsgi.process_group': '', 'SCRIPT_FILENAME': '/home/glowconsole/glowconsole/django.wsgi', 'SERVER_ADMIN': 'harel@thisisglow.com', 'wsgi.input': <mod_wsgi.Input object at 0x7f4f886a7db0>, 'HTTP_HOST': 'batman:8100', 'wsgi.multithread': True, 'mod_wsgi.callable_object': 'application', 'HTTP_CACHE_CONTROL': 'max-age=0', 'REQUEST_URI': '/', 'HTTP_ACCEPT': 'text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8', 'wsgi.version': (1, 1), 'GATEWAY_INTERFACE': 'CGI/1.1', 'HTTP_X_FORWARDED_FOR': '217.138.9.130', 'wsgi.errors': <mod_wsgi.Log object at 0x7f4f886a7df0>, 'REMOTE_PORT': '54800', 'HTTP_ACCEPT_LANGUAGE': 'en-GB,en-US;q=0.8,en;q=0.6', 'mod_wsgi.version': (3, 3), 'wsgi.run_once': False, 'mod_wsgi.application_group': 'theglowmachine.com:8100|', 'mod_wsgi.script_reloading': '1', 'wsgi.file_wrapper': <built-in method file_wrapper of mod_wsgi.Adapter object at 0x7f4f87277990>, 'HTTP_ACCEPT_ENCODING': 'gzip,deflate,sdch'}, 'settings': <django.conf.LazySettings object at 0x7f4f721f6a50>}
     225 'wsgi.version': (1, 1)}>, 'self': <django.core.handlers.wsgi.WSGIHandler object at 0x7f4f886a7d90>, 'environ': {'mod_wsgi.listener_port': '8100', 'HTTP_COOKIE': 'ys-ad_preview_window-1332956=o%3Awidth%3Dn%253A532%5Eheight%3Dn%253A472%5Ex%3Dn%253A455%5Ey%3Dn%253A272; ys-account_id=n%3A585; ys-client_id=n%3A202; ys-title=s%3ASlots%20Farm%20-CA%205; csrftoken=6f41c55c934085b286fccb834e910643; sessionid=58a6595013bf69a456a532b318446315', 'mod_wsgi.listener_host': 'batman', 'SERVER_SOFTWARE': 'Apache/2.2.16 (Debian)', 'SCRIPT_NAME': u'', 'mod_wsgi.handler_script': '', 'SERVER_SIGNATURE': '<address>Apache/2.2.16 (Debian) Server at batman Port 8100</address>\n', 'REQUEST_METHOD': 'GET', 'PATH_INFO': u'/', 'SERVER_PROTOCOL': 'HTTP/1.0', 'QUERY_STRING': '', 'HTTP_ACCEPT_CHARSET': 'ISO-8859-1,utf-8;q=0.7,*;q=0.3', 'HTTP_USER_AGENT': 'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/535.11 (KHTML, like Gecko) Chrome/17.0.963.46 Safari/535.11', 'HTTP_CONNECTION': 'close', 'SERVER_NAME': 'batman', 'REMOTE_ADDR': '81.94.195.18', 'mod_wsgi.request_handler': 'wsgi-script', 'wsgi.url_scheme': 'http', 'PATH_TRANSLATED': '/home/glowconsole/glowconsole/django.wsgi/', 'SERVER_PORT': '8100', 'wsgi.multiprocess': True, 'mod_wsgi.input_chunked': '0', 'SERVER_ADDR': '81.94.195.18', 'DOCUMENT_ROOT': '/etc/apache2/htdocs', 'mod_wsgi.process_group': '', 'SCRIPT_FILENAME': '/home/glowconsole/glowconsole/django.wsgi', 'SERVER_ADMIN': 'harel@thisisglow.com', 'wsgi.input': <mod_wsgi.Input object at 0x7f4f886a7db0>, 'HTTP_HOST': 'batman:8100', 'wsgi.multithread': True, 'mod_wsgi.callable_object': 'application', 'HTTP_CACHE_CONTROL': 'max-age=0', 'REQUEST_URI': '/', 'HTTP_ACCEPT': 'text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8', 'wsgi.version': (1, 1), 'GATEWAY_INTERFACE': 'CGI/1.1', 'HTTP_X_FORWARDED_FOR': '217.138.9.130', 'wsgi.errors': <mod_wsgi.Log object at 0x7f4f886a7df0>, 'REMOTE_PORT': '54800', 'HTTP_ACCEPT_LANGUAGE': 'en-GB,en-US;q=0.8,en;q=0.6', 'mod_wsgi.version': (3, 3), 'wsgi.run_once': False, 'mod_wsgi.application_group': 'theglowmachine.com:8100|', 'mod_wsgi.script_reloading': '1', 'wsgi.file_wrapper': <built-in method file_wrapper of mod_wsgi.Adapter object at 0x7f4f87277990>, 'HTTP_ACCEPT_ENCODING': 'gzip,deflate,sdch'}, 'settings': <django.conf.LazySettings object at 0x7f4f721f6a50>}
     226}}}
Back to Top