我在 apache 网络服务器上运行 django 应用程序。此应用程序使用 django.contrib 包,特别是 django.contrib.gis.geos。
现在有时这在几周内效果很好,但每天都会崩溃多次,似乎与用户交互没有直接关系。
日志显示:
Traceback (most recent call last):
File "[...]/lib/python3.4/site-packages/django/contrib/gis/ptr.py", line 37, in __del__
NameError: name 'AttributeError' is not defined
[...] Exception ignored in: Exception ignored in: Exception ignored in: <bound method _WKBReader.__del__ of <django.contrib.gis.geos.prototypes.io._WKBReader object at 0x7ff4c2f92a58>>
我已经缩短了巨大的Exception ignored in:
s 链。在此之后,apache 在重新启动之前将不再提供任何请求,但仍然作为守护进程保持活动状态。
我不确定哪条线是造成这个错误的原因。但我发现了这个:
https ://docs.djangoproject.com/en/2.2/ref/contrib/gis/geos/#creating-a-geometry
在“我的日志充满了与 GEOS 相关的错误”下,它说这可能通过不在顶层创建任何 GEOS 对象来避免,所以我试图清除这些事件,但它没有帮助。此外,这似乎很奇怪,NameError: name 'AttributeError' is not defined
这可能暗示了这个问题的根源?
如果你不知道如何立即解决这个问题,你能给我一些关于如何避免它的见解吗?根本不使用这个包是可能的,但我真的想把它作为最后的手段。
谢谢你的帮助。