关于 Bot is closed manually
-
About
我们留意到部分用户在长时间运行 mirai 后会触发
Bot is closed manually
的错误为了修复此错误, 我们需要收集一些信息, 你可以选择直接在此贴回复 / 在 GitHub 创建新 issue
开启 Debug 模式以便于我们修复 BUG
添加以下 jvm 参数
-Dmirai.network.handle.selector.logging=true -Dmirai.network.state.observer.logging=full -Dmirai.network.packet.logger=true
Mirai Console
使用专业文本编辑器 (如 vim, vscode, sublime, etc.) 编辑
config/Console/Logger.yml
修改为以下内容
# 日志输出等级 可选值: ALL, VERBOSE, DEBUG, INFO, WARNING, ERROR, NONE defaultPriority: ALL # 特定日志记录器输出等级 loggers: example.logger: NONE console.debug: NONE Bot: ALL
MCL
Windows
Windows系统的 mcl 启动脚本名为
mcl.cmd
, 使用任何文本编译器打开该文件, 并将jvm参数
加到-jar
前修改示例
@echo off set JAVA_BINARY=java15 %JAVA_BINARY% ^ -Dmirai.network.handle.selector.logging=true ^ -Dmirai.network.state.observer.logging=full ^ -Dmirai.network.packet.logger=true ^ -jar mcl.jar %*
Linux / MacOS
Linux/MacOS 系列的 mcl 启动脚本名字直接为
mcl
, 使用任何文本编辑器打开该文件, 并将jvm参数
加到-jar
前修改示例
#!/usr/bin/env sh export JAVA_BINARY=java $JAVA_BINARY \ -Dmirai.network.handle.selector.logging=true \ -Dmirai.network.state.observer.logging=full \ -Dmirai.network.packet.logger=true \ -jar mcl.jar $*
MiraiAndroid
请直接在设置内打开debug日志即可
-
-
@Karlatemp MiraiAndroid最新版咋下载啊,我这里安卓没这选项
-
-
大概run了一天后触发了,尝试上述的配置中...
-
同样的,挂了一天,问题再次出现
mcl文件的代码#!/usr/bin/env sh export JAVA_BINARY="/root/MCL/java/bin/java" nohup $JAVA_BINARY \ -Dmirai.network.handle.selector.logging=true \ -Dmirai.network.state.observer.logging=full \ -Dmirai.network.packet.logger=true \ -jar mcl.jar $* > /root/MCL/logs.txt &
logs2023-02-01.log
2023-02-01 00:52:42 V/Bot.742431945: Event: BotOfflineEvent.Active(bot=Bot(742431945), cause=null, reconnect=false)
重定向的logs.txt出问题的那几行
[0m2023-01-31 07:06:59 V/Bot.742431945: [骰子群(572938055)] 无名小花.(2543358175) -> [mirai:image:{91B099AF-DAB9-8AB8-7C21-A38A45B960AB}.gif, width=240, height=240, size=179816, type=GIF, isEmoji=true][0m[m [0m2023-01-31 10:58:14 V/Bot.742431945: [骰子群(572938055)] greenhandzdl(2029252158) -> 麻了,终于给他整上去了[0m[m [0m2023-01-31 10:58:59 V/Bot.742431945: [骰子群(572938055)] greenhandzdl(2029252158) -> 刚刚看到个好消息,腾讯终于杀完了\n[mirai:image:{29CB4E99-ACEC-8965-E889-93EE89E1A76E}.png, width=886, height=547, size=121408, type=PNG, isEmoji=false]\n坏消息是都是我的样本[0m[m [0m2023-01-31 22:14:03 V/Bot.742431945: [骰子群(572938055)] 緒山真尋(213552886) -> r[0m[m [0m2023-01-31 22:14:04 V/Bot.742431945: Group(572938055) <- [mirai:at:213552886] 幸运大转盘出来了哦~ \n获得了本轮豁免权[0m[m [0m2023-02-01 00:52:42 V/Bot.742431945: Event: BotOfflineEvent.Active(bot=Bot(742431945), cause=null, reconnect=false)[0m[m [92m2023-02-01 00:52:42 I/Bot.742431945: Bot is closed manually[0m[m [92m2023-02-01 00:52:42 I/Bot.742431945: Bot cancelled: Job was cancelled[0m[m [92m2023-02-01 00:52:42 I/randomSurprise: randomSurprise Disabled[0m[m [92m2023-02-01 00:52:42 I/dice: Dice disabled[0m[m
-
这个是bots目录下的logs
[0m2023-02-01 00:49:52 V/: Decoded: Heartbeat.Alive[0m [96m2023-02-01 00:49:52 D/: Packet Handling Processor: receive packet Heartbeat.Alive[0m [0m2023-02-01 00:50:52 V/: Decoding packet: Value(ByteReadPacket(80 bytes remaining))[0m [0m2023-02-01 00:50:52 V/: Decoding: len=80, value=00 00 00 0A 00 00 00 00 00 0D 37 34 32 34 33 31 39 34 35 00 00 00 39 00 01 7D 82 00 00 00 00 00 00 00 04 00 00 00 13 48 65 61 72 74 62 65 61 74 2E 41 6C 69 76 65 00 00 00 08 57 85 B5 78 00 00 00 00 00 00 00 0A A8 01 00 C8 01 02 00 00 00 04[0m [0m2023-02-01 00:50:52 V/: Decoded: Heartbeat.Alive[0m [96m2023-02-01 00:50:52 D/: Packet Handling Processor: receive packet Heartbeat.Alive[0m [0m2023-02-01 00:51:52 V/: Decoding packet: Value(ByteReadPacket(80 bytes remaining))[0m [0m2023-02-01 00:51:52 V/: Decoding: len=80, value=00 00 00 0A 00 00 00 00 00 0D 37 34 32 34 33 31 39 34 35 00 00 00 39 00 01 7D 84 00 00 00 00 00 00 00 04 00 00 00 13 48 65 61 72 74 62 65 61 74 2E 41 6C 69 76 65 00 00 00 08 57 85 B5 78 00 00 00 00 00 00 00 0A A8 01 00 C8 01 02 00 00 00 04[0m [0m2023-02-01 00:51:52 V/: Decoded: Heartbeat.Alive[0m [96m2023-02-01 00:51:52 D/: Packet Handling Processor: receive packet Heartbeat.Alive[0m [0m2023-02-01 00:52:42 V/: Send: StatSvc.register(offline)[0m
-
看了下,怀疑是系统杀掉的,麻了