turms-im / turms

🕊️ The world's most advanced open source instant messaging engine for 100K~10M concurrent users https://turms-im.github.io/docs
Apache License 2.0
1.74k stars 269 forks source link

The http create big message ERROR #1509

Closed zhaieryuan closed 2 months ago

zhaieryuan commented 3 months ago

io.netty.util.IllegalReferenceCountException: refCnt: 0, increment: 1 at io.netty.util.internal.ReferenceCountUpdater.retain0(ReferenceCountUpdater.java:133) at io.netty.util.internal.ReferenceCountUpdater.retain(ReferenceCountUpdater.java:120) at io.netty.buffer.AbstractReferenceCountedByteBuf.retain(AbstractReferenceCountedByteBuf.java:81) at io.netty.buffer.WrappedByteBuf.retain(WrappedByteBuf.java:1004) at io.netty.buffer.AdvancedLeakAwareByteBuf.retain(AdvancedLeakAwareByteBuf.java:930) at im.turms.server.common.access.admin.web.HttpRequestParamParser.lambda$parseBody$3(HttpRequestParamParser.java:267) at reactor.core.publisher.FluxPeek$PeekSubscriber.onNext(FluxPeek.java:185) at reactor.core.publisher.FluxMap$MapSubscriber.onNext(FluxMap.java:122) at reactor.netty.channel.FluxReceive.onInboundNext(FluxReceive.java:379) at reactor.netty.channel.ChannelOperations.onInboundNext(ChannelOperations.java:426) at reactor.netty.http.server.HttpServerOperations.onInboundNext(HttpServerOperations.java:677) at reactor.netty.channel.ChannelOperationsHandler.channelRead(ChannelOperationsHandler.java:114) at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:444) at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:420) at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:412) at reactor.netty.http.server.HttpTrafficHandler.channelRead(HttpTrafficHandler.java:284) at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:442) at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:420) at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:412) at io.netty.channel.CombinedChannelDuplexHandler$DelegatingChannelHandlerContext.fireChannelRead(CombinedChannelDuplexHandler.java:436) at io.netty.handler.codec.ByteToMessageDecoder.fireChannelRead(ByteToMessageDecoder.java:346) at io.netty.handler.codec.ByteToMessageDecoder.channelRead(ByteToMessageDecoder.java:318) at io.netty.channel.CombinedChannelDuplexHandler.channelRead(CombinedChannelDuplexHandler.java:251) at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:442) at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:420) at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:412) at reactor.netty.channel.AbstractChannelMetricsHandler.channelRead(AbstractChannelMetricsHandler.java:141) at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:442) at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:420) at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:412) at io.netty.channel.DefaultChannelPipeline$HeadContext.channelRead(DefaultChannelPipeline.java:1410) at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:440) at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:420) 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:788) at io.netty.channel.nio.NioEventLoop.processSelectedKeysOptimized(NioEventLoop.java:724) at io.netty.channel.nio.NioEventLoop.processSelectedKeys(NioEventLoop.java:650) at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:562) at io.netty.util.concurrent.SingleThreadEventExecutor$4.run(SingleThreadEventExecutor.java:997) 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:1583)

请求参数如下(仅部分): { "text": "[方案卡片]", "isGroupMessage": false, "targetId": "6001", "senderId": "6002", "isSystemMessage": false, "senderDeviceType": "BROWSER", "text": ["{\"type\":\"SMART_SCHEME\",\"description\":{\"audio\":\"\",\"schemeMessageList\":[{\"level\":2,\"length\":19,\"time\":\"2024-04-29 17:19:08\",\"type\":\"content\",\"content\":\"好的,从大家的共商中我理解到:\\n\\n\"},{\"level\":0,\"length\":7,\"time\":\"2024-04-29 17:19:08\",\"type\":\"title\",\"content\":\"需求总结:\\n\"},{\"level\":2,\"length\":67,\"time\":\"2024-04-29 17:19:08\",\"type\":\"content\",\"content\":\"家庭成员表现出对生成解决方案的频繁需求,关注点包括家庭安全(燃气使用)、健康饮食以及居家照顾。此外,可能存在对家庭活动安排的关注。\\n\"},{\"level\":0,\"length\":11,\"time\":\"2024-04-29 17:19:08\",\"type\":\"title\",\"content\":\"我的共策方案如下:\\n\"},{\"level\":1,\"length\":10,\"time\":\"2024-04-29 17:19:08\",\"type\":\"title\",\"title\":\"# 家人居家照顾方案\",\"content\":\"# 家人居家照顾方案\"},{\"level\":2,\"length\":9,\"time\":\"2024-04-29 17:19:08\",\"type\":\"title\",\"title\":\"## 居家安全保障\",\"content\":\"## 居家安全保障\"},{\"is_chunk\":true,\"level\":2,\"length\":2,\"time\":\"2024-04-29 17:19:21\",\"type\":\"content\",\"title\":\"## 居家安全保障\",\"content\":\"居家\"},{\"is_chunk\":true,\"level\":2,\"length\":4,\"time\":\"2024-04-29 17:19:21\",\"type\":\"content\",\"title\":\"## 居家安全保障\",\"content\":\"安全保障\"},{\"is_chunk\":true,\"level\":2,\"length\":1,\"time\":\"2024-04-29 17:19:21\",\"type\":\"content\",\"title\":\"## 居家安全保障\",\"content\":\":\"},{\"is_chunk\":true,\"level\":2,\"length\":2,\"time\":\"2024-04-29 17:19:21\",\"type\":\"content\",\"title\":\"## 居家安全保障\",\"content\":\"建议\"},{\"is_chunk\":true,\"level\":2,\"length\":2,\"time\":\"2024-04-29 }

JamesChenX commented 3 months ago

Many reasons may cause the problem, and if you want to try a fix quickly, upgrade your Turms servers to the latest version and try again. If you are in no hurry, it is recommended to wait for me to publish a polished version as I am refactoring the admin APIs and improving the implementation, which may be published this month.

And please post the build properties of Turms next time (by searching The local node with the build properties in logs).

zhaieryuan commented 2 months ago

我这里修复了这个bug, 请问一下,是否有社区成员贡献代码的渠道呢?

JamesChenX commented 2 months ago

我这里修复了这个bug, 请问一下,是否有社区成员贡献代码的渠道呢?

Thanks for your bugfix in advance! You can give a PR, and I will publish new images once it has been merged.

JamesChenX commented 2 months ago

Thanks for your PR! I have merged it, and you can pull the latest code in both develop or master branches, or pull the latest images that contain the bugfix.