弹性beanstalk上的RuntimeError(“ populate()不重入”)

时间:2019-10-22 17:53:02

标签: python django amazon-elastic-beanstalk

我在Elastic Beanstalk上运行django,并且在推送新版本的应用程序后,我收到500个内部服务器错误。

日志显示如下:

     apps.populate(settings.INSTALLED_APPS)
   File "/opt/python/run/venv/local/lib/python3.6/site-packages/django/apps/registry.py", line 83, in populate
     raise RuntimeError("populate() isn't reentrant")
 RuntimeError: populate() isn't reentrant
 mod_wsgi (pid=21994): Target WSGI script '/opt/python/current/app/wsgi.py' cannot be loaded as Python module.
 mod_wsgi (pid=21994): Exception occurred processing WSGI script '/opt/python/current/app/wsgi.py'.
 Traceback (most recent call last):
   File "/opt/python/current/app/wsgi.py", line 16, in <module>
     application = get_wsgi_application()
   File "/opt/python/run/venv/local/lib/python3.6/site-packages/django/core/wsgi.py", line 12, in get_wsgi_application
     django.setup(set_prefix=False)
   File "/opt/python/run/venv/local/lib/python3.6/site-packages/django/__init__.py", line 24, in setup

是否有调试建议?到目前为止,我尝试了解它/谷歌搜索均未成功。

1 个答案:

答案 0 :(得分:0)

通常会在解释器无法加载源(假设您正在运行源)或(如果正在部署)解释器指出与大多数尝试加载同一解释器的线程数量有关的配置问题时发生。

我建议您对运行该应用程序的服务进行硬重启。这很可能会解决它。如果错误仍然存​​在,请检查您的wsgi配置。