gpt4 book ai didi

Python 3.2 - uWSGI 进程出现段错误

转载 作者:行者123 更新时间:2023-12-04 14:09:12 24 4
gpt4 key购买 nike

简介:

它是一个使用 Python 3.2、NGINX 和 uWSGI 的 Web 应用程序环境。

Python 3.2、NGINX 和 uWSGI 组件是通过构建和安装(“./configure”、“make”和“make install”)安装的,它们使用的 OpenSSL 1.0.X 也是通过构建和安装安装的。

该应用程序在 Ubuntu 20.04 LTS 上运行。

问题:

应用程序无法启动,uWSGI 日志显示以下信息...

Thu Jan 21 21:44:37 2021 - Respawned uWSGI worker 4 (new pid: 99572)
Thu Jan 21 21:44:37 2021 - worker 3 buried after 0 seconds
Thu Jan 21 21:44:37 2021 - worker 7 buried after 0 seconds
Thu Jan 21 21:44:37 2021 - worker 1 buried after 0 seconds
Thu Jan 21 21:44:37 2021 - worker 8 buried after 0 seconds
Thu Jan 21 21:44:37 2021 - worker 5 buried after 0 seconds
Thu Jan 21 21:44:37 2021 - received message 0 from emperor
Thu Jan 21 21:44:37 2021 - SIGINT/SIGQUIT received...killing workers...
Thu Jan 21 21:44:37 2021 - mem-collector thread started for worker 4
Thu Jan 21 21:44:37 2021 - !!! uWSGI process 99543 got Segmentation Fault !!!
Thu Jan 21 21:44:37 2021 - *** backtrace of 99543 ***
/usr/local/lb/uwsgi_ve32/bin/uwsgi(uwsgi_backtrace+0x2e) [0x556d323f077e]
/usr/local/lb/uwsgi_ve32/bin/uwsgi(uwsgi_segfault+0x27) [0x556d323f0b67]
/lib/x86_64-linux-gnu/libc.so.6(+0x46210) [0x7f60a0f33210]
/lib/x86_64-linux-gnu/libc.so.6(+0x186b7e) [0x7f60a1073b7e]
/usr/local/ssl/lib/libcrypto.so.1.0.0(+0x12254c) [0x7f60a147054c]
/usr/local/ssl/lib/libcrypto.so.1.0.0(lh_insert+0x56) [0x7f60a14707e6]
/usr/local/ssl/lib/libcrypto.so.1.0.0(OBJ_NAME_add+0x74) [0x7f60a13bbc84]
/lib/x86_64-linux-gnu/libssl.so.1.1(+0x36392) [0x7f60a0067392]
/lib/x86_64-linux-gnu/libpthread.so.0(+0x1247f) [0x7f60a181547f]
/lib/x86_64-linux-gnu/libcrypto.so.1.1(CRYPTO_THREAD_run_once+0xd) [0x7f609ff3d78d]
/lib/x86_64-linux-gnu/libssl.so.1.1(OPENSSL_init_ssl+0x5b) [0x7f60a006757b]
/lib/x86_64-linux-gnu/libpq.so.5(+0x26304) [0x7f60a00ea304]
/lib/x86_64-linux-gnu/libpq.so.5(PQconnectPoll+0xe80) [0x7f60a00d4ec0]
/lib/x86_64-linux-gnu/libpq.so.5(+0x11fd7) [0x7f60a00d5fd7]
/lib/x86_64-linux-gnu/libpq.so.5(PQconnectdb+0x38) [0x7f60a00d9048]
/usr/local/lb/lbg_ve32/lib/python3.2/site-packages/psycopg2/_psycopg.cpython-32m.so(+0x10939) [0x7f60a012e939]
/usr/local/lb/lbg_ve32/lib/python3.2/site-packages/psycopg2/_psycopg.cpython-32m.so(+0x117a2) [0x7f60a012f7a2]
/usr/local/lb/py32/lib/libpython3.2m.so.1.0(+0xab58c) [0x7f60a11c558c]
/usr/local/lb/py32/lib/libpython3.2m.so.1.0(PyObject_Call+0x5b) [0x7f60a1174dcb]
/usr/local/lb/py32/lib/libpython3.2m.so.1.0(_PyObject_CallFunction_SizeT+0xd2) [0x7f60a1175192]
/usr/local/lb/lbg_ve32/lib/python3.2/site-packages/psycopg2/_psycopg.cpython-32m.so(+0xbace) [0x7f60a0129ace]
/usr/local/lb/py32/lib/libpython3.2m.so.1.0(PyEval_EvalFrameEx+0x76e3) [0x7f60a1210b53]
/usr/local/lb/py32/lib/libpython3.2m.so.1.0(PyEval_EvalCodeEx+0x733) [0x7f60a12115e3]
/usr/local/lb/py32/lib/libpython3.2m.so.1.0(+0x81f92) [0x7f60a119bf92]
/usr/local/lb/py32/lib/libpython3.2m.so.1.0(PyObject_Call+0x5b) [0x7f60a1174dcb]
/usr/local/lb/py32/lib/libpython3.2m.so.1.0(PyEval_EvalFrameEx+0xfb9) [0x7f60a120a429]
/usr/local/lb/py32/lib/libpython3.2m.so.1.0(PyEval_EvalCodeEx+0x733) [0x7f60a12115e3]
/usr/local/lb/py32/lib/libpython3.2m.so.1.0(+0x81f92) [0x7f60a119bf92]
/usr/local/lb/py32/lib/libpython3.2m.so.1.0(PyObject_Call+0x5b) [0x7f60a1174dcb]
/usr/local/lb/py32/lib/libpython3.2m.so.1.0(PyEval_EvalFrameEx+0xfb9) [0x7f60a120a429]
/usr/local/lb/py32/lib/libpython3.2m.so.1.0(PyEval_EvalCodeEx+0x733) [0x7f60a12115e3]
/usr/local/lb/py32/lib/libpython3.2m.so.1.0(PyEval_EvalFrameEx+0x65f1) [0x7f60a120fa61]
/usr/local/lb/py32/lib/libpython3.2m.so.1.0(PyEval_EvalFrameEx+0x670c) [0x7f60a120fb7c]
/usr/local/lb/py32/lib/libpython3.2m.so.1.0(PyEval_EvalCodeEx+0x733) [0x7f60a12115e3]
/usr/local/lb/py32/lib/libpython3.2m.so.1.0(+0x81eaf) [0x7f60a119beaf]
/usr/local/lb/py32/lib/libpython3.2m.so.1.0(PyObject_Call+0x5b) [0x7f60a1174dcb]
/usr/local/lb/py32/lib/libpython3.2m.so.1.0(+0x7033c) [0x7f60a118a33c]
/usr/local/lb/py32/lib/libpython3.2m.so.1.0(PyObject_Call+0x5b) [0x7f60a1174dcb]
/usr/local/lb/py32/lib/libpython3.2m.so.1.0(+0xacf47) [0x7f60a11c6f47]
/usr/local/lb/py32/lib/libpython3.2m.so.1.0(+0xab58c) [0x7f60a11c558c]
/usr/local/lb/py32/lib/libpython3.2m.so.1.0(PyObject_Call+0x5b) [0x7f60a1174dcb]
/usr/local/lb/py32/lib/libpython3.2m.so.1.0(PyEval_EvalFrameEx+0x4106) [0x7f60a120d576]
/usr/local/lb/py32/lib/libpython3.2m.so.1.0(PyEval_EvalFrameEx+0x670c) [0x7f60a120fb7c]
/usr/local/lb/py32/lib/libpython3.2m.so.1.0(PyEval_EvalFrameEx+0x670c) [0x7f60a120fb7c]
/usr/local/lb/py32/lib/libpython3.2m.so.1.0(PyEval_EvalCodeEx+0x733) [0x7f60a12115e3]
/usr/local/lb/py32/lib/libpython3.2m.so.1.0(PyEval_EvalFrameEx+0x65f1) [0x7f60a120fa61]
/usr/local/lb/py32/lib/libpython3.2m.so.1.0(PyEval_EvalCodeEx+0x733) [0x7f60a12115e3]
/usr/local/lb/py32/lib/libpython3.2m.so.1.0(PyEval_EvalFrameEx+0x65f1) [0x7f60a120fa61]
/usr/local/lb/py32/lib/libpython3.2m.so.1.0(PyEval_EvalFrameEx+0x670c) [0x7f60a120fb7c]
/usr/local/lb/py32/lib/libpython3.2m.so.1.0(PyEval_EvalCodeEx+0x733) [0x7f60a12115e3]
/usr/local/lb/py32/lib/libpython3.2m.so.1.0(PyEval_EvalFrameEx+0x65f1) [0x7f60a120fa61]
/usr/local/lb/py32/lib/libpython3.2m.so.1.0(PyEval_EvalFrameEx+0x670c) [0x7f60a120fb7c]
/usr/local/lb/py32/lib/libpython3.2m.so.1.0(PyEval_EvalCodeEx+0x733) [0x7f60a12115e3]
/usr/local/lb/py32/lib/libpython3.2m.so.1.0(PyEval_EvalFrameEx+0x65f1) [0x7f60a120fa61]
/usr/local/lb/py32/lib/libpython3.2m.so.1.0(PyEval_EvalCodeEx+0x733) [0x7f60a12115e3]
/usr/local/lb/py32/lib/libpython3.2m.so.1.0(+0x81f92) [0x7f60a119bf92]
/usr/local/lb/py32/lib/libpython3.2m.so.1.0(PyObject_Call+0x5b) [0x7f60a1174dcb]
/usr/local/lb/py32/lib/libpython3.2m.so.1.0(PyEval_EvalFrameEx+0xfb9) [0x7f60a120a429]
/usr/local/lb/py32/lib/libpython3.2m.so.1.0(PyEval_EvalCodeEx+0x733) [0x7f60a12115e3]
/usr/local/lb/py32/lib/libpython3.2m.so.1.0(PyEval_EvalFrameEx+0x65f1) [0x7f60a120fa61]
/usr/local/lb/py32/lib/libpython3.2m.so.1.0(PyEval_EvalFrameEx+0x670c) [0x7f60a120fb7c]
/usr/local/lb/py32/lib/libpython3.2m.so.1.0(PyEval_EvalCodeEx+0x733) [0x7f60a12115e3]
/usr/local/lb/py32/lib/libpython3.2m.so.1.0(+0x81eaf) [0x7f60a119beaf]
/usr/local/lb/py32/lib/libpython3.2m.so.1.0(PyObject_Call+0x5b) [0x7f60a1174dcb]
*** end of backtrace ***

