Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

因 SPI 不可用, 发送消息失败 #2268

Closed
MC-Nirvana opened this issue Oct 5, 2022 · 21 comments · Fixed by #2428 or #2511
Closed

因 SPI 不可用, 发送消息失败 #2268

MC-Nirvana opened this issue Oct 5, 2022 · 21 comments · Fixed by #2428 or #2511
Labels
M 优先级: 主要 s:core 子系统: mirai-core t:bug 类型: bug x:for-dev 属性: 有关 -dev 版本的问题或来自 contextualBugReportException
Milestone

Comments

@MC-Nirvana
Copy link

问题描述

使用mirai sendgroupmessage命令时报错,无法向群内发送消息。

复现

1.启动服务端
2.输入mirai sendgroupmessage 2325 1012 test
3.服务端报错,命令执行失败

mirai-core 版本

2.13.0

bot-protocol

ANDROID_PHONE

其他组件版本

No response

系统日志

[00:16:58 INFO]: An internal error occurred whilst executing this command, please check the console log for details.
[00:16:58 WARN]: Error in dispatching command
net.mamoe.mirai.internal.message.ContextualBugReportException: 在 Internal error: no MessageReceipt was returned from OutgoingMessagePipeline for message 时遇到了意料之中的问题. 请完整复制此日志提交给 mirai: https://github.com/mamoe/mirai/issues/new/choose    调试信息: test
        at net.mamoe.mirai.internal.message.ContextualBugReportExceptionKt.contextualBugReportException(contextualBugReportException.kt:26) ~[?:?]
        at net.mamoe.mirai.internal.message.ContextualBugReportExceptionKt.contextualBugReportException$default(contextualBugReportException.kt:20) ~[?:?]
        at net.mamoe.mirai.internal.message.protocol.MessageProtocolFacadeImpl.getSingleReceipt(MessageProtocolFacade.kt:357) ~[?:?]
        at net.mamoe.mirai.internal.message.protocol.MessageProtocolFacadeImpl.preprocessAndSendOutgoing(MessageProtocolFacade.kt:326) ~[?:?]
        at net.mamoe.mirai.internal.message.protocol.MessageProtocolFacade$INSTANCE.preprocessAndSendOutgoing(MessageProtocolFacade.kt) ~[?:?]
        at net.mamoe.mirai.internal.contact.AbstractUserKt.sendMessageImpl(AbstractUser.kt:264) ~[?:?]
        at net.mamoe.mirai.internal.contact.AbstractUserKt$sendMessageImpl$1.invokeSuspend(AbstractUser.kt) ~[?:?]
        at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33) ~[?:?]
        at kotlinx.coroutines.UndispatchedCoroutine.afterResume(CoroutineContext.kt:233) ~[?:?]
        at kotlinx.coroutines.AbstractCoroutine.resumeWith(AbstractCoroutine.kt:102) ~[?:?]
        at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:46) ~[?:?]
        at kotlinx.coroutines.internal.DispatchedContinuationKt.resumeCancellableWith(DispatchedContinuation.kt:283) ~[?:?]
        at kotlinx.coroutines.internal.DispatchedContinuationKt.resumeCancellableWith$default(DispatchedContinuation.kt:278) ~[?:?]
        at kotlinx.coroutines.DispatchedCoroutine.afterResume(Builders.common.kt:260) ~[?:?]
        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.internal.LimitedDispatcher.run(LimitedDispatcher.kt:42) ~[?:?]
        at kotlinx.coroutines.scheduling.TaskImpl.run(Tasks.kt:95) ~[?:?]
        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) ~[?:?]

网络日志

No response

补充信息

No response

@MC-Nirvana
Copy link
Author

由于存在隐私问题,因此qq号、群号只保留前后两位

@Him188 Him188 added t:bug 类型: bug M 优先级: 主要 s:core 子系统: mirai-core x:for-dev 属性: 有关 -dev 版本的问题或来自 contextualBugReportException labels Oct 5, 2022
@Him188 Him188 added this to the 2.13.0-RC2 milestone Oct 5, 2022
@Him188
Copy link
Member

Him188 commented Oct 12, 2022

mirai sendgroupmessage 2325 1012 test 是哪个插件的指令?

@Him188
Copy link
Member

Him188 commented Oct 12, 2022

是必定复现吗?

@Him188
Copy link
Member

Him188 commented Oct 12, 2022

看了一下实现, 应该不是 2.13 的 regression

@Him188 Him188 modified the milestones: 2.13.0-RC2, 2.14.0-RC Oct 12, 2022
@MC-Nirvana
Copy link
Author

mirai sendgroupmessage 2325 1012 test 是哪个插件的指令?

test并不是哪个插件的指令,是我向群内发送的测试消息。正常情况下应该是在群内会有个机器人发送消息,内容为test才对

@MC-Nirvana
Copy link
Author

是必定复现吗?

至少从我安装MiraiMC到现在都是这样,次次必定复现。

@MC-Nirvana
Copy link
Author

看了一下实现, 应该不是 2.13 的 regression

提交issues时写2.13是因为我当时服务端内的core是2.13。实际上这个问题以前就有了

@Him188
Copy link
Member

Him188 commented Oct 12, 2022

看看代码

@sandtechnology
Copy link
Collaborator

这个问题应该还是之前我说的那个 是类加载器的问题 复现拿一个mc服务器跑这个插件就好了 https://github.com/DreamVoid/MiraiMC
相关问题:DreamVoid/MiraiMC#207

@MC-Nirvana
Copy link
Author

看看代码

怎么看?是我再跑一遍然后发给你log吗?

@MC-Nirvana
Copy link
Author

这个问题应该还是之前我说的那个 是类加载器的问题 复现拿一个mc服务器跑这个插件就好了 https://github.com/DreamVoid/MiraiMC 相关问题:DreamVoid/MiraiMC#207

所以是服务端的问题还是插件的问题?

@Him188
Copy link
Member

Him188 commented Oct 12, 2022

有一个解决方法是在无法通过 service loader 加载时使用 native 平台用的硬编码方案 MiraiCoreServices

@Him188 Him188 changed the title 使用mirai sendgroupmessage命令时报错 因 SPI 不可用, 发送消息失败 Oct 12, 2022
@sandtechnology
Copy link
Collaborator

这个问题应该还是之前我说的那个 是类加载器的问题 复现拿一个mc服务器跑这个插件就好了 https://github.com/DreamVoid/MiraiMC 相关问题:DreamVoid/MiraiMC#207

所以是服务端的问题还是插件的问题?

插件侧问题,属于插件侧的自身用于加载Mirai的类加载器更换实现不完善导致的
不过我也不知道 Mirai 这边会不会提供一个用户用的通用解决方案或者文档之类的(

@MC-Nirvana
Copy link
Author

这个问题应该还是之前我说的那个 是类加载器的问题 复现拿一个mc服务器跑这个插件就好了 https://github.com/DreamVoid/MiraiMC 相关问题:DreamVoid/MiraiMC#207

所以是服务端的问题还是插件的问题?

插件侧问题,属于插件侧的自身用于加载Mirai的类加载器更换实现不完善导致的 不过我也不知道 Mirai 这边会不会提供一个用户用的通用解决方案或者文档之类的(

那我应该怎么反馈?报错信息显示让我来这里反馈

@DreamVoid
Copy link

这个问题应该还是之前我说的那个 是类加载器的问题 复现拿一个mc服务器跑这个插件就好了 https://github.com/DreamVoid/MiraiMC 相关问题:DreamVoid/MiraiMC#207

所以是服务端的问题还是插件的问题?

插件侧问题,属于插件侧的自身用于加载Mirai的类加载器更换实现不完善导致的 不过我也不知道 Mirai 这边会不会提供一个用户用的通用解决方案或者文档之类的(

那我应该怎么反馈?报错信息显示让我来这里反馈

人在北京,刚换电脑,开发环境没弄好,要上课,总之,别急。

@Him188
Copy link
Member

Him188 commented Oct 13, 2022

有一个解决方法是在无法通过 service loader 加载时使用 native 平台用的硬编码方案 MiraiCoreServices

预计会实现这个方案

@MC-Nirvana
Copy link
Author

这个问题应该还是之前我说的那个 是类加载器的问题 复现拿一个mc服务器跑这个插件就好了 https://github.com/DreamVoid/MiraiMC 相关问题:DreamVoid/MiraiMC#207

所以是服务端的问题还是插件的问题?

插件侧问题,属于插件侧的自身用于加载Mirai的类加载器更换实现不完善导致的 不过我也不知道 Mirai 这边会不会提供一个用户用的通用解决方案或者文档之类的(

那我应该怎么反馈?报错信息显示让我来这里反馈

人在北京,刚换电脑,开发环境没弄好,要上课,总之,别急。

好吧。。。看来也只有等了

@MC-Nirvana
Copy link
Author

有一个解决方法是在无法通过 service loader 加载时使用 native 平台用的硬编码方案 MiraiCoreServices

预计会实现这个方案

无论怎么样,能解决问题就行

@AdoptOSS
Copy link
Contributor

有一个解决方法是在无法通过 service loader 加载时使用 native 平台用的硬编码方案 MiraiCoreServices

大部分组件不需要装卸、搭配,可以考虑完全使用 MiraiCoreServices 来简化代码
少数组件如 Logging 等需要自由装配和自动发现,似乎只能用 service loader

@yizhixiaomifeng
Copy link

@Him188 那我们这普通用户应该如何解决并正常使用

@Him188
Copy link
Member

Him188 commented Oct 17, 2022

继续用 2.12.3 等 core 更新,或者去催 MiraiMC 插件作者解决问题。这个本来就不是 mirai 的问题,mirai 只是在尽可能帮助解决问题。

Him188 added a commit that referenced this issue Oct 20, 2022
@Him188 Him188 modified the milestones: 2.14.0-RC, 2.15 Jan 11, 2023
cssxsh added a commit to cssxsh/mirai that referenced this issue Jan 15, 2023
@Him188 Him188 modified the milestones: 2.15, 2.15.0-RC Jan 18, 2023
Him188 pushed a commit that referenced this issue Feb 17, 2023
@Him188 Him188 linked a pull request Mar 1, 2023 that will close this issue
@Him188 Him188 modified the milestones: 2.15.0-RC, 2.15.0-M1 Mar 11, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
M 优先级: 主要 s:core 子系统: mirai-core t:bug 类型: bug x:for-dev 属性: 有关 -dev 版本的问题或来自 contextualBugReportException
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants