Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7444137
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T11:26:47+00:00 2026-05-29T11:26:47+00:00

After a very standard and minor release, our Apache/Nginx/Django/wsgi setup ceased to function with

  • 0

After a very standard and minor release, our Apache/Nginx/Django/wsgi setup ceased to function with the dreaded

Premature end of script headers: django.wsgi

message in the log. There is no segfault anywhere and no other error message.

There 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.

Here is my wsgi file:


import sys
import os

sys.path.append('/home/app/')
sys.path.append('/home/app/topmodule/')

os.environ['DJANGO_SETTINGS_MODULE'] = 'app.settings'
os.environ["CELERY_LOADER"] = "django"

import app.settings
import django.core.handlers.wsgi

application = django.core.handlers.wsgi.WSGIHandler()

The apache conf for this site is:


WSGIScriptAlias / /home/app/topmodule/django.wsgi
WSGIDaemonProcess app user=app group=app processes=6 threads=1
WSGIProcessGroup app

I also tried adding:

WSGIApplicationGroup %{GLOBAL}

but no help there.
All I’m getting is an apache Server error page and that damn premature-end error in the error log.

I did try to roll back the codebase but that didn’t do any good either which leads me to suspect its not a new code issue.

EDIT
I’ve narrowed the segfault to a line in Django’s wsgi.py.

Trace:

http://paste.pocoo.org/show/546803/

Some dumps:

http://paste.pocoo.org/show/546846/

This happens when requesting any url.
Middleware used:


    'django.middleware.common.CommonMiddleware',
    'django.contrib.sessions.middleware.SessionMiddleware',
    'django.contrib.auth.middleware.AuthenticationMiddleware',
    'django.contrib.messages.middleware.MessageMiddleware', 
    'django.middleware.gzip.GZipMiddleware',
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-29T11:26:48+00:00Added an answer on May 29, 2026 at 11:26 am

    I ended up reinstalling apache, mod wsgi and all related packages. At some point a warning error came up that mod_wsgi was compiled against Python 2.6.6 while the runtime is Python 2.6.4.
    I rebuilt Python from source to 2.6.6 and the problem was resolved. I’m not sure if it was the minor version update or the whole rebuild that fixed it. I’m also not sure why it worked until now, and suddenly stopped working but at least its all OK now.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Django is making very nice forms after creating a models.py and an admin.py. How
After doing a project with WPF and getting very much attached to it's excellent
after a bit speedtracing I found a piece of code (called very very often)
After posting this question and reading that one I realized that it is very
I am very fresh to asp.net mvc and jQuery. After one day trying, I
I have a very simple entry form. After a button is pressed, I need
I have recently started working on a very large C++ project that, after completing
Ok, I'm now very confused. After my last question had several people comment about
I'm using Flash Builder 4 (the version after Flex Builder 3, so very similar
I was asked implement a licensing schema for our product. They are very expensive

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.