Open bdr-sara opened 5 days ago
This error indicates that something has cached the wsgi.errors
object from the WSGI request environ
dictionary beyond the lifetime of the HTTP request and has then tried to write to it after the request has finished.
It is very strange that something is actually trying to use the wsgi.errors
object and not just using Python logging module and/or stderr instead. Don't thinkI have ever seen any framework use wsgi.errors
even though it exists.
Would need the complete stack trace for the error to try and better understand what is trying to use it.
it is apear on every API request
and it is the partialstack trace:
[Tue Oct 15 12:25:51.364043 2024] [wsgi:error] [pid 6868:tid 1220] [client xxx:36116] File "C:\Apache24\htdocs\ERPapp\.venv\Lib\site-packages\django\template\base.py", line 339, in init\r, referer: https://wishproglobal.com:portX/
[Tue Oct 15 12:25:51.364043 2024] [wsgi:error] [pid 6868:tid 1220] [client xxx:36116] def init(self, template_string):\r, referer: https://wishproglobal.com:portX/
[Tue Oct 15 12:25:51.364043 2024] [wsgi:error] [pid 6868:tid 1220] [client xxx:36116] RuntimeError: log object has expired\r, referer: https://wishproglobal.com:portX/
[Tue Oct 15 12:25:51.364043 2024] [wsgi:error] [pid 6868:tid 1220] [client xxx:36116] Exception ignored in: <_io.TextIOWrapper name='
Do the pages which have this issue use an on transaction commit callback, or other callback which is processed upon completion of a request, to do something? This is probably what is happening, and it is trying to access the now invalid wsgi.errors
object somehow, possibly by trying to print on the WSGI environ
dictionary inadvertently.
Thanks for taking the time This happens to me on every API request I feel like I had a version compatibility issue when installing the django pyodbc,mod_wsgi library I addressed this bug https://github.com/mkleehammer/pyodbc/issues/1382 And i did as pip install git+https://github.com/mkleehammer/pyodbc.git
That could be causing me a problem Maybe it's better for me to go down to old versions in everything
Oh, didn't pick up that you were using Python 3.13. I wonder what has changed in that version. 🤔
Summary
I'm encountering a
RuntimeError: log object has expired
when using mod_wsgi with Django 5.0.9. The issue appears in the Apache logs when rendering certain pages.Environment
Steps to Reproduce
Error Log
[Tue Oct 15 11:55:47.997506 2024] [wsgi ] [pid 8404 1060] [client xx:43833] File "C:\Apache24\htdocs\ERPapp.venv\Lib\site-packages\django\template\engine.py", line 20, in init [Tue Oct 15 11:55:47.997506 2024] [wsgi ] [pid 8404 1060] [client xx:43833] RuntimeError: log object has expired