【问题标题】:RuntimeError("populate() isn't reentrant") on elastic beanstalk弹性豆茎上的 RuntimeError("populate() is not reentrant")
【发布时间】:2019-10-23 03:12:47
【问题描述】:

我在 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

对调试有什么建议吗?到目前为止,我试图理解它/谷歌它没有成功。

【问题讨论】:

    标签: python django amazon-elastic-beanstalk


    【解决方案1】:

    这通常发生在解释器无法加载源代码(前提是您已经运行)或(如果您正在部署)它指出了一个配置问题,主要与尝试加载相同解释器的线程数有关。

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

    【讨论】:

    • 感谢@t.stv - 事实证明这最终不是由代码引起的,而是由数据库问题引起的。强行迁移数据库后,我重新构建了应用程序,一切都很好。
    • @goose 能否请您详细介绍一下数据库问题?
    猜你喜欢
    • 2020-08-10
    • 2018-12-26
    • 2016-01-13
    • 2015-04-02
    • 2013-05-25
    • 2019-04-21
    • 2015-03-20
    • 2014-12-22
    • 2021-05-15
    相关资源
    最近更新 更多