mamoe / mirai

高效率 QQ 机器人支持库
https://mirai.mamoe.net
GNU Affero General Public License v3.0
14.5k stars 2.55k forks source link

群公告发送失败 no login #2069

Closed millionfor closed 1 year ago

millionfor commented 2 years ago

问题描述

java.lang.IllegalStateException: Error code: -1, Error message: Failed to deserialize '{"ec":1,"em":"no login [errcode:1:0]","ltsm":1653791033,"srv_code":0}' into net.mamoe.mirai.internal.contact.announcement.AnnouncementProtocol.SendGroupAnnouncementResp
        at net.mamoe.mirai.utils.DeserializationFailure.createException(CheckableResult.kt:50)
        at net.mamoe.mirai.utils.CheckableResultKt.check(CheckableResult.kt:78)
        at net.mamoe.mirai.internal.contact.announcement.AnnouncementProtocol.sendGroupAnnouncement(AnnouncementsImpl.kt:475)
        at net.mamoe.mirai.internal.contact.announcement.AnnouncementProtocol$sendGroupAnnouncement$1.invokeSuspend(AnnouncementsImpl.kt)
        at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
        at io.ktor.util.pipeline.SuspendFunctionGun.resumeRootWith(SuspendFunctionGun.kt:191)
        at io.ktor.util.pipeline.SuspendFunctionGun.loop(SuspendFunctionGun.kt:147)
        at io.ktor.util.pipeline.SuspendFunctionGun.access$loop(SuspendFunctionGun.kt:15)
        at io.ktor.util.pipeline.SuspendFunctionGun$continuation$1.resumeWith(SuspendFunctionGun.kt:93)
        at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:46)
        at io.ktor.util.pipeline.SuspendFunctionGun.resumeRootWith(SuspendFunctionGun.kt:191)
        at io.ktor.util.pipeline.SuspendFunctionGun.loop(SuspendFunctionGun.kt:147)
        at io.ktor.util.pipeline.SuspendFunctionGun.access$loop(SuspendFunctionGun.kt:15)
        at io.ktor.util.pipeline.SuspendFunctionGun$continuation$1.resumeWith(SuspendFunctionGun.kt:93)
        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:749)
        at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.runWorker(CoroutineScheduler.kt:677)
        at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.run(CoroutineScheduler.kt:664)
Caused by: kotlinx.serialization.MissingFieldException: Field 'new_fid' is required for type with serial name 'net.mamoe.mirai.internal.contact.announcement.AnnouncementProtocol.SendGroupAnnouncementResp', but it was missing
        at kotlinx.serialization.internal.PluginExceptionsKt.throwMissingFieldException(PluginExceptions.kt:20)
        at net.mamoe.mirai.internal.contact.announcement.AnnouncementProtocol$SendGroupAnnouncementResp.<init>(AnnouncementsImpl.kt:195)
        at net.mamoe.mirai.internal.contact.announcement.AnnouncementProtocol$SendGroupAnnouncementResp$$serializer.deserialize(AnnouncementsImpl.kt:195)
        at net.mamoe.mirai.internal.contact.announcement.AnnouncementProtocol$SendGroupAnnouncementResp$$serializer.deserialize(AnnouncementsImpl.kt:195)
        at kotlinx.serialization.json.internal.PolymorphicKt.decodeSerializableValuePolymorphic(Polymorphic.kt:59)
        at kotlinx.serialization.json.internal.StreamingJsonDecoder.decodeSerializableValue(StreamingJsonDecoder.kt:36)
        at kotlinx.serialization.json.Json.decodeFromString(Json.kt:100)
        at net.mamoe.mirai.internal.contact.announcement.AnnouncementProtocol.sendGroupAnnouncement(AnnouncementsImpl.kt:460)

复现

发送http请求

http://49.233.193.42:9827/anno/publish

mirai-core 版本

mirai-core-all-2.10.3.jar

bot-protocol

MACOS

其他组件版本

No response

系统日志

No response

网络日志

No response

补充信息

No response

Him188 commented 2 years ago

看服务器返回是无登录,机器人挂了很长时间吗?

Him188 commented 2 years ago

刚刚 commit,姑且先让它抛正确的异常而不是序列化错误了

Him188 commented 2 years ago

回复之后可以 reopen

canguser commented 1 year ago

现在修复了吗?目前只有刚登陆的时候可以发公告,挂久了就会报这错,event 都可以正常接收到 @Him188

image