[Bug] configure the serialization mechanism for dubbo-python
- Dominant language
- Java
- Stars
- 41.6k
- Forks
- 26.4k
- Avg merge
- 15h 13m
- Merged PRs (30d)
- 4
Description
### Dubbo Version
java 21, dubbo 3.3.4
### Steps to reproduce this issue
on the java side:
```
dubbo:
application:
logger: slf4j
name: chat-service
qos-enable: false
check-serializable: true
auto-trust-serialize-class: true
trust-serialize-class-level: 3
registry:
address: nacos://192.168.124.3:8848?namespace=2b810d86-06c3-4e07-b09f-e85172994090
register-mode: instance
protocol:
name: tri
port: 20884
```
```
@Slf4j
@DubboService(timeout = 10000,protocol = {"tri"})
@Service
public class CalvToolProvider2 implements LLMCalvTool {
@Override
public List demoTest(Long groupID) {
List longs = List.of();
longs.add(1L);
longs.add(2L);
longs.add(3L);
return longs;
}
@Override
public String hello() {
return "'helooooooo'";
}
}
```
the meta data:
```
dubbo.metadata-service.url-params={"serialization":"hessian2","prefer.serialization":"hessian2","version":"2.0.0","dubbo":"2.0.2","release":"3.3.4","side":"provider","port":"20809","protocol":"tri"}
dubbo.endpoints=[{"port":20884,"protocol":"dubbo"},{"port":20809,"protocol":"tri"}]
dubbo.metadata.revision=33f645ebbe335cc4b8ef0f990d425d2a
dubbo.metadata.storage-type=local
meta-v=2.0.0
timestamp=1744721018804
```
and on the python side:
```
import dubbo
from dubbo.configs import ReferenceConfig
class UnaryServiceStub:
def __init__(self, client: dubbo.Client):
self.unary_hello = client.unary(method_name="hello")
self.unary_demoTest = client.unary(method_name="demoTest")
def get_hello(self):
return self.unary_hello()
def get_demoTest(self, groupID):
return self.unary_demoTest(groupID)
if __name__ == "__main__":
# 配置参考
reference_config = ReferenceConfig.from_url(
"tri://192.168.124.3:20809/com.demo.interfaces.LLMCalvTool?serialization=hessian2",
)
# 创建 Dubbo 客户端
dubbo_client = dubbo.Client(reference_config)
# 创建服务代理
unary_service_stub = UnaryServiceStub(dubbo_client)
# 调用 hello 方法
result_hello = unary_service_stub.get_hello()
print(result_hello)
# 调用 demoTest 方法
num = 93989834 # 长整型
result_demoTest = unary_service_stub.get_demoTest(num)
print(result_demoTest)
```
### What you expected to happen
i want to know what's going on? can provide more simple demos? it's very hard to use. there are so many mirror bug of the document...
org.apache.dubbo.remoting.http12.exception.DecodeException: Internal Server Error
at org.apache.dubbo.rpc.protocol.tri.h12.grpc.GrpcCompositeCodec.decode(GrpcCompositeCodec.java:102)
at org.apache.dubbo.rpc.protocol.tri.h12.grpc.GrpcCompositeCodec.decode(GrpcCompositeCodec.java:108)
at org.apache.dubbo.remoting.http12.message.HttpMessageDecoder.decode(HttpMessageDecoder.java:56)
at org.apache.dubbo.remoting.http12.message.DefaultListeningDecoder.decode(DefaultListeningDecoder.java:41)
at org.apache.dubbo.remoting.http12.message.StreamingDecoder$DefaultFragmentListener.onFragmentMessage(StreamingDecoder.java:55)
at org.apache.dubbo.remoting.http12.message.LengthFieldStreamingDecoder.invokeListener(LengthFieldStreamingDecoder.java:180)
at org.apache.dubbo.rpc.protocol.tri.h12.grpc.GrpcHttp2ServerTransportListener$DetermineMethodDescriptorListener.onFragmentMessage(GrpcHttp2ServerTransportListener.java:202)
at org.apache.dubbo.remoting.http12.message.LengthFieldStreamingDecoder.invokeListener(LengthFieldStreamingDecoder.java:180)
at org.apache.dubbo.remoting.http12.message.LengthFieldStreamingDecoder.processBody(LengthFieldStreamingDecoder.java:172)
at org.apache.dubbo.remoting.http12.message.LengthFieldStreamingDecoder.deliver(LengthFieldStreamingDecoder.java:121)
at org.apache.dubbo.remoting.http12.message.LengthFieldStreamingDecoder.decode(LengthFieldStreamingDecoder.java:69)
at org.apache.dubbo.rpc.protocol.tri.h12.grpc.GrpcHttp2ServerTransportListener$LazyFindMethodListener.onMessage(GrpcHttp2ServerTransportListener.java:180)
at org.apache.dubbo.rpc.protocol.tri.h12.AbstractServerTransportListener.doOnData(AbstractServerTransportListener.java:183)
at org.apache.dubbo.rpc.protocol.tri.h12.AbstractServerTransportListener.lambda$onData$1(AbstractServerTransportListener.java:168)
at org.apache.dubbo.common.threadpool.serial.SerializingExecutor.run(SerializingExecutor.java:111)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1144)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:642)
at org.apache.dubbo.common.threadlocal.InternalRunnable.run(InternalRunnable.java:39)
at java.base/java.lang.Thread.run(Thread.java:1583)
Caused by: java.io.IOException: Unexpected serialization type:null received from network, please check if the peer send the right id.
at org.apache.dubbo.remoting.transport.CodecSupport.checkSerialization(CodecSupport.java:185)
at org.apache.dubbo.rpc.protocol.tri.ReflectionPackableMethod$WrapRequestUnpack.unpack(ReflectionPackableMethod.java:457)
at org.apache.dubbo.rpc.model.WrapperUnPack.unpack(WrapperUnPack.java:22)
at org.apache.dubbo.rpc.model.PackableMethod.parseRequest(PackableMethod.java:26)
at org.apache.dubbo.rpc.protocol.tri.h12.grpc.GrpcCompositeCodec.decode(GrpcCompositeCodec.java:98)
... 18 common frames omitted
--
class: org.apache.dubbo.remoting.http12.exception.DecodeException
at org.apache.dubbo.common.serialize.DefaultSerializationExceptionWrapper.handleToIOException(DefaultSerializationExceptionWrapper.java:353)
at org.apache.dubbo.common.serialize.DefaultSerializationExceptionWrapper.access$000(DefaultSerializationExceptionWrapper.java:27)
at org.apache.dubbo.common.serialize.DefaultSerializationExceptionWrapper$ProxyObjectOutput.writeObject(DefaultSerializationExceptionWrapper.java:319)
at org.apache.dubbo.common.serialize.DefaultMultipleSerialization.serialize(DefaultMultipleSerialization.java:34)
at org.apache.dubbo.rpc.protocol.tri.ReflectionPackableMethod$WrapResponsePack.pack(ReflectionPackableMethod.java:320)
at org.apache.dubbo.rpc.model.PackableMethod.packResponse(PackableMethod.java:46)
at org.apache.dubbo.rpc.protocol.tri.h12.grpc.GrpcCompositeCodec.encode(GrpcCompositeCodec.java:84)
... 16 common frames omitted
Caused by: org.apache.dubbo.common.serialize.SerializationException: java.lang.RuntimeException: [Serialization Security] Serialized class java.io.IOException is not in allow list. Current mode is `STRICT`, will disallow to deserialize it by default. Please add it into security/serialize.allowlist or follow FAQ to configure it.
field: java.lang.Throwable.cause
class: org.apache.dubbo.remoting.http12.exception.DecodeException
... 23 common frames omitted
Caused by: java.lang.RuntimeException: [Serialization Security] Serialized class java.io.IOException is not in allow list. Current mode is `STRICT`, will disallow to deserialize it by default. Please add it into security/serialize.allowlist or follow FAQ to configure it.
field: java.lang.Throwable.cause
Contributor guide
Assessment
This issue has not been assessed yet.