WSGI error Truncated or oversized response headers received from daemon process

76 views
Skip to first unread message

Jose Luis Arrioja

unread,
Aug 24, 2022, 4:16:48 PM8/24/22
to modwsgi
Hi,
Recently, my project report a 'Truncated or oversized response headers received from daemon process' out of nowhere after 3 years of working fine. 
This is what apache logs show up:

[wsgi:info] [pid 8691:tid 139935800280832] [remote 2806:10be:a:1253:c80c:b395:242c:5334:4326] mod_wsgi (pid=8691, process='MyProject', application=''): Loading WSGI script '/home/axel/MyProjectProject/MyProject/MyProject/wsgi.py'.
[core:notice] [pid 7681:tid 139935929101248] AH00051: child pid 8642 exit signal Segmentation fault (11), possible coredump in /etc/apache2
[wsgi:info] [pid 8718:tid 139935929101248] mod_wsgi (pid=8718): Attach interpreter ''.
[wsgi:info] [pid 8718:tid 139935929101248] mod_wsgi (pid=8718): Adding '/home/axel/MyProjectProject/MyProject' to path.
[wsgi:error] [pid 7891:tid 139935646435072] [client 2806:10be:a:1253:c80c:b395:242c:5334:4326] Truncated or oversized response headers received from daemon process 'MyProject': /home/axel/MyProjectProject/MyProject/MyProject/wsgi.py, referer: https://MyProject.net/es/login/

I check a few solutions for this in serverfault or Stack Overflow and I add some new things for my Apache conf like 'WSGIApplicationGroup %{GLOBAL}' or 'processes=5 threads=15 display-name=%{GROUP} user=www-data group=www-data' in WSGIDaemonProcess but nothing works (of course I restart Apache service every time I change something).

<IfModule mod_ssl.c>
<VirtualHost *:443>
    DocumentRoot /var/www/html
    ServerAlias MyProject.net
    ServerAlias www.MyProject.net
    LogLevel info ssl:warn

    Alias /res /home/axel/MyProjectProject/MyProject/res
    <Directory /home/axel/MyProjectProject/MyProject/res>
        Require all granted
    </Directory>

    Alias /media /home/axel/MyProjectProject/MyProject/media
    <Directory /home/axel/MyProjectProject/MyProject/media>
        Require all granted
    </Directory>

    <Directory /home/axel/MyProjectProject/MyProject/MyProject>
        <Files wsgi.py>
            Require all granted
        </Files>
    </Directory>

    <Directory /home/axel/MyProjectProject>
        <Files metrics.csv>
            Require all granted
        </Files>
    </Directory>

    WSGIDaemonProcess MyProject python-home=/home/axel/MyProjectProject/MyProjectVenv python-path=/home/axel/MyProjectProject/MyProject processes=5 threads=15 display-name=%{GROUP} user=www-data group=www-data
    WSGIApplicationGroup %{GLOBAL}
    #WSGIProcessGroup %{GLOBAL}
        WSGIProcessGroup MyProject
    WSGIScriptAlias / /home/axel/MyProjectProject/MyProject/MyProject/wsgi.py

    RewriteEngine on
</VirtualHost>
</IfModule>

This is the list of dependency in Django:

Package             Version  

------------------- ---------

certifi             2018.4.16

chardet             3.0.4    

coreapi             2.3.3    

coreschema          0.0.4    

Django              2.0.5    

django-filter       1.1.0    

django-rest-swagger 2.2.0    

django-rosetta      0.8.1    

djangorestframework 3.8.2    

html5lib            1.0.1    

httplib2            0.11.3   

idna                2.7      

itypes              1.1.0    

Jinja2              2.10     

lxml                4.2.5    

MarkupSafe          1.0      

microsofttranslator 0.8      

openapi-codec       1.3.2    

Pillow              5.1.0    

pip                 18.1     

pkg-resources       0.0.0    

polib               1.1.0    

psycopg2-binary     2.7.4    

PyPDF2              1.26.0   

python-docx         0.8.7    

pytz                2018.5   

reportlab           3.5.6    

requests            2.19.1   

setuptools          39.0.1   

simplejson          3.16.0   

six                 1.11.0   

uritemplate         3.0.0    

urllib3             1.23     

webencodings        0.5.1    

xhtml2pdf           0.2.2    

XlsxWriter          3.0.1  

I'm not using PHP or anything, is just Django, PostgreSQL and javascript

Please provide solution for above issue, and sorry for my awful english

Thanks

Graham Dumpleton

unread,
Aug 24, 2022, 4:18:46 PM8/24/22
to mod...@googlegroups.com
Did you by chance just update to latest Apache version?

Is it occurring when a POST request is done with content over 1Gi in size?

What other updates to packages have you done recently?

Graham

--
You received this message because you are subscribed to the Google Groups "modwsgi" group.
To unsubscribe from this group and stop receiving emails from it, send an email to modwsgi+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/modwsgi/89f4f197-da11-4559-bb0e-4b27d68d3299n%40googlegroups.com.

Jose Luis Arrioja

unread,
Aug 24, 2022, 5:36:49 PM8/24/22
to modwsgi
Apparently yes, the server updates packages daily

Server version: Apache/2.4.29 (Ubuntu)

Server built:   2022-06-23T12:51:37

Do you think that could be the reason?


Graham Dumpleton

unread,
Aug 24, 2022, 5:58:41 PM8/24/22
to mod...@googlegroups.com
Nope. The problematic Apache version is 2.4.54. If that truly is the version you have it is very old.

Did it only happen the once, or is it reproducible?

Could you have run out of memory on the system?

Jose Luis Arrioja

unread,
Aug 24, 2022, 6:46:52 PM8/24/22
to modwsgi
Did it only happen the once, or is it reproducible?
If you are asking me, the problem is persistent?, yes, I no longer have access to my project, if it is about updating packages command, the server admin tells me that command execute daily.

About the memory, I don't know, because I don't see anything like 'Out of memory allocated' in the Apache logs recently:

Captura de Pantalla 2022-08-24 a la(s) 5.36.27 p. m..png


Thanks for the help, I don't know much about wsgi.

Graham Dumpleton

unread,
Aug 24, 2022, 6:54:51 PM8/24/22
to mod...@googlegroups.com
Are you using system packages for Python, or are you creating a Python virtual environment and installing all packages yourself using pip or other Python package manager?

Even if the latter, what could have happened is that a system library for a package, eg., PostgreSQL, could have been updated and so a Python package which gets compiled from source (as has an extension could need rebuilding and reinstalling).

Anyway, it is going to be really hard to work out unless you can narrow it done as occurring in specific Python code.

Can you ask your server admins if they have saving of core dump files enabled and thus whether there is a core dump from Apache which they could extract a core dump stack trace from? I have no idea what Ubuntu requires to save core dumps.

Other than that, can only suggest you recreate you Python virtual environment with all the packages. When running pip ensure you use the --no-cache-dir option so that it rebuilds extensions again against latest system libraries and doesn't use old cache builds compiled against older system libraries.

Graham

On 25 Aug 2022, at 8:46 am, Jose Luis Arrioja <jose...@utopia-software.com> wrote:

Did it only happen the once, or is it reproducible?
If you are asking me, the problem is persistent?, yes, I no longer have access to my project, if it is about updating packages command, the server admin tells me that command execute daily.

About the memory, I don't know, because I don't see anything like 'Out of memory allocated' in the Apache logs recently:

<Captura de Pantalla 2022-08-24 a la(s) 5.36.27 p. m..png>

Reply all
Reply to author
Forward
0 new messages