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

机器人报错 parseOicqResponse: java.lang.IllegalStateException: 32 #1603

Open
mcdoeswhat opened this issue Oct 14, 2021 · 3 comments
Open
Labels
N 优先级: 一般 s:core 子系统: mirai-core t:problem 类型: 不容易归类为特性或 bug 的综合问题 x:protocol 属性: 协议相关 x:question 标签: 需要更多信息
Milestone

Comments

@mcdoeswhat
Copy link
Contributor

机器人刷屏报错大概2分钟一次
原因未知,重新登录依然一样
接收聊天消息正常

[06:50:36 INFO]: 2021-10-15 06:50:36 E/Net 3528054353: Exception in coroutine 'unnamed'
[06:50:36 INFO]: ExceptionInPacketCodecException(cause=java.lang.IllegalStateException: 32)
[06:50:36 INFO]:        at net.mamoe.mirai.internal.network.impl.netty.NettyNetworkHandler.handleExceptionInDecoding(NettyNetworkHandler.kt:61)
[06:50:36 INFO]:        at net.mamoe.mirai.internal.network.impl.netty.NettyNetworkHandler$ByteBufToIncomingPacketDecoder.channelRead0(NettyNetworkHandler.kt:83)
[06:50:36 INFO]:        at net.mamoe.mirai.internal.network.impl.netty.NettyNetworkHandler$ByteBufToIncomingPacketDecoder.channelRead0(NettyNetworkHandler.kt:73)
[06:50:36 INFO]:        at io.netty.channel.SimpleChannelInboundHandler.channelRead(SimpleChannelInboundHandler.java:99)
[06:50:36 INFO]:        at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:379)
[06:50:36 INFO]:        at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:365)
[06:50:36 INFO]:        at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:357)
[06:50:36 INFO]:        at io.netty.handler.codec.ByteToMessageDecoder.fireChannelRead(ByteToMessageDecoder.java:324)
[06:50:36 INFO]:        at io.netty.handler.codec.ByteToMessageDecoder.channelRead(ByteToMessageDecoder.java:296)
[06:50:36 INFO]:        at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:379)
[06:50:36 INFO]:        at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:365)
[06:50:36 INFO]:        at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:357)
[06:50:36 INFO]:        at io.netty.channel.DefaultChannelPipeline$HeadContext.channelRead(DefaultChannelPipeline.java:1410)
[06:50:36 INFO]:        at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:379)
[06:50:36 INFO]:        at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:365)
[06:50:36 INFO]:        at io.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChannelPipeline.java:919)
[06:50:36 INFO]:        at io.netty.channel.nio.AbstractNioByteChannel$NioByteUnsafe.read(AbstractNioByteChannel.java:163)
[06:50:36 INFO]:        at io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:714)
[06:50:36 INFO]:        at io.netty.channel.nio.NioEventLoop.processSelectedKeysOptimized(NioEventLoop.java:650)
[06:50:36 INFO]:        at io.netty.channel.nio.NioEventLoop.processSelectedKeys(NioEventLoop.java:576)
[06:50:36 INFO]:        at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:493)
[06:50:36 INFO]:        at io.netty.util.concurrent.SingleThreadEventExecutor$4.run(SingleThreadEventExecutor.java:989)
[06:50:36 INFO]:        at io.netty.util.internal.ThreadExecutorMap$2.run(ThreadExecutorMap.java:74)
[06:50:36 INFO]:        at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30)
[06:50:36 INFO]:        at java.base/java.lang.Thread.run(Thread.java:834)
[06:50:36 INFO]: Caused by: java.lang.IllegalStateException: 32
[06:50:36 INFO]:        at net.mamoe.mirai.internal.network.components.PacketCodecImpl.parseOicqResponse(PacketCodec.kt:197)
[06:50:36 INFO]:        at net.mamoe.mirai.internal.network.components.PacketCodecImpl.decodeRaw(PacketCodec.kt:108)
[06:50:36 INFO]:        at net.mamoe.mirai.internal.network.impl.netty.NettyNetworkHandler$ByteBufToIncomingPacketDecoder.channelRead0(NettyNetworkHandler.kt:80)
[06:50:36 INFO]:        ... 23 more
[06:50:36 INFO]:        Suppressed: net.mamoe.mirai.internal.network.components.OicqDecodingException
[06:50:36 INFO]:        [CIRCULAR REFERENCE:java.lang.IllegalStateException: 32]
[06:50:36 INFO]:

复现

版本及相关选项选择

  • mirai-core: 2.8.0-M1
  • bot-protocol: ANDROID_PAD

网络日志


补充信息

@mcdoeswhat mcdoeswhat added the x:question 标签: 需要更多信息 label Oct 14, 2021
@mcdoeswhat
Copy link
Contributor Author

重启后恢复正常了

@Him188 Him188 changed the title 机器人报错 机器人报错 parseOicqResponse: java.lang.IllegalStateException: 32 Oct 28, 2021
@Him188 Him188 added N 优先级: 一般 t:problem 类型: 不容易归类为特性或 bug 的综合问题 x:protocol 属性: 协议相关 labels Oct 28, 2021
@Him188 Him188 added this to the Backlog milestone Oct 28, 2021
@Him188 Him188 added the s:core 子系统: mirai-core label Jan 4, 2022
@zhaodice
Copy link
Contributor

zhaodice commented Jan 17, 2022

Exception in coroutine 'unnamed'
ExceptionInPacketCodecException(cause=java.lang.IllegalStateException: 32)
        at net.mamoe.mirai.internal.network.impl.netty.NettyNetworkHandler.handl
eExceptionInDecoding(NettyNetworkHandler.kt:61)
        at net.mamoe.mirai.internal.network.impl.netty.NettyNetworkHandler$ByteB
ufToIncomingPacketDecoder.channelRead0(NettyNetworkHandler.kt:83)
        at net.mamoe.mirai.internal.network.impl.netty.NettyNetworkHandler$ByteB
ufToIncomingPacketDecoder.channelRead0(NettyNetworkHandler.kt:73)
        at io.netty.channel.SimpleChannelInboundHandler.channelRead(SimpleChanne
lInboundHandler.java:99)
        at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(Abst
ractChannelHandlerContext.java:379)
        at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(Abst
ractChannelHandlerContext.java:365)
        at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(Abstra
ctChannelHandlerContext.java:357)
        at io.netty.handler.codec.ByteToMessageDecoder.fireChannelRead(ByteToMes
sageDecoder.java:324)
        at io.netty.handler.codec.ByteToMessageDecoder.channelRead(ByteToMessage
Decoder.java:296)
        at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(Abst
ractChannelHandlerContext.java:379)
        at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(Abst
ractChannelHandlerContext.java:365)
        at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(Abstra
ctChannelHandlerContext.java:357)
        at io.netty.channel.DefaultChannelPipeline$HeadContext.channelRead(Defau
ltChannelPipeline.java:1410)
        at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(Abst
ractChannelHandlerContext.java:379)
        at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(Abst
ractChannelHandlerContext.java:365)
        at io.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChanne
lPipeline.java:919)
        at io.netty.channel.nio.AbstractNioByteChannel$NioByteUnsafe.read(Abstra
ctNioByteChannel.java:166)
        at io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.jav
a:719)
        at io.netty.channel.nio.NioEventLoop.processSelectedKeysOptimized(NioEve
ntLoop.java:655)
        at io.netty.channel.nio.NioEventLoop.processSelectedKeys(NioEventLoop.ja
va:581)
        at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:493)
        at io.netty.util.concurrent.SingleThreadEventExecutor$4.run(SingleThread
EventExecutor.java:989)
        at io.netty.util.internal.ThreadExecutorMap$2.run(ThreadExecutorMap.java
:74)
        at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalR
unnable.java:30)
        at java.lang.Thread.run(Thread.java:748)
Caused by: java.lang.IllegalStateException: 32
        at net.mamoe.mirai.internal.network.components.PacketCodecImpl.parseOicq
Response(PacketCodec.kt:197)
        at net.mamoe.mirai.internal.network.components.PacketCodecImpl.decodeRaw
(PacketCodec.kt:108)
        at net.mamoe.mirai.internal.network.impl.netty.NettyNetworkHandler$ByteB
