【急】django + uwsgi 发送电子邮件问题 20C

服务器系统:

CentOS release 6.8 (Final)

python信息:

Python 3.7.2

uwsgi信息

2.0.18

框架:

Django 2.1

问题:python的ssl是可以的,通过runserver是可以发送电子邮件的,但是当放入uwsgi环境里面不行,报错信息如下:

!!! uWSGI process 10068 got Segmentation Fault !!!
*** backtrace of 10068 ***
/usr/local/python3/bin/uwsgi(uwsgi_backtrace+0x29) [0x4c0309]
/usr/local/python3/bin/uwsgi(uwsgi_segfault+0x21) [0x4c0491]
/lib64/libc.so.6(+0x32510) [0x7ff68abd0510]
/usr/lib64/libcrypto.so.1.0.0(X509_VERIFY_PARAM_set_hostflags+0x4) [0x7ff682c60d54]
/home/python_envs/operation/lib/python3.7/lib-dynload/_ssl.cpython-37m-x86_64-linux-gnu.so(+0xef37) [0x7ff681238f37]
/usr/local/python3/bin/uwsgi() [0x54e2a8]
/usr/local/python3/bin/uwsgi(_PyMethodDef_RawFastCallKeywords+0x248) [0x50db38]
/usr/local/python3/bin/uwsgi(_PyCFunction_FastCallKeywords+0x23) [0x50e9d3]
/usr/local/python3/bin/uwsgi(_PyEval_EvalFrameDefault+0x4807) [0x591147]
/usr/local/python3/bin/uwsgi(_PyEval_EvalCodeWithName+0x1ba) [0x595afa]
/usr/local/python3/bin/uwsgi(_PyFunction_FastCallDict+0x144) [0x50e4b4]
/usr/local/python3/bin/uwsgi(_PyObject_Call_Prepend+0x8b) [0x50f58b]
/usr/local/python3/bin/uwsgi() [0x54d304]
/usr/local/python3/bin/uwsgi() [0x54f0b3]
/usr/local/python3/bin/uwsgi(_PyObject_FastCallKeywords+0x9e) [0x50ea8e]
/usr/local/python3/bin/uwsgi(_PyEval_EvalFrameDefault+0x46e5) [0x591025]
/usr/local/python3/bin/uwsgi(_PyEval_EvalCodeWithName+0x51f) [0x595e5f]
/usr/local/python3/bin/uwsgi(_PyFunction_FastCallKeywords+0x100) [0x50e2a0]
/usr/local/python3/bin/uwsgi(_PyEval_EvalFrameDefault+0x1404) [0x58dd44]
/usr/local/python3/bin/uwsgi(_PyEval_EvalCodeWithName+0x1ba) [0x595afa]
/usr/local/python3/bin/uwsgi(_PyFunction_FastCallDict+0x3ab) [0x50e71b]
/usr/local/python3/bin/uwsgi(_PyObject_Call_Prepend+0x8b) [0x50f58b]
/usr/local/python3/bin/uwsgi() [0x552721]
/usr/local/python3/bin/uwsgi() [0x54f10b]
/usr/local/python3/bin/uwsgi(PyObject_Call+0x52) [0x50fae2]
/usr/local/python3/bin/uwsgi(_PyEval_EvalFrameDefault+0x1d30) [0x58e670]
/usr/local/python3/bin/uwsgi() [0x50e0da]
/usr/local/python3/bin/uwsgi(_PyEval_EvalFrameDefault+0x86c) [0x58d1ac]
/usr/local/python3/bin/uwsgi() [0x50e0da]
/usr/local/python3/bin/uwsgi(_PyEval_EvalFrameDefault+0x86c) [0x58d1ac]
/usr/local/python3/bin/uwsgi(_PyEval_EvalCodeWithName+0x1ba) [0x595afa]
/usr/local/python3/bin/uwsgi(_PyFunction_FastCallKeywords+0x100) [0x50e2a0]
/usr/local/python3/bin/uwsgi(_PyEval_EvalFrameDefault+0x86c) [0x58d1ac]
/usr/local/python3/bin/uwsgi(_PyEval_EvalCodeWithName+0x1ba) [0x595afa]
/usr/local/python3/bin/uwsgi(_PyFunction_FastCallKeywords+0x100) [0x50e2a0]
/usr/local/python3/bin/uwsgi(_PyEval_EvalFrameDefault+0x1404) [0x58dd44]
/usr/local/python3/bin/uwsgi() [0x50e0da]
/usr/local/python3/bin/uwsgi(_PyFunction_FastCallDict+0x3fb) [0x50e76b]
/usr/local/python3/bin/uwsgi(_PyEval_EvalFrameDefault+0x1d30) [0x58e670]
/usr/local/python3/bin/uwsgi() [0x50e0da]
/usr/local/python3/bin/uwsgi(_PyEval_EvalFrameDefault+0x69e) [0x58cfde]
/usr/local/python3/bin/uwsgi(_PyEval_EvalCodeWithName+0x1ba) [0x595afa]
/usr/local/python3/bin/uwsgi(_PyFunction_FastCallKeywords+0x100) [0x50e2a0]
/usr/local/python3/bin/uwsgi(_PyEval_EvalFrameDefault+0x459a) [0x590eda]
/usr/local/python3/bin/uwsgi() [0x50e0da]
/usr/local/python3/bin/uwsgi(_PyFunction_FastCallDict+0x75) [0x50e3e5]
/usr/local/python3/bin/uwsgi(_PyObject_Call_Prepend+0x8b) [0x50f58b]
/usr/local/python3/bin/uwsgi() [0x54c2c4]
/usr/local/python3/bin/uwsgi(_PyObject_FastCallKeywords+0x9e) [0x50ea8e]
/usr/local/python3/bin/uwsgi(_PyEval_EvalFrameDefault+0x46e5) [0x591025]
/usr/local/python3/bin/uwsgi(_PyEval_EvalCodeWithName+0x1ba) [0x595afa]
/usr/local/python3/bin/uwsgi(_PyFunction_FastCallKeywords+0x100) [0x50e2a0]
/usr/local/python3/bin/uwsgi(_PyEval_EvalFrameDefault+0x459a) [0x590eda]
/usr/local/python3/bin/uwsgi() [0x50e0da]
/usr/local/python3/bin/uwsgi(_PyFunction_FastCallDict+0x75) [0x50e3e5]
/usr/local/python3/bin/uwsgi(_PyObject_Call_Prepend+0x8b) [0x50f58b]
/usr/local/python3/bin/uwsgi() [0x54c2c4]
/usr/local/python3/bin/uwsgi(_PyObject_FastCallKeywords+0x9e) [0x50ea8e]
/usr/local/python3/bin/uwsgi(_PyEval_EvalFrameDefault+0x46e5) [0x591025]
/usr/local/python3/bin/uwsgi(_PyEval_EvalCodeWithName+0x1ba) [0x595afa]
/usr/local/python3/bin/uwsgi(_PyFunction_FastCallKeywords+0x100) [0x50e2a0]
/usr/local/python3/bin/uwsgi(_PyEval_EvalFrameDefault+0x459a) [0x590eda]
/usr/local/python3/bin/uwsgi() [0x50e0da]
/usr/local/python3/bin/uwsgi(_PyFunction_FastCallDict+0x75) [0x50e3e5]
*** end of backtrace ***
DAMN ! worker 6 (pid: 10068) died :( trying respawn ...
Respawned uWSGI worker 6 (new pid: 12244)
WSGI app 0 (mountpoint='') ready in 0 seconds on interpreter 0x1b927b0 pid: 12244 (default app)

uwsgi配置如下:

# uwsig使用配置文件启动
[uwsgi]

# 项目目录
uid = root
chdir = /home/wwwroot/operation/operation
# 指定项目的application
module= operation.wsgi:application

virtualenv = /home/python_envs/operation/
#home = /home/python_envs/operation/

touch-reload= /home/wwwroot/operation/operation

# 指定sock的文件路径
#socket=127.0.0.1:9092
socket=/run/uwsgi/operation.socket
# 进程个数
processes = 4
workers=8
# 指定静态文件
#istatic-map=/static=/hostatic
# 启用主进程
master=true
# 自动移除unix Socket和pid文件当服务停止的时候
vacuum=true
# 序列化接受的内容,如果可能的话
enable-threads = true
enable-threads=true
lazy=true
vacuum = true
thunder-lock=true
# 启用线程
enable-threads=true
#threads=20
# 设置自中断时间
harakiri-verbose = true
harakiri=300

http-keepalive = 1
add-header = Connection: Keep-Alive
disable-logging = true

reload-mercy = 5
vacuum = true         //退出、重启时清理文件
max-requests = 500
limit-as = 65535
buffer-size = 68718428160

# 设置缓冲
post-buffering=4096
# 设置日志目录
daemonize=/home/wwwlogs/operation.log
disable-logging=/home/wwwlogs/operation_error.log
# 保存uwsgi的状态
stats=/run/uwsgi/operation.status
# 进程id,用于重启,停止uwsgi
pidfile=/run/uwsgi/operation.pid
env LANG="en_US.UTF-8"
env LANGUAGE="en_US.UTF-8"

Csdn user default icon
上传中...
上传图片
插入图片
抄袭、复制答案,以达到刷声望分或其他目的的行为,在CSDN问答是严格禁止的,一经发现立刻封号。是时候展现真正的技术了!
立即提问