NameError: name 'TypeError' is not defined in Apache logs

Viewed 1599

My apache error logs are full of this repeating error message. While my app works fine and apache continues to serve it I am unable to find the cause of other errors because for some reason this is the only thing being logged.

My app is a Django app running apache2 and mod-wsgi

NameError: name 'TypeError' is not defined
Exception ignored in: <function BaseEventLoop.__del__ at 0x7fefd6b13040>
Traceback (most recent call last):
  File "/usr/lib/python3.8/asyncio/base_events.py", line 654, in __del__
NameError: name 'ResourceWarning' is not defined
Exception ignored in: <function Local.__del__ at 0x7fefd6b0b430>
Traceback (most recent call last):
  File "/srv/example/env/lib/python3.8/site-packages/asgiref/local.py", line 96, in __del__
1 Answers

This began happening for me as well after I moved from Django2 to Django3 (and upgrading other packages and tools). Mostly, I noticed it on restarting Apache.

It appears to be related to mod-wsgi, and after digging into some other sites, I found that adding

WSGIApplicationGroup %{GLOBAL}

to my Apache .conf files atop addition the WSGIScriptAlias, WSGIDaemonProcess, and WSGIProcessGroup settings resolved the error.

I found a debugging reference here, which references further documentation.

Related