sapicd / sapic

sapic(picbed) - 基于Flask的Web自建图床,可存储到又拍云、七牛云、阿里云OSS、腾讯云COS、GitHub、Gitee、S3等,支持自定义扩展。
https://sapic.rtfd.vip
BSD 3-Clause "New" or "Revised" License
439 stars 58 forks source link

docker compose启动报错:ImportError: Error loading shared library libstdc++.so.6 #22

Closed hiBlunt closed 1 year ago

hiBlunt commented 1 year ago

git clone本项目后,使用docker compose up -d启动,发现容器报错。docker logs查看报错信息如下:

[Traceback (most recent call last):
  File "/root/.local/lib/python3.7/site-packages/gunicorn/workers/ggevent.py", line 13, in <module>
    import gevent
  File "/root/.local/lib/python3.7/site-packages/gevent/__init__.py", line 86, in <module>
    from gevent._hub_local import get_hub
  File "/root/.local/lib/python3.7/site-packages/gevent/_hub_local.py", line 101, in <module>
    import_c_accel(globals(), 'gevent.__hub_local')
  File "/root/.local/lib/python3.7/site-packages/gevent/_util.py", line 148, in import_c_accel
    mod = importlib.import_module(cname)
  File "/usr/local/lib/python3.7/importlib/__init__.py", line 127, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "src/gevent/_hub_local.py", line 1, in init gevent._gevent_c_hub_local
  File "/root/.local/lib/python3.7/site-packages/greenlet/__init__.py", line 29, in <module>
    from ._greenlet import _C_API # pylint:disable=no-name-in-module
ImportError: Error loading shared library libstdc++.so.6: No such file or directory (needed by /root/.local/lib/python3.7/site-packages/greenlet/_greenlet.cpython-37m-x86_64-linux-gnu.so)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/root/.local/lib/python3.7/site-packages/gunicorn/util.py", line 99, in load_class
    mod = importlib.import_module('.'.join(components))
  File "/usr/local/lib/python3.7/importlib/__init__.py", line 127, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 1006, in _gcd_import
  File "<frozen importlib._bootstrap>", line 983, in _find_and_load
  File "<frozen importlib._bootstrap>", line 967, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 677, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 728, in exec_module
  File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
  File "/root/.local/lib/python3.7/site-packages/gunicorn/workers/ggevent.py", line 15, in <module>
    raise RuntimeError("gevent worker requires gevent 1.4 or higher")
RuntimeError: gevent worker requires gevent 1.4 or higher
]
staugur commented 1 year ago

请问下你的操作系统版本和Python版本

hiBlunt commented 1 year ago

操作系统:debian11 python版本:3.9.2 docker版本:20.10.22 docker compose版本:2.14.1 PS:我测试过直接源代码安装没有问题,但使用docker compose无法启动。另外根据我的研究,问题根本原因是Dockerfile使用的alpine镜像默认编译器是musl。如果您方便的话,请重新clone代码,并docker compose up -d启动,测试能否复现问题。

staugur commented 1 year ago

好的,我正好有一个Debian,晚点试下。


该邮件从移动设备发送

--------------原始邮件-------------- 发件人:"blunt @.>; 发送时间:2022年12月25日(星期天) 下午2:18 收件人:"sapicd/sapic" @.>; 抄送:"me @.>;"Comment @.>; 主题:Re: [sapicd/sapic] docker compose启动报错:ImportError: Error loading shared library libstdc++.so.6 (Issue #22)

操作系统:debian11 python版本:3.9.2 docker版本:20.10.22 docker compose版本:2.14.1 PS:我测试过直接源代码安装没有问题,但使用docker compose无法启动。另外根据我的研究,问题根本原因是Dockerfile使用的alpine镜像默认编译器是musl。如果您方便的话,请重新clone代码,并docker compose up -d启动,测试能否复现问题。

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you commented.Message ID: @.***>

staugur commented 1 year ago

复现了,已合并,多谢!