Open qiyuan4f opened 2 weeks ago
@ShenFeng312 can you take a look?
Find another bug. The http-dubbo doen't work with latest version of dubbo-serialization-fastjson extentsion. Actually, only works with 1.0.1 version
There are the detail exception from other version.
{"@timestamp":"2024-10-08T13:13:55.650Z","traceId":"","timestamp":"2024-10-08 21:13:55.650","thread":"NettyServerWorker-3-3","level":"WARN","class":"o.a.d.rpc.protocol.dubbo.DecodeableRpcInvocation","rest":" [DUBBO] Decode rpc invocation failed: org.apache.dubbo.common.serialize.SerializationException: java.lang.IllegalArgumentException: deserialize failed. expected read length: 573713968 but actual read: 97, dubbo version: 3.3.0, current host: 172.22.15.144, error code: 4-20. This may be caused by , go to https://dubbo.apache.org/faq/4/20 to find instructions. ","exception":"java.io.IOException: org.apache.dubbo.common.serialize.SerializationException: java.lang.IllegalArgumentException: deserialize failed. expected read length: 573713968 but actual read: 97\n\tat org.apache.dubbo.common.serialize.DefaultSerializationExceptionWrapper.handleToIOException(DefaultSerializationExceptionWrapper.java:353)\n\tat org.apache.dubbo.common.serialize.DefaultSerializationExceptionWrapper.access$000(DefaultSerializationExceptionWrapper.java:27)\n\tat org.apache.dubbo.common.serialize.DefaultSerializationExceptionWrapper$ProxyObjectInput.readUTF(DefaultSerializationExceptionWrapper.java:136)\n\tat org.apache.dubbo.rpc.protocol.dubbo.DecodeableRpcInvocation.decode(DecodeableRpcInvocation.java:132)\n\tat org.apache.dubbo.rpc.protocol.dubbo.DecodeableRpcInvocation.decode(DecodeableRpcInvocation.java:106)\n\tat org.apache.dubbo.rpc.protocol.dubbo.DubboCodec.decodeBody(DubboCodec.java:200)\n\tat org.apache.dubbo.remoting.exchange.codec.ExchangeCodec.decode(ExchangeCodec.java:137)\n\tat org.apache.dubbo.remoting.exchange.codec.ExchangeCodec.decode(ExchangeCodec.java:92)\n\tat org.apache.dubbo.rpc.protocol.dubbo.DubboCountCodec.decode(DubboCountCodec.java:59)\n\tat org.apache.dubbo.remoting.transport.netty4.NettyCodecAdapter$InternalDecoder.decode(NettyCodecAdapter.java:103)\n\tat io.netty.handler.codec.ByteToMessageDecoder.decodeRemovalReentryProtection(ByteToMessageDecoder.java:529)\n\tat io.netty.handler.codec.ByteToMessageDecoder.callDecode(ByteToMessageDecoder.java:468)\n\tat io.netty.handler.codec.ByteToMessageDecoder.channelRead(ByteToMessageDecoder.java:290)\n\tat io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:444)\n\tat io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:420)\n\tat io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:412)\n\tat io.netty.handler.codec.ByteToMessageDecoder.handlerRemoved(ByteToMessageDecoder.java:266)\n\tat io.netty.handler.codec.ByteToMessageDecoder.decodeRemovalReentryProtection(ByteToMessageDecoder.java:536)\n\tat io.netty.handler.codec.ByteToMessageDecoder.callDecode(ByteToMessageDecoder.java:468)\n\tat io.netty.handler.codec.ByteToMessageDecoder.channelRead(ByteToMessageDecoder.java:290)\n\tat io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:444)\n\tat io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:420)\n\tat io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:412)\n\tat io.netty.channel.DefaultChannelPipeline$HeadContext.channelRead(DefaultChannelPipeline.java:1410)\n\tat io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:440)\n\tat io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:420)\n\tat io.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChannelPipeline.java:919)\n\tat io.netty.channel.nio.AbstractNioByteChannel$NioByteUnsafe.read(AbstractNioByteChannel.java:166)\n\tat io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:788)\n\tat io.netty.channel.nio.NioEventLoop.processSelectedKeysOptimized(NioEventLoop.java:724)\n\tat io.netty.channel.nio.NioEventLoop.processSelectedKeys(NioEventLoop.java:650)\n\tat io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:562)\n\tat io.netty.util.concurrent.SingleThreadEventExecutor$4.run(SingleThreadEventExecutor.java:997)\n\tat io.netty.util.internal.ThreadExecutorMap$2.run(ThreadExecutorMap.java:74)\n\tat io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30)\n\tat java.base/java.lang.Thread.run(Thread.java:829)\nCaused by: org.apache.dubbo.common.serialize.SerializationException: java.lang.IllegalArgumentException: deserialize failed. expected read length: 573713968 but actual read: 97\n\t... 36 common frames omitted\nCaused by: java.lang.IllegalArgumentException: deserialize failed. expected read length: 573713968 but actual read: 97\n\tat org.apache.dubbo.common.serialize.fastjson.FastJsonObjectInput.readObject(FastJsonObjectInput.java:53)\n\tat org.apache.dubbo.common.serialize.fastjson.FastJsonObjectInput.readObject(FastJsonObjectInput.java:43)\n\tat org.apache.dubbo.common.serialize.DefaultJsonDataInput.readUTF(DefaultJsonDataInput.java:63)\n\tat org.apache.dubbo.common.serialize.DefaultSerializationExceptionWrapper$ProxyObjectInput.readUTF(DefaultSerializationExceptionWrapper.java:134)\n\t... 33 common frames omitted\n"} {"@timestamp":"2024-10-08T13:14:01.616Z","traceId":"","timestamp":"2024-10-08 21:14:01.616","thread":"NettyServerWorker-3-3","level":"WARN","class":"org.apache.dubbo.remoting.transport.AbstractServer","rest":" [DUBBO] All clients has disconnected from /172.22.15.144:20882. You can graceful shutdown now., dubbo version: 3.3.0, current host: 172.22.15.144, error code: 99-0. This may be caused by unknown error in remoting module, go to https://dubbo.apache.org/faq/99/0 to find instructions. ","exception":""}
verify the issue, all the http-dubbo content is not compatible with new version.
dubbo-fastjson-extension 1.0.1, read by line
public byte[] readBytes() throws IOException { return this.readLine().getBytes(); }
but they changed the way to read bytes post 1.0.1, now is already version 3.3.0.
length content
public byte[] readBytes() throws IOException { int length = this.is.read(); byte[] bytes = new byte[length]; int read = this.is.read(bytes, 0, length); if (read != length) { throw new IllegalArgumentException("deserialize failed. expected read length: " + length + " but actual read: " + read); } else { return bytes; } }
please update the bytes format, 1.0.1 is the way to old.
meanwhile there is bug in the previous version if there is \n in json data, then all the serialization will failed
java.io.IOException: Unrecognized serialize type from consumer: 6
The reason for this error is that you did not configure the serialization method according to the documentation.
but they changed the way to read bytes post 1.0.1, now is already version 3.3.0.
I have verified this on Dubbo 3.x, and there are no issues with the serialization. Could you provide a more complete example?
meanwhile there is bug in the previous version if there is
\n
in json data, then all the serialization will failed
I don't think so. In Dubbo's JSON serialization, the \n
within strings will be escaped. Also, please use a compressed JSON format and avoid adding \n between fields.
@qiyuan4f
Current Behavior
using dubbo-samples-tengine project as test case Service: org.apache.dubbo.samples.tengine.DemoService Method: test(Integer a)
Plugin Config
Expected Behavior
Return right resposne
Error Logs
http-dubbo exits with http status code 500, client: 47.236.83.16, server: _, request: "POST /DemoService/test HTTP/2.0",
Steps to Reproduce
Environment
apisix version
): 3.10.0uname -a
): 5.14.0-427.37.1.el9_4.x86_64 #1 SMP PREEMPT_DYNAMIC Tue Sep 24 17:44:03 EDT 2024 x86_64 x86_64 x86_64 GNU/Linuxopenresty -V
ornginx -V
): 1.25.3curl http://127.0.0.1:9090/v1/server_info
): 1.5.16luarocks --version
): 3.8.0