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

Error occurred after version upgrade #706

Closed
yangshiron opened this issue Dec 6, 2023 · 10 comments
Closed

Error occurred after version upgrade #706

yangshiron opened this issue Dec 6, 2023 · 10 comments
Assignees

Comments

@yangshiron
Copy link

This error occurred when I upgraded Springboot version to 3.1.6,But using version 3.1.5 does not have this issue, while the Java SDK version is 2.2.11
2023-12-06 15:28:19.190 [XNIO-1 task-2] ERROR io.milvus.client.AbstractMilvusGrpcClient - HasPartitionRequest RPC failed!
io.grpc.StatusRuntimeException: UNKNOWN
at io.grpc.stub.ClientCalls.toStatusRuntimeException(ClientCalls.java:271)
at io.grpc.stub.ClientCalls.getUnchecked(ClientCalls.java:252)
at io.grpc.stub.ClientCalls.blockingUnaryCall(ClientCalls.java:165)
at io.milvus.grpc.MilvusServiceGrpc$MilvusServiceBlockingStub.hasPartition(MilvusServiceGrpc.java:4198)
at io.milvus.client.AbstractMilvusGrpcClient.hasPartition(AbstractMilvusGrpcClient.java:975)
at io.milvus.client.MilvusServiceClient.lambda$hasPartition$18(MilvusServiceClient.java:388)
at io.milvus.client.MilvusServiceClient.retry(MilvusServiceClient.java:259)
at io.milvus.client.MilvusServiceClient.hasPartition(MilvusServiceClient.java:388)
at com.zstech.milvusplus.util.MilvusUtil.hasPartition(MilvusUtil.java:189)
at com.zstech.milvusplus.util.MilvusUtil.getExistPartitionNames(MilvusUtil.java:415)
at com.zstech.milvusplus.util.MilvusUtil.search(MilvusUtil.java:508)

@xkaaaaaa
Copy link

xkaaaaaa commented Dec 7, 2023

我也遇到了,springboot 3.1.5 正常 3.1.6 和 3.2.0 就不正常了

@tzolov
Copy link

tzolov commented Dec 12, 2023

I can confirm it as well! Milvus Java client is unusable (for me) at the moment.
UPDATE: see my workaround below.

@xiaofan-luan
Copy link
Contributor

/assign @yhmo
could you help on this one?
I guess this is due to some dependency issue

@tzolov
Copy link

tzolov commented Dec 12, 2023

Looks like the problem comes with the io.netty:netty-codec-http2 dependency!
By default Spring Boot 3.2.0 uses latest version: 4.1.101.Final. Later cause the milvus client to crash with the above error.

My workaround was to downgrade io.netty:netty-codec-http2 to 4.1.100.Final, by adding it explicitly to my pom:

    <dependency>
	    <groupId>io.netty</groupId>
	    <artifactId>netty-codec-http2</artifactId>
	    <version>4.1.100.Final</version>
    </dependency>

Additionally to avoid some security vulnerabilities caused by theoutdated milvus (grpc/netty) dependecies you can try this:

<dependency>
	<groupId>io.milvus</groupId>
	<artifactId>milvus-sdk-java</artifactId>
	<version>2.3.3</version>
	<exclusions>
		<exclusion>
			<groupId>io.netty</groupId>
			<artifactId>netty-codec</artifactId>
		</exclusion>
		<exclusion>
			<groupId>io.netty</groupId>
			<artifactId>netty-codec-http2</artifactId>
		</exclusion>
	</exclusions>
</dependency>

<dependency>
	<groupId>io.netty</groupId>
	<artifactId>netty-codec</artifactId>
	<version>4.1.101.Final</version>
</dependency>
<dependency>
	<groupId>io.netty</groupId>
	<artifactId>netty-codec-http2</artifactId>
	<version>4.1.100.Final</version>
</dependency>

hope this helps.

@yhmo
Copy link
Contributor

yhmo commented Dec 13, 2023

To support TLS connection, java sdk introduces a dependency grpc-netty from v2.2.10: https://github.com/milvus-io/milvus-sdk-java/blob/master/src/main/java/io/milvus/client/MilvusServiceClient.java#L93

In the Java sdk pom.xml we can see:

        <dependency>
            <groupId>io.grpc</groupId>
            <artifactId>grpc-netty</artifactId>
            <version>${grpc.version}</version>
        </dependency>

The version of grpc-netty is consistent with the grpc lib version. Milvus is using grpc 1.46 to build sdk for client-side and api for server-side, so we can't change this version.

This error is caused by incompatible versions of user's pre-installed netty lib and the java sdk grpc-netty lib. So far I don't have a perfect solution to fix it. Thanks @tzolov for the workaround.

@yhmo
Copy link
Contributor

yhmo commented Dec 15, 2023

Link to grpc/grpc-java#10665
The grpc-java 1.59.1 contains the fix: https://github.com/grpc/grpc-java/releases/tag/v1.59.1

@yhmo
Copy link
Contributor

yhmo commented Dec 15, 2023

I have verified that upgrading the java sdk's grpc dependency from 1.46 to 1.59.1 can avoid these errors.
I need to do some testing. I will upgrade grpc version to 1.59.1 in the next sdk version if no compatible issues are found.

@yhmo
Copy link
Contributor

yhmo commented Dec 18, 2023

The #713 and #713 has upgraded the grpc to 1.59.1

@ysr1127
Copy link

ysr1127 commented Dec 25, 2023

When is the next SDK version expected to be released

@yhmo
Copy link
Contributor

yhmo commented Jan 4, 2024

When is the next SDK version expected to be released

2.3.4 already released

@yhmo yhmo closed this as completed Jan 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants