MrXiaoM / Overflow

替换 mirai 实现为 Onebot 以进行无缝迁移
https://mirai.mrxiaom.top
GNU Affero General Public License v3.0
330 stars 25 forks source link

Overflow最新版使用Lagrange无法获取消息,@以及合并转发 #26

Closed TaylorEevee closed 5 months ago

TaylorEevee commented 7 months ago

问题描述

overflow-2.16.0-3ecc323,在Lagrange 602c67a 中能收到消息,但是在overflow日志中没有出现消息,退回d59ef26后正常,使用命令可主动发送消息。以及合并消息,消息包含@时发送日志显示W/Onebot: Request failed: [send_group_forward_msg, echo=33] , retCode=404

复现

使用overflow-2.16.0-3ecc323与Lagrange 发送包含@群友的消息,以及合并转发消息

Overflow 版本

3ecc323

其他组件版本

Lagrange602c67a

系统日志

3ecc323版本收不到消息在overflow侧没有日志
发送包含@群友的消息
2024-02-27 15:53:29 W/Onebot: Request failed: [send_group_msg, echo=5] , retCode=200
2024-02-27 15:53:29 V/Bot.*: Group(*) <- [mirai:at:*] 
这里是消息内容
2024-02-27 15:53:32 V/Bot.*: Group(*) <- [overflow:image,url=base64:///9j/4AAQSkZJRgABA*AD/4QAi... (about 203.00 KB),isEmoji=false]
图片的内容正常发送

合并转发消息
2024-02-27 15:55:51 W/Onebot: Request failed: [send_group_forward_msg, echo=10] , retCode=404
2024-02-27 15:55:51 V/Bot.*: Group(*) <- ForwardMessage(preview=[], title=*, brief=[*], source=*, summary=*, nodeList=[])

网络日志

No response

补充信息

No response

MrXiaoM commented 7 months ago

已尝试在

我本地没有部署 Lagrange,无法测试,请测试通过后关闭 Issues

TaylorEevee commented 7 months ago

很抱歉之前有事没有看到issuse,今天尝试了一下 overflow 版本 88426f1 Lagrange 版本 5073ddf 包含@的消息返回 W/Onebot: Request failed: [send_group_msg, echo=5] , retCode=200 合并转发 W/Onebot: Request failed: [send_forward_msg, echo=9] , retCode=200 另外我今天测试了搜图插件报错如下 2024-03-06 20:16:35 V/Bot.: ()] () -> ptst-[overflow:image,url=http://gchat.qpic.cn/gchatpic_new///0?term=255&is_origin=1,isEmoji=false] 2024-03-06 20:16:35 W/Onebot: Request failed: [send_group_msg, echo=7] , retCode=200 2024-03-06 20:16:35 V/Bot.: Group() <- [mirai:at:] 正在获取中,请稍后 2024-03-06 20:16:35 E/Ascii2d: java.lang.IllegalArgumentException: Illegal character in path at index 72: https://ascii2d.net/search/url/https://gchat.qpic.cn/gchatpic_new/0/0-0-[mirai:source:ids=[*],internalIds=[*],fromgroup*to*at*]ptst[overflow:image,url=http://gchat.qpic.cn/gchatpic_new/*/*/0?term=255&is_origin=1,isEmoji=false]/0? java.lang.IllegalArgumentException: Illegal character in path at index 72: https://ascii2d.net/search/url/https://gchat.qpic.cn/gchatpic_new/0/0-0-[mirai:source:ids=[*],internalIds=[*],fromgroup*to*at*]ptst[overflow:image,url=http://gchat.qpic.cn/gchatpic_new/*/*/0?term=255&is_origin=1,isEmoji=false]/0? at java.base/java.net.URI.create(URI.java:906) at pixiv-1.7.6.mirai2.jar[private]//org.apache.http.client.methods.HttpGet.(HttpGet.java:66) at pixiv-1.7.6.mirai2.jar//com.hcyacg.search.Ascii2d.picToHtmlSearch(Ascii2d.kt:73) at pixiv-1.7.6.mirai2.jar//com.hcyacg.search.SearchPicCenter.forward(SearchPicCenter.kt:26) at pixiv-1.7.6.mirai2.jar//com.hcyacg.search.SearchPicCenter$forward$1.invokeSuspend(SearchPicCenter.kt) at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33) at kotlinx.coroutines.internal.ScopeCoroutine.afterResume(Scopes.kt:33) at kotlinx.coroutines.AbstractCoroutine.resumeWith(AbstractCoroutine.kt:102) at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:46) at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:106) at kotlinx.coroutines.scheduling.CoroutineScheduler.runSafely(CoroutineScheduler.kt:570) at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.executeTask(CoroutineScheduler.kt:750) at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.runWorker(CoroutineScheduler.kt:677) at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.run(CoroutineScheduler.kt:664) Caused by: java.net.URISyntaxException: Illegal character in path at index 72: https://ascii2d.net/search/url/https://gchat.qpic.cn/gchatpic_new/0/0-0-[mirai:source:ids=[*],internalIds=[*],fromgroup*to*at*]ptst[overflow:image,url=http://gchat.qpic.cn/gchatpic_new/*/*/0?term=255&is_origin=1,isEmoji=false]/0? at java.base/java.net.URI$Parser.fail(URI.java:2976) at java.base/java.net.URI$Parser.checkChars(URI.java:3147) at java.base/java.net.URI$Parser.parseHierarchical(URI.java:3229) at java.base/java.net.URI$Parser.parse(URI.java:3177) at java.base/java.net.URI.(URI.java:623) at java.base/java.net.URI.create(URI.java:904) ... 13 more

2024-03-06 20:16:36 W/stderr: javax.imageio.IIOException: Can't get input stream from URL! 2024-03-06 20:16:36 W/stderr: at java.desktop/javax.imageio.ImageIO.read(ImageIO.java:1409) 2024-03-06 20:16:36 W/stderr: at pixiv-1.7.6.mirai2.jar//com.hcyacg.search.Saucenao$picToSearch$rotate90$1.invokeSuspend(Saucenao.kt:63) 2024-03-06 20:16:36 W/stderr: at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33) 2024-03-06 20:16:36 W/stderr: at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:106) 2024-03-06 20:16:36 W/stderr: at kotlinx.coroutines.internal.LimitedDispatcher.run(LimitedDispatcher.kt:42) 2024-03-06 20:16:36 W/stderr: at kotlinx.coroutines.scheduling.TaskImpl.run(Tasks.kt:95) 2024-03-06 20:16:36 W/stderr: at kotlinx.coroutines.scheduling.CoroutineScheduler.runSafely(CoroutineScheduler.kt:570) 2024-03-06 20:16:36 W/stderr: at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.executeTask(CoroutineScheduler.kt:750) 2024-03-06 20:16:36 W/stderr: at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.runWorker(CoroutineScheduler.kt:677) 2024-03-06 20:16:36 W/stderr: at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.run(CoroutineScheduler.kt:664) 2024-03-06 20:16:36 W/stderr: Caused by: java.io.IOException: Server returned HTTP response code: 400 for URL: https://gchat.qpic.cn/gchatpic_new/0/0-0-[mirai:source:ids=[*],internalIds=[*],fromgroup*to*at*]ptst[overflow:image,url=http://gchat.qpic.cn/gchatpic_new/*/*/0?term=255&is_origin=1,isEmoji=false]/0? 2024-03-06 20:16:36 W/stderr: at java.base/sun.net.www.protocol.http.HttpURLConnection.getInputStream0(HttpURLConnection.java:2000) 2024-03-06 20:16:36 W/stderr: at java.base/sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1589) 2024-03-06 20:16:36 W/stderr: at java.base/sun.net.www.protocol.https.HttpsURLConnectionImpl.getInputStream(HttpsURLConnectionImpl.java:224) 2024-03-06 20:16:36 W/stderr: at java.base/java.net.URL.openStream(URL.java:1161) 2024-03-06 20:16:36 W/stderr: at java.desktop/javax.imageio.ImageIO.read(ImageIO.java:1407) 2024-03-06 20:16:36 W/stderr: ... 9 more 2024-03-06 20:16:37 V/Bot.: Group() <- 请输入正确的命令 ptst-图片

MrXiaoM commented 7 months ago

对于at和转发无法发送,请提供网络日志(logs/onebot/) 对于搜图插件,你用的搜图插件使用非常老的方法获取并下载图片链接,已经不受支持了。

TaylorEevee commented 7 months ago

好的 at消息 2024-03-06 22:01:52 D/Onebot: Client received <-- {"status":"failed","retcode":200,"data":null,"echo":12} 2024-03-06 22:01:52 W/Onebot: Request failed: [send_group_msg, echo=12] , retCode=200 2024-03-06 22:01:52 V/Onebot: Stacktrace: cn.evolvefield.onebot.client.util.ActionFailedException: , retCode=200 at cn.evolvefield.onebot.client.util.ActionSendUtils.send(ActionSendUtils.kt:47) at cn.evolvefield.onebot.client.util.ActionSendUtils$send$1.invokeSuspend(ActionSendUtils.kt) at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33) at kotlinx.coroutines.internal.ScopeCoroutine.afterResume(Scopes.kt:33) at kotlinx.coroutines.AbstractCoroutine.resumeWith(AbstractCoroutine.kt:102) at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:46) at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:106) at kotlinx.coroutines.scheduling.CoroutineScheduler.runSafely(CoroutineScheduler.kt:570) at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.executeTask(CoroutineScheduler.kt:750) at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.runWorker(CoroutineScheduler.kt:677) at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.run(CoroutineScheduler.kt:664) 转发 2024-03-06 21:59:28 D/Onebot: Send to server --> {"action":"send_forward_msg","params":{"messages":[]},"echo":11} 2024-03-06 21:59:28 D/Onebot: Client received <-- {"status":"failed","retcode":404,"data":null,"echo":11} 2024-03-06 21:59:28 W/Onebot: Request failed: [send_forward_msg, echo=11] , retCode=404 2024-03-06 21:59:28 V/Onebot: Stacktrace: cn.evolvefield.onebot.client.util.ActionFailedException: , retCode=404 at cn.evolvefield.onebot.client.util.ActionSendUtils.send(ActionSendUtils.kt:47) at cn.evolvefield.onebot.client.util.ActionSendUtils$send$1.invokeSuspend(ActionSendUtils.kt) at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33) at kotlinx.coroutines.internal.ScopeCoroutine.afterResume(Scopes.kt:33) at kotlinx.coroutines.AbstractCoroutine.resumeWith(AbstractCoroutine.kt:102) at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:46) at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:106) at kotlinx.coroutines.scheduling.CoroutineScheduler.runSafely(CoroutineScheduler.kt:570) at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.executeTask(CoroutineScheduler.kt:750) at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.runWorker(CoroutineScheduler.kt:677) at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.run(CoroutineScheduler.kt:664)

MrXiaoM commented 7 months ago

查了一下,200 错误码需要看 Lagrange 的日志,Lagrange 仅仅返回了个错误码,错误原因是打印在 Lagrange 的。 https://github.com/LagrangeDev/Lagrange.Core/blob/be3141ff54960d0a2803b785a33195a1cbd6ceb2/Lagrange.OneBot/Core/Operation/OperationService.cs#L65-L66

由于你非常喜欢给日志打码,我不确定发送转发消息那里,是 Overflow 确实生成了个空的 messages 出来,还是你删除了。

同样地,如果发送转发消息出现错误,Lagrange 也仅仅只返回一个 404,把日志打印在他那里,具体原因我无法分析。 https://github.com/LagrangeDev/Lagrange.Core/blob/be3141ff54960d0a2803b785a33195a1cbd6ceb2/Lagrange.OneBot/Core/Operation/Message/SendForwardMessageOperation.cs#L21 https://github.com/LagrangeDev/Lagrange.Core/blob/be3141ff54960d0a2803b785a33195a1cbd6ceb2/Lagrange.Core/Internal/Context/BusinessContext.cs#L115-L116

TaylorEevee commented 7 months ago

怪了,GitHub把我的星号吞了,转发消息那个我记得是空的,明天我查看拉格朗日的日志再发送,作者辛苦了

TaylorEevee commented 7 months ago

或者是作者能不能提供一个其他联系方式,我明天看看在服务器上给作者部署一个拉格朗日的环境

MrXiaoM commented 7 months ago

不必,我最近有课,抽不出时间调试。写这个项目仅仅是一个兴趣

TaylorEevee commented 7 months ago

@消息日志 https://netcut.cn/p/962dfa9074f8e0ee 转发消息日志 https://netcut.cn/p/af8491952411b01d 我把拉格朗日的日志也放进来了,作者大大看一下,辛苦了

MrXiaoM commented 7 months ago
The JSON value could not be converted to System.String. Path: $.qq
Cannot get the value of a token type 'Number' as a string.

似乎是类型问题

Object reference not set to an instance of an object.
    at Lagrange.Core.Internal.Service.Message.MultiMsgUploadService.Parse(Byte[] input, BotKeystore keystore, BotAppInfo appInfo, BotDeviceInfo device, MultiMsgUploadEvent& output, List`1& extraEvents) in /home/runner/work/Lagrange.Core/Lagrange.Core/Lagrange.Core/Internal/Service/Message/MultiMsgUploadService.cs:line 64

空指针异常

只能分析到这,别的我抽空看看