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

获取群精华消息报错 #2668

Closed
kukume opened this issue May 19, 2023 · 5 comments · Fixed by #2672
Closed

获取群精华消息报错 #2668

kukume opened this issue May 19, 2023 · 5 comments · Fixed by #2672

Comments

@kukume
Copy link

kukume commented May 19, 2023

问题描述

1、获取群精华消息报错
在我的一个群中,其中有精华消息

https://xxxx.xxxx.me

在调用group.essences.getPage(0, 20)出现异常,异常信息为

java.lang.IllegalStateException: parse digest data error, status: 0 - success
	at net.mamoe.mirai.internal.contact.essence.GroupDigestProtocolKt.loadData(GroupDigestProtocol.kt:86) ~[mirai-core-jvm-2.15.0-dev-90.jar:2.15.0-dev-90]
	at net.mamoe.mirai.internal.contact.essence.GroupDigestProtocolKt.getDigestList(GroupDigestProtocol.kt:107) ~[mirai-core-jvm-2.15.0-dev-90.jar:2.15.0-dev-90]
	at net.mamoe.mirai.internal.contact.essence.GroupDigestProtocolKt$getDigestList$1.invokeSuspend(GroupDigestProtocol.kt) ~[mirai-core-jvm-2.15.0-dev-90.jar:2.15.0-dev-90]
	at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33) ~[kotlin-stdlib-1.8.20.jar:1.8.20-release-327(1.8.20)]
	at net.mamoe.mirai.internal.deps.io.ktor.util.pipeline.SuspendFunctionGun.resumeRootWith(SuspendFunctionGun.kt:138) ~[mirai-core-jvm-2.15.0-dev-90.jar:2.15.0-dev-90]
	at net.mamoe.mirai.internal.deps.io.ktor.util.pipeline.SuspendFunctionGun.loop(SuspendFunctionGun.kt:112) ~[mirai-core-jvm-2.15.0-dev-90.jar:2.15.0-dev-90]
	at net.mamoe.mirai.internal.deps.io.ktor.util.pipeline.SuspendFunctionGun.access$loop(SuspendFunctionGun.kt:14) ~[mirai-core-jvm-2.15.0-dev-90.jar:2.15.0-dev-90]
	at net.mamoe.mirai.internal.deps.io.ktor.util.pipeline.SuspendFunctionGun$continuation$1.resumeWith(SuspendFunctionGun.kt:62) ~[mirai-core-jvm-2.15.0-dev-90.jar:2.15.0-dev-90]
	at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:46) ~[kotlin-stdlib-1.8.20.jar:1.8.20-release-327(1.8.20)]
	at net.mamoe.mirai.internal.deps.io.ktor.util.pipeline.SuspendFunctionGun.resumeRootWith(SuspendFunctionGun.kt:138) ~[mirai-core-jvm-2.15.0-dev-90.jar:2.15.0-dev-90]
	at net.mamoe.mirai.internal.deps.io.ktor.util.pipeline.SuspendFunctionGun.loop(SuspendFunctionGun.kt:112) ~[mirai-core-jvm-2.15.0-dev-90.jar:2.15.0-dev-90]
	at net.mamoe.mirai.internal.deps.io.ktor.util.pipeline.SuspendFunctionGun.access$loop(SuspendFunctionGun.kt:14) ~[mirai-core-jvm-2.15.0-dev-90.jar:2.15.0-dev-90]
	at net.mamoe.mirai.internal.deps.io.ktor.util.pipeline.SuspendFunctionGun$continuation$1.resumeWith(SuspendFunctionGun.kt:62) ~[mirai-core-jvm-2.15.0-dev-90.jar:2.15.0-dev-90]
	at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:46) ~[kotlin-stdlib-1.8.20.jar:1.8.20-release-327(1.8.20)]
	at net.mamoe.mirai.internal.deps.io.ktor.util.pipeline.SuspendFunctionGun.resumeRootWith(SuspendFunctionGun.kt:138) ~[mirai-core-jvm-2.15.0-dev-90.jar:2.15.0-dev-90]
	at net.mamoe.mirai.internal.deps.io.ktor.util.pipeline.SuspendFunctionGun.loop(SuspendFunctionGun.kt:112) ~[mirai-core-jvm-2.15.0-dev-90.jar:2.15.0-dev-90]
	at net.mamoe.mirai.internal.deps.io.ktor.util.pipeline.SuspendFunctionGun.access$loop(SuspendFunctionGun.kt:14) ~[mirai-core-jvm-2.15.0-dev-90.jar:2.15.0-dev-90]
	at net.mamoe.mirai.internal.deps.io.ktor.util.pipeline.SuspendFunctionGun$continuation$1.resumeWith(SuspendFunctionGun.kt:62) ~[mirai-core-jvm-2.15.0-dev-90.jar:2.15.0-dev-90]
	at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:46) ~[kotlin-stdlib-1.8.20.jar:1.8.20-release-327(1.8.20)]
	at net.mamoe.mirai.internal.deps.io.ktor.util.pipeline.SuspendFunctionGun.resumeRootWith(SuspendFunctionGun.kt:138) ~[mirai-core-jvm-2.15.0-dev-90.jar:2.15.0-dev-90]
	at net.mamoe.mirai.internal.deps.io.ktor.util.pipeline.SuspendFunctionGun.loop(SuspendFunctionGun.kt:112) ~[mirai-core-jvm-2.15.0-dev-90.jar:2.15.0-dev-90]
	at net.mamoe.mirai.internal.deps.io.ktor.util.pipeline.SuspendFunctionGun.access$loop(SuspendFunctionGun.kt:14) ~[mirai-core-jvm-2.15.0-dev-90.jar:2.15.0-dev-90]
	at net.mamoe.mirai.internal.deps.io.ktor.util.pipeline.SuspendFunctionGun$continuation$1.resumeWith(SuspendFunctionGun.kt:62) ~[mirai-core-jvm-2.15.0-dev-90.jar:2.15.0-dev-90]
	at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:46) ~[kotlin-stdlib-1.8.20.jar:1.8.20-release-327(1.8.20)]
	at net.mamoe.mirai.internal.deps.io.ktor.util.pipeline.SuspendFunctionGun.resumeRootWith(SuspendFunctionGun.kt:138) ~[mirai-core-jvm-2.15.0-dev-90.jar:2.15.0-dev-90]
	at net.mamoe.mirai.internal.deps.io.ktor.util.pipeline.SuspendFunctionGun.loop(SuspendFunctionGun.kt:112) ~[mirai-core-jvm-2.15.0-dev-90.jar:2.15.0-dev-90]
	at net.mamoe.mirai.internal.deps.io.ktor.util.pipeline.SuspendFunctionGun.access$loop(SuspendFunctionGun.kt:14) ~[mirai-core-jvm-2.15.0-dev-90.jar:2.15.0-dev-90]
	at net.mamoe.mirai.internal.deps.io.ktor.util.pipeline.SuspendFunctionGun$continuation$1.resumeWith(SuspendFunctionGun.kt:62) ~[mirai-core-jvm-2.15.0-dev-90.jar:2.15.0-dev-90]
	at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:46) ~[kotlin-stdlib-1.8.20.jar:1.8.20-release-327(1.8.20)]
	at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:106) ~[kotlinx-coroutines-core-jvm-1.6.4.jar:na]
	at kotlinx.coroutines.EventLoopImplBase.processNextEvent(EventLoop.common.kt:284) ~[kotlinx-coroutines-core-jvm-1.6.4.jar:na]
	at kotlinx.coroutines.BlockingCoroutine.joinBlocking(Builders.kt:85) ~[kotlinx-coroutines-core-jvm-1.6.4.jar:na]
	at kotlinx.coroutines.BuildersKt__BuildersKt.runBlocking(Builders.kt:59) ~[kotlinx-coroutines-core-jvm-1.6.4.jar:na]
	at kotlinx.coroutines.BuildersKt.runBlocking(Unknown Source) ~[kotlinx-coroutines-core-jvm-1.6.4.jar:na]
	at kotlinx.coroutines.BuildersKt__BuildersKt.runBlocking$default(Builders.kt:38) ~[kotlinx-coroutines-core-jvm-1.6.4.jar:na]
	at kotlinx.coroutines.BuildersKt.runBlocking$default(Unknown Source) ~[kotlinx-coroutines-core-jvm-1.6.4.jar:na]
	at me.kuku.mirai.config.ScheduledSuspendMethodRunnable.run(ScheduledSuspendConfig.kt:52) ~[main/:na]
	at org.springframework.scheduling.support.DelegatingErrorHandlingRunnable.run(DelegatingErrorHandlingRunnable.java:54) ~[spring-context-6.0.7.jar:6.0.7]
	at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:539) ~[na:na]
	at java.base/java.util.concurrent.FutureTask.runAndReset$$$capture(FutureTask.java:305) ~[na:na]
	at java.base/java.util.concurrent.FutureTask.runAndReset(FutureTask.java) ~[na:na]
	at java.base/java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:305) ~[na:na]
	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136) ~[na:na]
	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635) ~[na:na]
	at java.base/java.lang.Thread.run(Thread.java:833) ~[na:na]
