[uWSGI] Fastcgi app has stopped working w/ latest version

Matt Gushee matt at gushee.net
Fri Oct 4 21:05:55 CEST 2013

Hello, folks--

First of all, being new here, let me say thanks to the development
team for all their hard work on uWSGI!

So, I'm having the following issue ...

I have a FastCGI app that I am managing with uWSGI. My primary web
server is Nginx, and I am using Arch Linux for my development box and
FreeBSD 7.2 for production. The app itself is a native code executable
written in Chicken Scheme. It uses a Fastcgi library which is a very
basic wrapper around the FCGIX API of the standard fcgi C library.
Also, in case it matters, my app serves only dynamic content. All
static files are handled directly by Nginx and served from the docroot
(i.e. there are no 'alias' directives). I've had this app running on
my production server for about 6 months with no serious issues; during
that time I think I've upgraded Nginx and uWSGI at least a couple of
times; the current versions are Nginx 1.4.1 and uWSGI 1.9.12.

Anyway, I have encountered a new problem on my development system. In
the course of developing a new app using the same technologies, I
decided to verify that the existing app was still working. Nginx was
up-to-date (v. 1.4.2), but I noticed I had an old version of uWSGI
installed (1.2.6), so I decided to upgrade it before proceeding. I
upgraded to 1.9.17, and I find that in fact my app does not work now.
For any URI that is supposed to be handled by my app, I get an Nginx
error message saying, "upstream prematurely closed connection while
reading response header from upstream ..."

I am using the following script to run my app:


export UWSGI_PROTOCOL=fastcgi
export UWSGI_UID=http
export UWSGI_GID=http
export UWSGI_PIDFILE=/run/yanagi_dev.pid
export UWSGI_EXEC_AS_USER=/srv/http/studioyanagi.com/dynamic/yanagi-web

exec /usr/bin/uwsgi

This is the development version. The production version is the same
except for the paths, the UID and GID, and the logging option (using
syslog on the prod server).
This is currently working on the production server, but has stopped
working on the dev box.

The relevant portion of my Nginx configuration is:

   location ~ ^(/|/about|/contact|/wheretobuy|/custom|/gallery|/gallery-nojs|/news|/gallery.json|/news.json)$
        include         uwsgi_params;
        uwsgi_pass ;

A few additional notes:

* When I run the above script as root, the startup messages look good:
privileges are dropped appropriately, and uWSGI says it is executing
my app.

* I have tried running my app as a standalone FastCGI program (with
appropriate changes in Nginx config), and it works perfectly.

* I can't get any log output from uWSGI. In addition to the systemd
option (BTW, I checked the build specs for the Arch uWSGI package, and
systemd logging is supposed to be enabled), I have tried UWSGI_LOGTO2,
and nothing (which should cause log messages to go to stderr, right?).

So, does anyone have an idea what might be wrong? Any leads greatly appreciated!

Matt Gushee

More information about the uWSGI mailing list