ufToIncomingPacketDecoder.channelRead0(NettyNetworkHandler.kt:80)
        ... 23 more
        Suppressed: net.mamoe.mirai.internal.network.components.OicqDecodingExce
ption
        Caused by: [CIRCULAR REFERENCE: java.lang.IllegalStateException: 32]

我也出现了,不过是挂一段时间后出现的,大概好几个小时。
出现之后就收不到消息,不回复了,只能重启(上次准备重启的时候它自己恢复了,就没重启,不知道为什么)

@nannanness
Copy link

貌似遇到了同样的问题,本地跑的时候没有问题,放到服务器上挂一会儿后就出现问题了,然后会一直重复刷屏。

[31m2022-07-03 23:45:49 E/Net 1906596xxx: Exception in coroutine 'unnamed' ExceptionInPacketCodecException(cause=java.lang.IllegalStateException: 32) at net.mamoe.mirai.internal.network.impl.netty.NettyNetworkHandler.handleExceptionInDecoding$passToExceptionHandler(NettyNetworkHandler.kt:61) at net.mamoe.mirai.internal.network.impl.netty.NettyNetworkHandler.handleExceptionInDecoding(NettyNetworkHandler.kt:77) at net.mamoe.mirai.internal.network.impl.netty.NettyNetworkHandler$ByteBufToIncomingPacketDecoder.channelRead0(NettyNetworkHandler.kt:98) at net.mamoe.mirai.internal.network.impl.netty.NettyNetworkHandler$ByteBufToIncomingPacketDecoder.channelRead0(NettyNetworkHandler.kt:88) at io.netty.channel.SimpleChannelInboundHandler.channelRead(SimpleChannelInboundHandler.java:99) at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:379) at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:365) at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:357) at io.netty.handler.codec.ByteToMessageDecoder.fireChannelRead(ByteToMessageDecoder.java:324) at io.netty.handler.codec.ByteToMessageDecoder.fireChannelRead(ByteToMessageDecoder.java:311) at io.netty.handler.codec.ByteToMessageDecoder.callDecode(ByteToMessageDecoder.java:432) at io.netty.handler.codec.ByteToMessageDecoder.channelRead(ByteToMessageDecoder.java:276) at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:379) at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:365) at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:357) at io.netty.channel.DefaultChannelPipeline$HeadContext.channelRead(DefaultChannelPipeline.java:1410) at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:379) at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:365) at io.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChannelPipeline.java:919) at io.netty.channel.nio.AbstractNioByteChannel$NioByteUnsafe.read(AbstractNioByteChannel.java:166) at io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:719) at io.netty.channel.nio.NioEventLoop.processSelectedKeysOptimized(NioEventLoop.java:655) at io.netty.channel.nio.NioEventLoop.processSelectedKeys(NioEventLoop.java:581) at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:493) at io.netty.util.concurrent.SingleThreadEventExecutor$4.run(SingleThreadEventExecutor.java:989) at io.netty.util.internal.ThreadExecutorMap$2.run(ThreadExecutorMap.java:74) at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30) at java.lang.Thread.run(Thread.java:750) Caused by: java.lang.IllegalStateException: 32 at net.mamoe.mirai.internal.network.components.PacketCodecImpl.parseOicqResponse(PacketCodec.kt:247) at net.mamoe.mirai.internal.network.components.PacketCodecImpl.decodeRaw(PacketCodec.kt:142) at net.mamoe.mirai.internal.network.impl.netty.NettyNetworkHandler$ByteBufToIncomingPacketDecoder.channelRead0(NettyNetworkHandler.kt:95) ... 25 more Suppressed: net.mamoe.mirai.internal.network.components.PacketCodecException: java.lang.IllegalStateException: 32 at net.mamoe.mirai.internal.network.components.PacketCodecImpl.decodeRaw(PacketCodec.kt:144) ... 26 more [CIRCULAR REFERENCE:java.lang.IllegalStateException: 32] [CIRCULAR REFERENCE:net.mamoe.mirai.internal.network.components.PacketCodecException: java.lang.IllegalStateException: 32]