重要提示:

似乎该应用程序将 OpenSSL 1.0.X 组件与 OpenSSL 1.1.X 组件“混合”...

/usr/local/ssl/lib/libcrypto.so.1.0.0(+0x12254c) [0x7f60a147054c]
/usr/local/ssl/lib/libcrypto.so.1.0.0(lh_insert+0x56) [0x7f60a14707e6]
/usr/local/ssl/lib/libcrypto.so.1.0.0(OBJ_NAME_add+0x74) [0x7f60a13bbc84]
/lib/x86_64-linux-gnu/libssl.so.1.1(+0x36392) [0x7f60a0067392]
/lib/x86_64-linux-gnu/libcrypto.so.1.1(CRYPTO_THREAD_run_once+0xd) [0x7f609ff3d78d]
/lib/x86_64-linux-gnu/libssl.so.1.1(OPENSSL_init_ssl+0x5b) [0x7f60a006757b]

这个问题我真的需要帮助...我已经尝试了一切!

谢谢! =D

最佳答案

原因: 大多数现代版本的 Ubuntu Server 都将 PostgreSQL 9.4 配置为使用 ssl - tls 实际上 - 在 1.0 版以上的版本中与使用 OpenSSL 获取 ssl 资源的 Python 3.2 不兼容。当 Python 3.2 尝试使用 ssl 连接到 PostgreSQL 9.4 时,第一个使用的某些库 (psycopg2?) 会尝试加载与客户端兼容的更现代版本的 OpenSSL ,然后应用程序开始使用两个不同版本的 OpenSSL 运行 - 其中一个与 Python 3.2 不兼容 - 这会导致应用程序加载出现段错误错误。

解决方案:我们可以将 PostgreSQL 9.4 与 1.0 版本的 ssl 一起使用,或者禁用此功能。我们选择禁用“ssl”。下面的过程将 PostgreSQL 9.4 配置为不使用 ssl 建立连接,就像在使用 PostgreSQL 9.4 的旧版本发行版中所做的那样。

程序:

打开文件 /var/lib/pgsql/9.4/data/postgresql.conf - 路径可能不同 - 然后注释掉这些行:

ssl = on #(更改需要重启)

... , ...

ssl_cert_file = '/etc/ssl/certs/ssl-cert-snakeoil.pem' #(更改需要重启)

...和...

ssl_key_file = '/etc/ssl/private/ssl-cert-snakeoil.key' #(更改需要重启)

重新启动 Python 3.2 应用程序和 PostgreSQL 9.4。

对于 PostgreSQL 9.4,可以使用以下命令重新启动它...

systemctl stop postgresql
sleep 2
systemctl start postgresql

完成!谢谢! =D

关于Python 3.2 - uWSGI 进程出现段错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/65838013/

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