首页 > 解决方案 > uWSGI Segmentation Fault 阻止 Web 服务器运行

问题描述

我目前正在通过两个容器运行 Web 服务器:

运行时docker-compose up --build,一切都会正确编译,直到 uWSGI 引发分段错误。

....
django3_1  | Python main interpreter initialized at 0x7fd7bce0d190
django3_1  | python threads support enabled
django3_1  | your server socket listen backlog is limited to 100 connections
django3_1  | your mercy for graceful operations on workers is 60 seconds
django3_1  | mapped 145840 bytes (142 KB) for 1 cores
django3_1  | *** Operational MODE: single process ***
django3_1  | !!! uWSGI process 7 got Segmentation Fault !!!
test_django3_1 exited with code 1

如果有任何建议,我将不胜感激,因为在容器启动时我无法查看容器以进行调试,因此我不知道这个分段错误发生在哪里。

SSL 证书已正确设置。

标签: djangodockerdocker-composeuwsgiwsgi

解决方案


django3 容器在 python:3.9-alpine 映像上运行。这会在容器上安装 Python 3.9.2。在这个版本上,uWSGI 和 Python 依赖项之间似乎存在一些问题。将容器回滚到 python:3.8-alpine 解决了依赖版本不匹配的问题。


推荐阅读