重启后过一会儿还会出现,不过我注意到这段错误上面还有一个异常,BotOfflineEvent.Dropped应该是掉线了,是网络带宽的问题吗。。

�[0m2022-07-03 23:32:19 V/Bot 1906596xxx: Event: BotOfflineEvent.Dropped(bot=Bot(1906596xxx), cause=NettyChannelException(message=null, cause=null), reconnect=true)�[0m �[91m2022-07-03 23:32:19 W/Bot 1906596xxx: Connection lost, reconnecting... (NettyChannelException(message=null, cause=null))�[0m �[91m2022-07-03 23:32:19 W/Net 1906596xxx: NettyChannelException(message=null, cause=null) NettyChannelException(message=null, cause=null) at net.mamoe.mirai.internal.network.impl.netty.NettyNetworkHandler.createConnection$lambda-3(NettyNetworkHandler.kt:177) at io.netty.util.concurrent.DefaultPromise.notifyListener0(DefaultPromise.java:578) at io.netty.util.concurrent.DefaultPromise.notifyListenersNow(DefaultPromise.java:552) at io.netty.util.concurrent.DefaultPromise.notifyListeners(DefaultPromise.java:491) at io.netty.util.concurrent.DefaultPromise.setValue0(DefaultPromise.java:616) at io.netty.util.concurrent.DefaultPromise.setSuccess0(DefaultPromise.java:605) at io.netty.util.concurrent.DefaultPromise.trySuccess(DefaultPromise.java:104) at io.netty.channel.DefaultChannelPromise.trySuccess(DefaultChannelPromise.java:84) at io.netty.channel.AbstractChannel$CloseFuture.setClosed(AbstractChannel.java:1186) at io.netty.channel.AbstractChannel$AbstractUnsafe.doClose0(AbstractChannel.java:773) at io.netty.channel.AbstractChannel$AbstractUnsafe.close(AbstractChannel.java:749) at io.netty.channel.AbstractChannel$AbstractUnsafe.close(AbstractChannel.java:620) at io.netty.channel.nio.AbstractNioByteChannel$NioByteUnsafe.closeOnRead(AbstractNioByteChannel.java:105) at io.netty.channel.nio.AbstractNioByteChannel$NioByteUnsafe.read(AbstractNioByteChannel.java:174) at io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:719) at io.netty.channel.nio.NioEventLoop.processSelectedKeysOptimized(NioEventLoop.java:655) at io.netty.channel.nio.NioEventLoop.processSelectedKeys(NioEventLoop.java:581) at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:493) at io.netty.util.concurrent.SingleThreadEventExecutor$4.run(SingleThreadEventExecutor.java:989) at io.netty.util.internal.ThreadExecutorMap$2.run(ThreadExecutorMap.java:74) at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30) at java.lang.Thread.run(Thread.java:750)

@zhaodice 你好,这个问题你解决了吗 @mcdoeswhat

sandtechnology added a commit to sandtechnology/mirai that referenced this issue Jan 21, 2023
Him188 added a commit that referenced this issue Mar 21, 2023
* Handle rare case on packet pipeline
Fix #2449, should help #1603

* Fix and improve tips and improve the readability of code

* Improve wording of tips

Co-authored-by: Him188 <Him188@mamoe.net>

* Change d2Key error type to PROTOCOL_UPDATED

* Reformat code

---------

Co-authored-by: Him188 <Him188@mamoe.net>
StageGuard pushed a commit to StageGuard/mirai that referenced this issue Apr 14, 2023
* Handle rare case on packet pipeline
Fix mamoe#2449, should help mamoe#1603

* Fix and improve tips and improve the readability of code

* Improve wording of tips

Co-authored-by: Him188 <Him188@mamoe.net>

* Change d2Key error type to PROTOCOL_UPDATED

* Reformat code

---------

Co-authored-by: Him188 <Him188@mamoe.net>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
N 优先级: 一般 s:core 子系统: mirai-core t:problem 类型: 不容易归类为特性或 bug 的综合问题 x:protocol 属性: 协议相关 x:question 标签: 需要更多信息
Projects
None yet
Development

No branches or pull requests

4 participants