[Bug]: use standalone v2.2.3 and java 2.2.3 sdk, function milvusClient.hasCollection cause error
Is there an existing issue for this?
- [X] I have searched the existing issues
Environment
- Milvus version:2.2.3
- Deployment mode(standalone or cluster): standalone
- MQ type(rocksmq, pulsar or kafka): 默认
- SDK version(e.g. pymilvus v2.0.0rc2): java 2.2.3
- OS(Ubuntu or CentOS): CentOS
- CPU/Memory:
- GPU:
- Others:
Current Behavior
1.通过docker-compose方式部署了2.2.3版 standalone 的milvus; 2.使用java sdk 2.2.3版本,pom依赖如下: groupId:io.milvus</groupId> artifactId:milvus-sdk-java version:2.2.3 3.调用判断collection是否存在的方法: R<Boolean> respHasCollection = milvusClient.hasCollection(HasCollectionParam.newBuilder().withCollectionName(collectionName).build());
Expected Behavior
应该正常返回结果
Steps To Reproduce
调用R<Boolean> respHasCollection = milvusClient.hasCollection(HasCollectionParam.newBuilder().withCollectionName(collectionName).build());
报异常
Milvus Log
io.milvus.client.AbstractMilvusGrpcClient |2428 ||||HasCollectionParam{collectionName='image_feature_info'} io.grpc.stub.ClientCalls$ThreadlessExecutor |742 ||||Runnable threw exception java.lang.NoSuchMethodError: com.google.protobuf.GeneratedMessageV3.isStringEmpty(Ljava/lang/Object;)Z at io.milvus.grpc.HasCollectionRequest.getSerializedSize(HasCollectionRequest.java:237) at io.grpc.protobuf.lite.ProtoInputStream.available(ProtoInputStream.java:108) at io.grpc.internal.MessageFramer.getKnownLength(MessageFramer.java:205) at io.grpc.internal.MessageFramer.writePayload(MessageFramer.java:137) at io.grpc.internal.AbstractStream.writeMessage(AbstractStream.java:65) at io.grpc.internal.ForwardingClientStream.writeMessage(ForwardingClientStream.java:37) at io.grpc.internal.DelayedStream$6.run(DelayedStream.java:257) at io.grpc.internal.DelayedStream.drainPendingCalls(DelayedStream.java:163) at io.grpc.internal.DelayedStream.setStream(DelayedStream.java:132) at io.grpc.internal.DelayedClientTransport$PendingStream.createRealStream(DelayedClientTransport.java:358) at io.grpc.internal.DelayedClientTransport$PendingStream.access$300(DelayedClientTransport.java:341) at io.grpc.internal.DelayedClientTransport$5.run(DelayedClientTransport.java:300) at io.grpc.stub.ClientCalls$ThreadlessExecutor.waitAndDrain(ClientCalls.java:740) at io.grpc.stub.ClientCalls.blockingUnaryCall(ClientCalls.java:149) at io.milvus.grpc.MilvusServiceGrpc$MilvusServiceBlockingStub.hasCollection(MilvusServiceGrpc.java:3658) at io.milvus.client.AbstractMilvusGrpcClient.hasCollection(AbstractMilvusGrpcClient.java:320) at com.client.MilvusDataBaseClient.createCollection(MilvusDataBaseClient.java:134) at com.client.MilvusDataBaseClient.init(MilvusDataBaseClient.java:507) ………………………………
Anything else?
经过测试,2.2.2版本的java sdk,可以正常操作2.2.3的milvus
/assign @yhmo /unassign
"java.lang.NoSuchMethodError: com.google.protobuf.GeneratedMessageV3.isStringEmpty" is caused by a redundant proto file "proto/google/protobuf/descriptor.proto" in previous version of milvus-proto repo. The milvus repo uses milvus-proto as to generate server side rpc classes. We removed the "proto/google/protobuf/descriptor.proto" by [this commit](https://github.com/milvus-io/milvus-proto/commit/d8cfcb4d86bd0720258351b4b4641778e30cb62e). But looks like the milvus v2.2.3 still use an old version of milvus-proto to generate rpc classes.
@bjgyl 我用standalone v2.2.3 and java 2.2.3 sdk试了一下,并没有出现你说的问题。
今天刚试用,碰到同样的问题,也是 2.2.3 版本
Caused by: java.lang.NoSuchMethodError: 'boolean com.google.protobuf.GeneratedMessageV3.isStringEmpty(java.lang.Object)' at io.milvus.grpc.CollectionSchema.getSerializedSize(CollectionSchema.java:220) at com.google.protobuf.AbstractMessageLite.toByteString(AbstractMessageLite.java:58) at io.milvus.client.AbstractMilvusGrpcClient.createCollection(AbstractMilvusGrpcClient.java:378)
@yhmo could you help on check it~
今天刚试用,碰到同样的问题,也是 2.2.3 版本
Caused by: java.lang.NoSuchMethodError: 'boolean com.google.protobuf.GeneratedMessageV3.isStringEmpty(java.lang.Object)' at io.milvus.grpc.CollectionSchema.getSerializedSize(CollectionSchema.java:220) at com.google.protobuf.AbstractMessageLite.toByteString(AbstractMessageLite.java:58) at io.milvus.client.AbstractMilvusGrpcClient.createCollection(AbstractMilvusGrpcClient.java:378)
Milvus 和 Java SDK都是 2.2.3版本?
@rokaye @yhmo
Solution to fix your problem Caused by: java.lang.NoSuchMethodError: 'boolean com.google.protobuf.GeneratedMessageV3.isStringEmpty(java.lang.Object)' at io.milvus.grpc.CollectionSchema.getSerializedSize(CollectionSchema.java:220) at com.google.protobuf.AbstractMessageLite.toByteString(AbstractMessageLite.java:58) at io.milvus.client.AbstractMilvusGrpcClient.createCollection(AbstractMilvusGrpcClient.java:378)
1.exclude protobuf-java-util from milvus-sdk
compile ('io.milvus:milvus-sdk-java:2.2.3') {
exclude group: 'com.google.protobuf', module: 'protobuf-java-util'
}
2.use later version of protobuf-java package
compile ('com.google.protobuf:protobuf-java:3.19.1')
@batch-norm
Your solutions were effective.
Use protobuf-java:3.19.1+ can solve the problem by testing . Even do not need to exclude protobuf-java-util from milvus-sdk。
pom.xml:
<dependency>
<groupId>com.google.protobuf</groupId>
<artifactId>protobuf-java</artifactId>
<version>3.19.1</version>
</dependency>
Java sdk 2.2.4 has been released, I suppose this version can resolve this compatible problem. https://github.com/milvus-io/milvus-sdk-java/releases/tag/v2.2.4