chatgpt-on-wechat
chatgpt-on-wechat copied to clipboard
微信公众号接入,启动报错。OSError: No socket could be created -- (('0.0.0.0', 80): [Errno 13] Permission denied)
前置确认
- [X] 我确认我运行的是最新版本的代码,并且安装了所需的依赖,在FAQS中也未找到类似问题。
⚠️ 搜索issues中是否已存在类似问题
- [X] 我已经搜索过issues和disscussions,没有跟我遇到的问题相关的issue
操作系统类型?
Linux
运行的python版本是?
python 3.10
使用的chatgpt-on-wechat版本是?
Latest Release
运行的channel
类型是?
wechatmp(公众号, 订阅号)
复现步骤 🕹
使用nohup python3 app.py启动服务时报错: [INFO][2024-02-19 15:07:57][tool.py:28] - [tool] inited [INFO][2024-02-19 15:07:57][role.py:69] - [Role] inited [INFO][2024-02-19 15:07:57][dungeon.py:56] - [Dungeon] inited [INFO][2024-02-19 15:07:57][hello.py:24] - [Hello] inited [INFO][2024-02-19 15:07:57][finish.py:23] - [Finish] inited http://0.0.0.0:80/ [ERROR][2024-02-19 15:07:57][app.py:66] - App startup failed! [ERROR][2024-02-19 15:07:57][app.py:67] - No socket could be created -- (('0.0.0.0', 80): [Errno 13] Permission denied) Traceback (most recent call last): File "/home/lighthouse/chatgpt-on-wechat/app.py", line 61, in run start_channel(channel_name) File "/home/lighthouse/chatgpt-on-wechat/app.py", line 40, in start_channel channel.startup() File "/home/lighthouse/chatgpt-on-wechat/channel/wechatmp/wechatmp_channel.py", line 68, in startup web.httpserver.runsimple(app.wsgifunc(), ("0.0.0.0", port)) File "/home/lighthouse/.local/lib/python3.10/site-packages/web/httpserver.py", line 176, in runsimple server.start() File "/home/lighthouse/.local/lib/python3.10/site-packages/cheroot/server.py", line 1840, in start self.prepare() File "/home/lighthouse/.local/lib/python3.10/site-packages/cheroot/server.py", line 1795, in prepare raise socket.error(msg) OSError: No socket could be created -- (('0.0.0.0', 80): [Errno 13] Permission denied)
问题描述 😯
No response
终端日志 📒
[INFO][2024-02-19 15:07:57][tool.py:28] - [tool] inited
[INFO][2024-02-19 15:07:57][role.py:69] - [Role] inited
[INFO][2024-02-19 15:07:57][dungeon.py:56] - [Dungeon] inited
[INFO][2024-02-19 15:07:57][hello.py:24] - [Hello] inited
[INFO][2024-02-19 15:07:57][finish.py:23] - [Finish] inited
http://0.0.0.0:80/
[ERROR][2024-02-19 15:07:57][app.py:66] - App startup failed!
[ERROR][2024-02-19 15:07:57][app.py:67] - No socket could be created -- (('0.0.0.0', 80): [Errno 13] Permission denied)
Traceback (most recent call last):
File "/home/lighthouse/chatgpt-on-wechat/app.py", line 61, in run
start_channel(channel_name)
File "/home/lighthouse/chatgpt-on-wechat/app.py", line 40, in start_channel
channel.startup()
File "/home/lighthouse/chatgpt-on-wechat/channel/wechatmp/wechatmp_channel.py", line 68, in startup
web.httpserver.runsimple(app.wsgifunc(), ("0.0.0.0", port))
File "/home/lighthouse/.local/lib/python3.10/site-packages/web/httpserver.py", line 176, in runsimple
server.start()
File "/home/lighthouse/.local/lib/python3.10/site-packages/cheroot/server.py", line 1840, in start
self.prepare()
File "/home/lighthouse/.local/lib/python3.10/site-packages/cheroot/server.py", line 1795, in prepare
raise socket.error(msg)
OSError: No socket could be created -- (('0.0.0.0', 80): [Errno 13] Permission denied)
我记得指南里好像有说过服务器起80端口权限不够的问题,给了几种解决方法来着。后来我起在了另一个端口,用ngix把80端口指向的我选的端口
已经解决。 第一次加上sudo命令报包不存在,排查后发现使用sudo后,使用的环境不一样。
可以使用root用户部署,启动项目即可
docker-compose.yml 里面加上端口映射 80:80,且设置 user:root