【问题标题】:NameError: name 'TypeError' is not defined in Apache logsNameError:名称“TypeError”未在 Apache 日志中定义
【发布时间】:2021-04-20 02:39:02
【问题描述】:

我的 apache 错误日志充满了这个重复的错误消息。虽然我的应用程序运行良好并且 apache 继续为其提供服务,但我无法找到其他错误的原因,因为出于某种原因,这是唯一被记录的内容。

我的应用是一个运行 apache2 和 mod-wsgi 的 Django 应用

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__

【问题讨论】:

    标签: django django-models django-views django-templates mod-wsgi


    【解决方案1】:

    在我从 Django2 迁移到 Django3(并升级其他包和工具)之后,这也开始发生在我身上。大多数情况下,我在重新启动 Apache 时注意到它。

    好像和mod-wsgi有关,在挖了一些其他网站后发现添加了

    WSGIApplicationGroup %{GLOBAL}
    

    在我的 Apache .conf 文件中添加 WSGIScriptAlias、WSGIDaemonProcess 和 WSGIProcessGroup 设置解决了该错误。

    我找到了一个调试参考here,它参考了更多文档。

    【讨论】:

    • 这解决了我的问题。谢谢!
    猜你喜欢
    • 2018-09-15
    • 2021-03-09
    • 1970-01-01
    • 1970-01-01
    • 2020-04-20
    • 2013-11-24
    • 2018-01-24
    • 1970-01-01
    相关资源
    最近更新 更多