Caused by: kotlinx.serialization.json.internal.JsonDecodingException: Failed to parse 'int'
JSON input: .....ontent":[{"msg_type":1,"text":"https://xxxxx.xxxxx.me"}]}
	at kotlinx.serialization.json.internal.JsonExceptionsKt.JsonDecodingException(JsonExceptions.kt:24) ~[kotlinx-serialization-json-jvm-1.5.0.jar:na]
	at kotlinx.serialization.json.internal.JsonExceptionsKt.JsonDecodingException(JsonExceptions.kt:32) ~[kotlinx-serialization-json-jvm-1.5.0.jar:na]
	at kotlinx.serialization.json.internal.AbstractJsonTreeDecoder.unparsedPrimitive(TreeJsonDecoder.kt:146) ~[kotlinx-serialization-json-jvm-1.5.0.jar:na]
	at kotlinx.serialization.json.internal.AbstractJsonTreeDecoder.decodeTaggedInt(TreeJsonDecoder.kt:380) ~[kotlinx-serialization-json-jvm-1.5.0.jar:na]
	at kotlinx.serialization.json.internal.AbstractJsonTreeDecoder.decodeTaggedInt(TreeJsonDecoder.kt:36) ~[kotlinx-serialization-json-jvm-1.5.0.jar:na]
	at kotlinx.serialization.internal.TaggedDecoder.decodeIntElement(Tagged.kt:252) ~[kotlinx-serialization-core-jvm-1.5.0.jar:1.5.0]
	at net.mamoe.mirai.internal.contact.essence.DigestMessage$$serializer.deserialize(GroupDigestProtocol.kt:50) ~[mirai-core-jvm-2.15.0-dev-90.jar:2.15.0-dev-90]
	at net.mamoe.mirai.internal.contact.essence.DigestMessage$$serializer.deserialize(GroupDigestProtocol.kt:50) ~[mirai-core-jvm-2.15.0-dev-90.jar:2.15.0-dev-90]
	at kotlinx.serialization.json.internal.PolymorphicKt.decodeSerializableValuePolymorphic(Polymorphic.kt:61) ~[kotlinx-serialization-json-jvm-1.5.0.jar:na]
	at kotlinx.serialization.json.internal.AbstractJsonTreeDecoder.decodeSerializableValue(TreeJsonDecoder.kt:52) ~[kotlinx-serialization-json-jvm-1.5.0.jar:na]
	at kotlinx.serialization.internal.TaggedDecoder.decodeSerializableValue(Tagged.kt:207) ~[kotlinx-serialization-core-jvm-1.5.0.jar:1.5.0]
	at kotlinx.serialization.internal.TaggedDecoder$decodeSerializableElement$1.invoke(Tagged.kt:280) ~[kotlinx-serialization-core-jvm-1.5.0.jar:1.5.0]
	at kotlinx.serialization.internal.TaggedDecoder.tagBlock(Tagged.kt:297) ~[kotlinx-serialization-core-jvm-1.5.0.jar:1.5.0]
	at kotlinx.serialization.internal.TaggedDecoder.decodeSerializableElement(Tagged.kt:280) ~[kotlinx-serialization-core-jvm-1.5.0.jar:1.5.0]
	at kotlinx.serialization.encoding.CompositeDecoder$DefaultImpls.decodeSerializableElement$default(Decoding.kt:533) ~[kotlinx-serialization-core-jvm-1.5.0.jar:1.5.0]
	at kotlinx.serialization.internal.CollectionLikeSerializer.readElement(CollectionSerializers.kt:80) ~[kotlinx-serialization-core-jvm-1.5.0.jar:1.5.0]
	at kotlinx.serialization.internal.AbstractCollectionSerializer.readElement$default(CollectionSerializers.kt:51) ~[kotlinx-serialization-core-jvm-1.5.0.jar:1.5.0]
	at kotlinx.serialization.internal.AbstractCollectionSerializer.merge(CollectionSerializers.kt:36) ~[kotlinx-serialization-core-jvm-1.5.0.jar:1.5.0]
	at kotlinx.serialization.internal.AbstractCollectionSerializer.deserialize(CollectionSerializers.kt:43) ~[kotlinx-serialization-core-jvm-1.5.0.jar:1.5.0]
	at kotlinx.serialization.json.internal.PolymorphicKt.decodeSerializableValuePolymorphic(Polymorphic.kt:61) ~[kotlinx-serialization-json-jvm-1.5.0.jar:na]
	at kotlinx.serialization.json.internal.AbstractJsonTreeDecoder.decodeSerializableValue(TreeJsonDecoder.kt:52) ~[kotlinx-serialization-json-jvm-1.5.0.jar:na]
	at kotlinx.serialization.internal.TaggedDecoder.decodeSerializableValue(Tagged.kt:207) ~[kotlinx-serialization-core-jvm-1.5.0.jar:1.5.0]
	at kotlinx.serialization.internal.TaggedDecoder$decodeSerializableElement$1.invoke(Tagged.kt:280) ~[kotlinx-serialization-core-jvm-1.5.0.jar:1.5.0]
	at kotlinx.serialization.internal.TaggedDecoder.tagBlock(Tagged.kt:297) ~[kotlinx-serialization-core-jvm-1.5.0.jar:1.5.0]
	at kotlinx.serialization.internal.TaggedDecoder.decodeSerializableElement(Tagged.kt:280) ~[kotlinx-serialization-core-jvm-1.5.0.jar:1.5.0]
	at net.mamoe.mirai.internal.contact.essence.DigestList$$serializer.deserialize(GroupDigestProtocol.kt:38) ~[mirai-core-jvm-2.15.0-dev-90.jar:2.15.0-dev-90]
	at net.mamoe.mirai.internal.contact.essence.DigestList$$serializer.deserialize(GroupDigestProtocol.kt:38) ~[mirai-core-jvm-2.15.0-dev-90.jar:2.15.0-dev-90]
	at kotlinx.serialization.json.internal.PolymorphicKt.decodeSerializableValuePolymorphic(Polymorphic.kt:61) ~[kotlinx-serialization-json-jvm-1.5.0.jar:na]
	at kotlinx.serialization.json.internal.AbstractJsonTreeDecoder.decodeSerializableValue(TreeJsonDecoder.kt:52) ~[kotlinx-serialization-json-jvm-1.5.0.jar:na]
	at kotlinx.serialization.json.internal.TreeJsonDecoderKt.readJson(TreeJsonDecoder.kt:25) ~[kotlinx-serialization-json-jvm-1.5.0.jar:na]
	at kotlinx.serialization.json.Json.decodeFromJsonElement(Json.kt:117) ~[kotlinx-serialization-json-jvm-1.5.0.jar:na]
	at net.mamoe.mirai.internal.contact.essence.GroupDigestProtocolKt.loadData(GroupDigestProtocol.kt:84) ~[mirai-core-jvm-2.15.0-dev-90.jar:2.15.0-dev-90]
	... 44 common frames omitted

2、群精华消息事件是哪个?
#2293 中已经提及了群精华事件,该issues已经被关闭,但是我无法找到群精华消息事件。

复现

复现如问题描述

mirai-core 版本

2.15.0-dev-90

bot-protocol

ANDROID_PAD

其他组件版本

No response

系统日志

No response

网络日志

No response

补充信息

No response

@cssxsh
Copy link
Contributor

cssxsh commented May 19, 2023

internal data class DigestMessage(
@SerialName("add_digest_nick")
val addDigestNick: String = "",
@SerialName("add_digest_time")
val addDigestTime: Int = 0,
@SerialName("add_digest_uin")
val addDigestUin: Long = 0,
@SerialName("group_code")
val groupCode: String = "",
@SerialName("msg_content")
val msgContent: List<JsonObject> = emptyList(),
@SerialName("msg_random")
val msgRandom: Int = 0,
@SerialName("msg_seq")
val msgSeq: Int = 0,
@SerialName("sender_nick")
val senderNick: String = "",
@SerialName("sender_time")
val senderTime: Int = 0,
@SerialName("sender_uin")
val senderUin: Long = 0
)

推测 msg_random 和 msg_seq 解析失败

@cssxsh
Copy link
Contributor

cssxsh commented May 24, 2023

频繁出现吗

@kukume
Copy link
Author

kukume commented May 24, 2023

我这个群必出现,没在其他群测试过

@cssxsh
Copy link
Contributor

cssxsh commented May 24, 2023

我这个群必出现,没在其他群测试过

找一条出现的精华消息,引用回复 它,然后把日志记录一下
我需要 [mirai:quote:[mirai:source:ids=..., internalIds=... 的 ids 和 internalIds 确认是为何解析失败

@kukume
Copy link
Author

kukume commented May 27, 2023

[mirai:quote:[mirai:source:ids=[98019], internalIds=[1351051379], from 1104195224 to 115492521 at 1685161905], content=]te s
我把一张图片设置了精华,然后回复了这张图片的消息日志

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants