Truncated or oversized response headers received from daemon process

kartopete picture kartopete · Jul 18, 2014 · Viewed 11.9k times · Source

I recently migrated a python django application from a debian system to a redhat enterprise distribution. The application is hosted using httpd, mod_wsgi and running in a venv in an daemon process. On large requests I now get following error message in the log file:

"Truncated or oversized response headers received from daemon process" 

I have never experienced anything like this and Google is not the key here as well. I checked configuration of apache, but no config is related to response headers in there.

My httpd.conf configuration looks like this ( pretty standard):

WSGIPassAuthorization On
WSGIScriptAlias / /var/www/myapp/wsgi.py
WSGIDaemonProcess my.name python-path=/path/to/myapp/:/path/to/venv/lib/python2.7/site-packages display-name=%{GROUP}
WSGIProcessGroup my.name

Does any Guru have a hint in which direction I should look?

Answer

Paul Tuckett picture Paul Tuckett · Jun 25, 2019

We recently ran into this issue, and after days of vigorous ugoogleizing and massive headache, we discovered that we were using psycopg2-binary as our database connector dependency (I know, newbs)! It states right in their documentation not to use the package in a production environment.

We did add all the other proposed answers such as adding 'WSGIApplicationGroup %{GLOBAL}' to our settings (which we kept), but all of them alone and together didn't solve the issue.

We also found that other C libraries like numpy, cause issues.

Hope this helps someone some day.

Django Webfaction 'Timeout when reading response headers from daemon process'

http://initd.org/psycopg/docs/install.html#prerequisites