gpt4 book ai didi

django - 为 django 应用程序提供服务时出现 uwsgi 段错误

转载 作者:行者123 更新时间:2023-12-04 01:33:15 26 4
gpt4 key购买 nike

我正在尝试将 django 应用程序从一台服务器迁移到另一台服务器。该应用程序在旧服务器上运行良好。

在新服务器上,应用程序在使用 Django 的 runserver 时运行良好。

为了测试 uwsgi 下的 django 应用程序,我使用了

uwsgi --http :8000 --module mysite.wsgi

这会按预期打开 django 管理页面,但是一旦我尝试登录,uwsgi 就会收到如下段错误错误。

如果有人能帮助理解这意味着什么,以及我该如何解决这个问题,我们将不胜感激。
*** uWSGI is running in multiple interpreter mode ***
spawned uWSGI worker 1 (and the only) (pid: 15398, cores: 1)
!!! uWSGI process 15398 got Segmentation Fault !!!
*** backtrace of 15398 ***
uwsgi(uwsgi_backtrace+0x35) [0x5569e2f17555]
uwsgi(uwsgi_segfault+0x23) [0x5569e2f17903]
/lib/x86_64-linux-gnu/libc.so.6(+0x35fc0) [0x7f0dd221bfc0]
/home/vikas/ssersurvey/env/lib/python3.6/site-packages/psycopg2/.libs/./libssl-1d6df745.so.1.0.2p(ssl3_cleanup_key_block+0xb) [0x7f0dd0241cab]
/home/vikas/ssersurvey/env/lib/python3.6/site-packages/psycopg2/.libs/./libssl-1d6df745.so.1.0.2p(ssl3_clear+0x16) [0x7f0dd023f5a6]
/home/vikas/ssersurvey/env/lib/python3.6/site-packages/psycopg2/.libs/./libssl-1d6df745.so.1.0.2p(tls1_clear+0x9) [0x7f0dd024b219]
/usr/lib/x86_64-linux-gnu/libssl.so.1.1(SSL_new+0x43f) [0x7f0dd2bf376f]
/home/vikas/ssersurvey/env/lib/python3.6/site-packages/psycopg2/.libs/libpq-3a62a61f.so.5.11(+0x23969) [0x7f0dd04d6969]
/home/vikas/ssersurvey/env/lib/python3.6/site-packages/psycopg2/.libs/libpq-3a62a61f.so.5.11(+0x24fc5) [0x7f0dd04d7fc5]
/home/vikas/ssersurvey/env/lib/python3.6/site-packages/psycopg2/.libs/libpq-3a62a61f.so.5.11(PQconnectPoll+0xb78) [0x7f0dd04c1ba8]
/home/vikas/ssersurvey/env/lib/python3.6/site-packages/psycopg2/.libs/libpq-3a62a61f.so.5.11(+0xfa28) [0x7f0dd04c2a28]
/home/vikas/ssersurvey/env/lib/python3.6/site-packages/psycopg2/.libs/libpq-3a62a61f.so.5.11(PQconnectdb+0x1f) [0x7f0dd04c541f]
/home/vikas/ssersurvey/env/lib/python3.6/site-packages/psycopg2/_psycopg.cpython-36m-x86_64-linux-gnu.so(+0x12651) [0x7f0dd0716651]
/home/vikas/ssersurvey/env/lib/python3.6/site-packages/psycopg2/_psycopg.cpython-36m-x86_64-linux-gnu.so(+0x133df) [0x7f0dd07173df]
/usr/lib/x86_64-linux-gnu/libpython3.6m.so.1.0(+0x1fcab2) [0x7f0dd25d9ab2]
/usr/lib/x86_64-linux-gnu/libpython3.6m.so.1.0(_PyObject_FastCallDict+0x89) [0x7f0dd2645e99]
/usr/lib/x86_64-linux-gnu/libpython3.6m.so.1.0(_PyObject_CallFunction_SizeT+0x124) [0x7f0dd26468b4]
/home/vikas/ssersurvey/env/lib/python3.6/site-packages/psycopg2/_psycopg.cpython-36m-x86_64-linux-gnu.so(+0xc1a8) [0x7f0dd07101a8]
/usr/lib/x86_64-linux-gnu/libpython3.6m.so.1.0(PyCFunction_Call+0x96) [0x7f0dd25f0fe6]
/usr/lib/x86_64-linux-gnu/libpython3.6m.so.1.0(_PyEval_EvalFrameDefault+0x7940) [0x7f0dd2561f10]
/usr/lib/x86_64-linux-gnu/libpython3.6m.so.1.0(+0x17ba3f) [0x7f0dd2558a3f]
/usr/lib/x86_64-linux-gnu/libpython3.6m.so.1.0(PyEval_EvalCodeEx+0x3e) [0x7f0dd25594fe]
/usr/lib/x86_64-linux-gnu/libpython3.6m.so.1.0(+0x23cc63) [0x7f0dd2619c63]
/usr/lib/x86_64-linux-gnu/libpython3.6m.so.1.0(PyObject_Call+0x48) [0x7f0dd26466d8]
/usr/lib/x86_64-linux-gnu/libpython3.6m.so.1.0(_PyEval_EvalFrameDefault+0x3de5) [0x7f0dd255e3b5]
/usr/lib/x86_64-linux-gnu/libpython3.6m.so.1.0(+0x17a8a3) [0x7f0dd25578a3]
/usr/lib/x86_64-linux-gnu/libpython3.6m.so.1.0(+0x17c2eb) [0x7f0dd25592eb]
/usr/lib/x86_64-linux-gnu/libpython3.6m.so.1.0(_PyEval_EvalFrameDefault+0x4ec2) [0x7f0dd255f492]
/usr/lib/x86_64-linux-gnu/libpython3.6m.so.1.0(+0x17a8a3) [0x7f0dd25578a3]
/usr/lib/x86_64-linux-gnu/libpython3.6m.so.1.0(+0x17c2eb) [0x7f0dd25592eb]
/usr/lib/x86_64-linux-gnu/libpython3.6m.so.1.0(_PyEval_EvalFrameDefault+0x4ec2) [0x7f0dd255f492]
/usr/lib/x86_64-linux-gnu/libpython3.6m.so.1.0(+0x17a8a3) [0x7f0dd25578a3]
/usr/lib/x86_64-linux-gnu/libpython3.6m.so.1.0(+0x17c2eb) [0x7f0dd25592eb]
/usr/lib/x86_64-linux-gnu/libpython3.6m.so.1.0(_PyEval_EvalFrameDefault+0x4ec2) [0x7f0dd255f492]
/usr/lib/x86_64-linux-gnu/libpython3.6m.so.1.0(+0x17ba3f) [0x7f0dd2558a3f]
/usr/lib/x86_64-linux-gnu/libpython3.6m.so.1.0(+0x17c11e) [0x7f0dd255911e]
/usr/lib/x86_64-linux-gnu/libpython3.6m.so.1.0(_PyEval_EvalFrameDefault+0x4ec2) [0x7f0dd255f492]
/usr/lib/x86_64-linux-gnu/libpython3.6m.so.1.0(+0x17a8a3) [0x7f0dd25578a3]
/usr/lib/x86_64-linux-gnu/libpython3.6m.so.1.0(+0x17c2eb) [0x7f0dd25592eb]
/usr/lib/x86_64-linux-gnu/libpython3.6m.so.1.0(_PyEval_EvalFrameDefault+0x4ec2) [0x7f0dd255f492]
/usr/lib/x86_64-linux-gnu/libpython3.6m.so.1.0(+0x17ba3f) [0x7f0dd2558a3f]
/usr/lib/x86_64-linux-gnu/libpython3.6m.so.1.0(+0x17c11e) [0x7f0dd255911e]
/usr/lib/x86_64-linux-gnu/libpython3.6m.so.1.0(_PyEval_EvalFrameDefault+0x3c95) [0x7f0dd255e265]
/usr/lib/x86_64-linux-gnu/libpython3.6m.so.1.0(+0x2428a8) [0x7f0dd261f8a8]
/usr/lib/x86_64-linux-gnu/libpython3.6m.so.1.0(+0x239aa6) [0x7f0dd2616aa6]
/usr/lib/x86_64-linux-gnu/libpython3.6m.so.1.0(+0x239f6a) [0x7f0dd2616f6a]
/usr/lib/x86_64-linux-gnu/libpython3.6m.so.1.0(+0x1fcab2) [0x7f0dd25d9ab2]
/usr/lib/x86_64-linux-gnu/libpython3.6m.so.1.0(_PyObject_FastCallDict+0x89) [0x7f0dd2645e99]
/usr/lib/x86_64-linux-gnu/libpython3.6m.so.1.0(+0x17bee8) [0x7f0dd2558ee8]
/usr/lib/x86_64-linux-gnu/libpython3.6m.so.1.0(_PyEval_EvalFrameDefault+0x4ec2) [0x7f0dd255f492]
/usr/lib/x86_64-linux-gnu/libpython3.6m.so.1.0(+0x17a8a3) [0x7f0dd25578a3]
/usr/lib/x86_64-linux-gnu/libpython3.6m.so.1.0(+0x17c2eb) [0x7f0dd25592eb]
/usr/lib/x86_64-linux-gnu/libpython3.6m.so.1.0(_PyEval_EvalFrameDefault+0x4ec2) [0x7f0dd255f492]
/usr/lib/x86_64-linux-gnu/libpython3.6m.so.1.0(+0x17a8a3) [0x7f0dd25578a3]
/usr/lib/x86_64-linux-gnu/libpython3.6m.so.1.0(_PyFunction_FastCallDict+0x2c3) [0x7f0dd2558e43]
/usr/lib/x86_64-linux-gnu/libpython3.6m.so.1.0(_PyObject_FastCallDict+0x131) [0x7f0dd2645f41]
/usr/lib/x86_64-linux-gnu/libpython3.6m.so.1.0(_PyObject_Call_Prepend+0xcd) [0x7f0dd264666d]
/usr/lib/x86_64-linux-gnu/libpython3.6m.so.1.0(_PyObject_FastCallDict+0x89) [0x7f0dd2645e99]
/usr/lib/x86_64-linux-gnu/libpython3.6m.so.1.0(+0x6bb61) [0x7f0dd2448b61]
/usr/lib/x86_64-linux-gnu/libpython3.6m.so.1.0(+0x1f5f65) [0x7f0dd25d2f65]
/usr/lib/x86_64-linux-gnu/libpython3.6m.so.1.0(+0x186ff9) [0x7f0dd2563ff9]
/usr/lib/x86_64-linux-gnu/libpython3.6m.so.1.0(_PyCFunction_FastCallDict+0x13a) [0x7f0dd25f0d6a]
/usr/lib/x86_64-linux-gnu/libpython3.6m.so.1.0(+0x17c20c) [0x7f0dd255920c]
/usr/lib/x86_64-linux-gnu/libpython3.6m.so.1.0(_PyEval_EvalFrameDefault+0x4ec2) [0x7f0dd255f492]
*** end of backtrace ***

最佳答案

当针对两个不同的 openssl 版本编译 uwsgi 和 psycopg 时,会发生此错误。
你有两个解决方案。

  • 禁用 django 数据库配置的 ssl(其他答案的解决方案)
  • 从源安装 psyocpg2 而不是轮子

  • 要从源代码安装 psyocpg2,您必须卸载前一个并尝试此操作
    pip uninstall psycopg2
    pip install --no-binary :all: psycopg2

    关于django - 为 django 应用程序提供服务时出现 uwsgi 段错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/53498240/

    26 4 0
    Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
    广告合作:1813099741@qq.com 6ren.com