CMHopeSunshine / LittlePaimon

小派蒙!基于Nonebot2的原神机器人,包括但不限于UID面板查询、抽卡记录分析、游戏攻略图鉴、实时便签、原石札记、群聊学习、群管等功能。/ LittlePamon! Genshin Impact multifunctional bot based on Nonebot2.
https://docs.paimon.cherishmoon.top
GNU Affero General Public License v3.0
1.16k stars 126 forks source link

使用pm2启动后LittlePaimon好像启动失败,导致一直报连接到反向WebSocket Universal服务器出现错误 #115

Open yaojia25 opened 2 years ago

yaojia25 commented 2 years ago

环境:

OS: debian 11 虚拟环境路径:/apps/nonebot2/.venv nonebot2路径:/apps/nonebot2/NoneBot2

pm2启动参数用的:

pm2 start -n 'nonebot2' -x 'cd /apps/nonebot2/NoneBot2 && /apps/nonebot2/.venv/bin/python -m nb_cli run'

启动后日志:

[WARNING] nonebot | OneBot V11 | WebSocket for Bot 127******08 closed by peer
0|nonebot2 | 07-13 21:22:48 [INFO] websockets | connection closed
0|nonebot2 | 07-13 21:22:48 [WARNING] nonebot_plugin_gocqhttp | Process for 127******08 exited with code 0, retrying to restart... (0/-1)
0|nonebot2 | 07-13 21:22:48 [INFO] uvicorn | Shutting down
0|nonebot2 | 07-13 21:22:48 [INFO] websockets | connection closed
0|nonebot2 | 07-13 21:22:48 [INFO] uvicorn | Waiting for application shutdown.
0|nonebot2 | 07-13 21:22:51 [SUCCESS] nonebot | NoneBot is initializing...
0|nonebot2 | 07-13 21:22:51 [INFO] nonebot | Current Env: prod
0|nonebot2 | 07-13 21:22:53 [SUCCESS] nonebot | Succeeded to import "nonebot_plugin_gocqhttp"
0|nonebot2 | 07-13 21:22:53 [SUCCESS] nonebot | Succeeded to import "Paimon_Gacha_Log"
0|nonebot2 | 07-13 21:22:53 [SUCCESS] nonebot | Succeeded to import "nonebot_plugin_htmlrender"

0|nonebot2  | 07-13 21:22:53 [SUCCESS] nonebot | Succeeded to import "nonebot_plugin_apscheduler"
0|nonebot2  | 07-13 21:22:54 [SUCCESS] nonebot | Succeeded to import "Paimon_Calendar"
0|nonebot2  | 07-13 21:22:54 [SUCCESS] nonebot | Succeeded to import "Paimon_Exchange"
0|nonebot2  | 07-13 21:22:54 [SUCCESS] nonebot | Succeeded to import "Paimon_Wiki"
0|nonebot2  | 07-13 21:22:55 [SUCCESS] nonebot | Succeeded to import "Paimon_Gacha"
0|nonebot2  | 07-13 21:22:55 [WARNING] LittlePaimon | 派蒙机器学习启用失败,未配置mongodb连接url,如无需该功能,可忽略
0|nonebot2  | 07-13 21:22:55 [SUCCESS] nonebot | Succeeded to import "Paimon_Chat"
0|nonebot2  | 07-13 21:22:57 [SUCCESS] nonebot | Succeeded to import "Paimon_Info"
0|nonebot2  | 07-13 21:22:57 [SUCCESS] nonebot | Succeeded to import "news"
0|nonebot2  | 07-13 21:22:57 [SUCCESS] nonebot | Succeeded to import "couplets"
0|nonebot2  | 07-13 21:22:57 [SUCCESS] nonebot | Succeeded to import "order"
0|nonebot2  | 07-13 21:22:58 [SUCCESS] nonebot | Succeeded to import "random_img"
0|nonebot2  | 07-13 21:22:58 [SUCCESS] nonebot | Succeeded to import "paimon_help"
0|nonebot2  | 07-13 21:22:58 [SUCCESS] nonebot | Succeeded to import "auto_handle"
0|nonebot2  | 07-13 21:22:58 [SUCCESS] nonebot | Succeeded to import "Paimon_Plugins"
0|nonebot2  | 07-13 21:22:58 [SUCCESS] nonebot | Succeeded to import "Paimon_CloudGenshin"
0|nonebot2  | 07-13 21:22:59 [SUCCESS] nonebot | Succeeded to import "Guess_voice"
0|nonebot2  | 07-13 21:22:59 [SUCCESS] nonebot | Running NoneBot...
0|nonebot2  | 07-13 21:22:59 [INFO] uvicorn | Started server process [101673]
0|nonebot2  | 07-13 21:22:59 [INFO] uvicorn | Waiting for application startup.
0|nonebot2  | 07-13 21:22:59 [INFO] nonebot_plugin_gocqhttp | [127******08] 当前版本:v1.0.0-rc3
0|nonebot2  | 07-13 21:22:59 [INFO] nonebot_plugin_gocqhttp | [127******08] 将使用 device.json 内的设备信息运行Bot.
0|nonebot2  | 07-13 21:22:59 [INFO] nonebot_plugin_gocqhttp | [127******08] 开始尝试登录并同步消息...
0|nonebot2  | 07-13 21:22:59 [INFO] nonebot_plugin_gocqhttp | [127******08] 使用协议: iPad
0|nonebot2  | 07-13 21:22:59 [INFO] nonebot_plugin_gocqhttp | [127******08] Protocol -> connect to server: [::ffff:180.109.52.205]:14000
0|nonebot2  | 07-13 21:22:59 [WARNING] nonebot_plugin_gocqhttp | [127******08] Protocol -> device lock is disable. http api may fail.
0|nonebot2  | 07-13 21:23:01 [INFO] nonebot_plugin_gocqhttp | [127******08] 登录成功 欢迎使用: 刻晴
0|nonebot2  | 07-13 21:23:01 [INFO] nonebot_plugin_gocqhttp | [127******08] 开始加载好友列表...
0|nonebot2  | 07-13 21:23:01 [INFO] nonebot_plugin_gocqhttp | [127******08] 共加载 8 个好友.
0|nonebot2  | 07-13 21:23:01 [INFO] nonebot_plugin_gocqhttp | [127******08] 开始加载群列表...
0|nonebot2  | 07-13 21:23:02 [INFO] nonebot_plugin_gocqhttp | [127******08] 共加载 1 个群.
0|nonebot2  | 07-13 21:23:02 [INFO] nonebot_plugin_gocqhttp | Startup complete, Web UI has served to http://127.0.0.1:13579/go-cqhttp/
0|nonebot2  | 07-13 21:23:02 [INFO] LittlePaimon | 检查LittlePaimon资源文件
0|nonebot2  | 07-13 21:23:02 [INFO] nonebot_plugin_gocqhttp | go-cqhttp for 127******08 has successfully started.
0|nonebot2  | 07-13 21:23:02 [INFO] nonebot_plugin_gocqhttp | [127******08] 资源初始化完成, 开始处理信息.
0|nonebot2  | 07-13 21:23:02 [INFO] nonebot_plugin_gocqhttp | [127******08] アトリは、高性能ですから!
0|nonebot2  | 07-13 21:23:02 [INFO] nonebot_plugin_gocqhttp | [127******08] 正在检查更新.
0|nonebot2  | 07-13 21:23:02 [INFO] nonebot_plugin_gocqhttp | [127******08] 开始尝试连接到反向WebSocket Universal服务器: ws://127.0.0.1:13579/onebot/v11/ws
0|nonebot2  | 07-13 21:23:02 [WARNING] nonebot_plugin_gocqhttp | [127******08] 连接到反向WebSocket Universal服务器 ws://127.0.0.1:13579/onebot/v11/ws 时出现错误: dial tcp 127.0.0.1:13579: connect: connection refused
0|nonebot2  | 07-13 21:23:03 [INFO] nonebot_plugin_gocqhttp | [127******08] 检查更新完成. 当前已运行最新版本.
0|nonebot2  | 07-13 21:23:03 [INFO] nonebot_plugin_gocqhttp | [127******08] 开始诊断网络情况
0|nonebot2  | 07-13 21:23:05 [INFO] nonebot_plugin_gocqhttp | [127******08] 开始尝试连接到反向WebSocket Universal服务器: ws://127.0.0.1:13579/onebot/v11/ws
0|nonebot2  | 07-13 21:23:05 [WARNING] nonebot_plugin_gocqhttp | [127******08] 连接到反向WebSocket Universal服务器 ws://127.0.0.1:13579/onebot/v11/ws 时出现错误: dial tcp 127.0.0.1:13579: connect: connection refused
0|nonebot2  | 07-13 21:23:05 [INFO] nonebot_plugin_gocqhttp | [127******08] 网络诊断完成. 未发现问题
0|nonebot2  | 07-13 21:23:08 [INFO] nonebot_plugin_gocqhttp | [127******08] 开始尝试连接到反向WebSocket Universal服务器: ws://127.0.0.1:13579/onebot/v11/ws
0|nonebot2  | 07-13 21:23:08 [WARNING] nonebot_plugin_gocqhttp | [127******08] 连接到反向WebSocket Universal服务器 ws://127.0.0.1:13579/onebot/v11/ws 时出现错误: dial tcp 127.0.0.1:13579: connect: connection refused
0|nonebot2  | 07-13 21:23:11 [INFO] nonebot_plugin_gocqhttp | [127******08] 开始尝试连接到反向WebSocket Universal服务器: ws://127.0.0.1:13579/onebot/v11/ws
0|nonebot2  | 07-13 21:23:11 [WARNING] nonebot_plugin_gocqhttp | [127******08] 连接到反向WebSocket Universal服务器 ws://127.0.0.1:13579/onebot/v11/ws 时出现错误: dial tcp 127.0.0.1:13579: connect: connection refused
0|nonebot2  | 07-13 21:23:14 [INFO] nonebot_plugin_gocqhttp | [127******08] 开始尝试连接到反向WebSocket Universal服务器: ws://127.0.0.1:13579/onebot/v11/ws
0|nonebot2  | 07-13 21:23:14 [WARNING] nonebot_plugin_gocqhttp | [127******08] 连接到反向WebSocket Universal服务器 ws://127.0.0.1:13579/onebot/v11/ws 时出现错误: dial tcp 127.0.0.1:13579: connect: connection refused

http://127.0.0.1:13579/go-cqhttp/ 也无法打开。

但是把bot中LittlePaimon给注释掉,gocqhttp和nonebot2是可以正常启动的,希望大佬指点一下怎么使用pm2守护进程!

CMHopeSunshine commented 2 years ago

先试试不用pm2,直接启动吧,我感觉可能是下载资源的时候卡住了

yaojia25 commented 2 years ago

暂时用的 nohup,不过感觉pm2守护进程比较方便