I have a flask application that runs on an apache web server, and recently i added a feature using the p4python module. But every time the site calls this package, i get a 500 Internal Server Error. When i check the error log i get the error saying "Truncated or oversized response headers received from daemon process ".
Configuration
- Ubuntu 14.04.6
- Apache 2.4.7
- Python 3.4.3
- mod-wsgi 4.6.8
- openssl 1.0.1f
Notable python packages are
- Flask 1.0.4
- psycopg2 2.8.3
- p4python 2019.1.1858212
I have tried every solution suggested on the other threads here, and i have tried the debugging suggestions from https://modwsgi.readthedocs.io/en/develop/user-guides/debugging-techniques.html#tracking-request-and-response.
This includes setting WSGIApplicationGroup %{GLOBAL}, increasing the header size and updating mod-wsgi to the newest version using pip.
Unfortunately none of this has worked, and when i call a function using the p4python api the site shows an error.
.conf file
Listen 31415
<VirtualHost *:31415>
ServerName dev-collab
SSLEngine on
SSLCertificateFile /etc/ssl/private/********.cer
SSLCertificateKeyFile /etc/ssl/private/*********.key
WSGIDaemonProcess applicationDash user=www-data group=www-data threads=6 python-home=/var/www/applicationDash/venv
WSGIScriptAlias / /var/www/applicationDash/api.wsgi
ErrorLog "/var/log/apache2/applicationDash_error.log"
CustomLog "/var/log/apache2/applicationDash_access.log" common
LogLevel info
DocumentRoot "/var/www/applicationDash"
<Directory "/var/www/applicationDash">
WSGIProcessGroup applicationDash
WSGIScriptReloading On
WSGIApplicationGroup %{GLOBAL}
</Directory>
Alias /static /var/www/applicationDash/static
<Directory "/var/www/applicationDash/static">
Require all granted
</Directory>
</VirtualHost>
Response header
[wsgi:error] [pid 42349] [remote 10.4.24.191:52037] ('RESPONSE',
[wsgi:error] [pid 42349] [remote 10.4.24.191:52037] '200 OK',
[wsgi:error] [pid 42349] [remote 10.4.24.191:52037] [('Content-Type', 'text/html; charset=utf-8'), ('Content-Length', '5598')])
The actual error
[wsgi:info] [pid 42371] mod_wsgi (pid=42371): Attach interpreter ''.
[wsgi:info] [pid 42371] mod_wsgi (pid=42371): Imported 'mod_wsgi'.
[ssl:info] [pid 41529] [client 10.4.32.52:53304] AH01964: Connection to child 2 established (server dev-collab:443)
[ssl:info] [pid 41529] (70014)End of file found: [client 10.4.32.52:53304] AH01991: SSL input filter read failed.
[ssl:info] [pid 41530] [client 10.4.24.191:58651] AH01964: Connection to child 3 established (server dev-collab:443)
[wsgi:info] [pid 42371] [remote 10.4.24.191:58651] mod_wsgi (pid=42371, process='applicationDash', application=''): Loading Python script file '/var/www/applicationDash/api.wsgi'.
[wsgi:error] [pid 41530] [client 10.4.24.191:58651] Truncated or oversized response headers received from daemon process 'applicationDash': /var/www/applicationDash/api.wsgi, referer: https://dev-collab:31415/branch/3/AccessControl
This is all with LogLevel info.
Does anyone have an idea where my mistake lies?