Tell me more ×
Webmasters Stack Exchange is a question and answer site for pro webmasters. It's 100% free, no registration required.

I tried asking this on SO (no response), so I'm hoping it might be a little more familiar to someone here...

(I would have also tagged this with fastcgi and flup, but apparently they're new tags and I don't have the rep to do so :P)


I'm using the Pyramid framework on a shared server on which mod_wsgi isn't supported. Once I deployed the project, I started getting 500 errors with no really helpful error messages:

[Thu Sep 22 21:40:52 2011] [warn] [client IP] (104)Connection reset by peer: mod_fcgid: error reading data from FastCGI server
[Thu Sep 22 21:40:52 2011] [error] [client IP] Premature end of script headers: dispatch.fcgi
[Thu Sep 22 21:40:53 2011] [warn] [client IP] (104)Connection reset by peer: mod_fcgid: error reading data from FastCGI server
[Thu Sep 22 21:40:53 2011] [error] [client IP] Premature end of script headers: dispatch.fcgi

I wasn't overly sure what was going on, and in a (partial) accident I copied over my app's .ini file with another that used a sqlite connection rather than a postgres connection. Suddenly, my app was up and running. However, I noticed that it seemed like the response was being suddenly cut off (the end of the response wasn't being flushed to the client).

I've been banging my head against my keyboard trying to figure out what's going on, so I'm hoping that someone else has encountered similar symptoms and has figured out a solution.

My fcgi entry looks like this (in case it helps at all):

app = "/dir"
inifile = "production.ini"

import sys, os
sys.path.insert(0, app)
from paste.deploy import loadapp

wsgi_app = loadapp("config:%s/%s" % (app, inifile))

if __name__ == "__main__":
        from flup.server.fcgi import WSGIServer
        WSGIServer(wsgi_app).run()

I remember coming across a post somewhere that suggested launching the WSGI server in a separate thread, sleeping the main thread for a period of time, but that seemed like a horrible hack to me.

share|improve this question
Don't cross-post questions; ask for migration. This doesn't really seem to go here, anyway. – Su' Sep 23 '11 at 17:59
Please don't cross post – John Conde Sep 23 '11 at 18:00
Blech, my bad. Altho that's the wrong post John. This one is the cross-posted one: stackoverflow.com/questions/7524995/…. – Demian Brecht Sep 23 '11 at 18:04

closed as off topic by John Conde Sep 23 '11 at 18:00

Questions on Webmasters Stack Exchange are expected to relate to webmastering within the scope defined in the FAQ. Consider editing the question or leaving comments for improvement if you believe the question can be reworded to fit within the scope. Read more about closed questions here.

Browse other questions tagged or ask your own question.