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

[Bug]: Milvus-java-sdk not working after packaging, gRPC-related error #37773

Open
1 task done
xiaojunxiang2023 opened this issue Nov 18, 2024 · 2 comments
Open
1 task done
Assignees
Labels
kind/bug Issues or changes related a bug triage/accepted Indicates an issue or PR is ready to be actively worked on.

Comments

@xiaojunxiang2023
Copy link

xiaojunxiang2023 commented Nov 18, 2024

Is there an existing issue for this?

  • I have searched the existing issues

Environment

Milvus Server: 2.4.11
Milvus-java-sdk: 2.4.1

Current Behavior

Here is a simple demo of the Milvus Java client that can run normally in IntelliJ IDEA:
image

However, after packaging it into a JAR file and running it, an error occurs:
image
image

Expected Behavior

Steps To Reproduce

pom.xml:
    <dependencies>
        <dependency>
            <groupId>io.milvus</groupId>
            <artifactId>milvus-sdk-java</artifactId>
            <version>2.4.1</version>
        </dependency>
    </dependencies>
    
    <build>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-assembly-plugin</artifactId>
                <version>3.5.0</version>
                <executions>
                    <execution>
                        <phase>package</phase>
                        <goals>
                            <goal>single</goal>
                        </goals>
                        <configuration>
                            <descriptorRefs>
                                <descriptorRef>jar-with-dependencies</descriptorRef>
                            </descriptorRefs>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>

Main.java:
  public static void main(String[] args) {
    String dbName = "default";
    String collectionName = "a";
    System.out.println("collectionName: " + collectionName);
    String proxyUri = "http://10.148.40.27:19530";
    // 创建 Client
    MilvusClientV2 client = new MilvusClientV2(ConnectConfig.builder().uri(proxyUri).dbName(dbName).build());
    DescribeCollectionReq describeCollectionReq = DescribeCollectionReq.builder()
        .collectionName(collectionName)
        .build();
    DescribeCollectionResp describeCollectionResp = client.describeCollection(describeCollectionReq);
    System.out.println(describeCollectionResp + "\n\n");
  }

Milvus Log

Exception in thread "main" io.grpc.StatusRuntimeException: UNKNOWN at io.grpc.stub.ClientCalls.toStatusRuntimeException(ClientCalls.java:268) at io.grpc.stub.ClientCalls.getUnchecked(ClientCalls.java:249) at io.grpc.stub.ClientCalls.blockingUnaryCall(ClientCalls.java:167) at io.milvus.grpc.MilvusServiceGrpc$MilvusServiceBlockingStub.listDatabases(MilvusServiceGrpc.java:4621) at io.milvus.v2.utils.ClientUtils.checkDatabaseExist(ClientUtils.java:107) at io.milvus.v2.client.MilvusClientV2.connect(MilvusClientV2.java:89) at io.milvus.v2.client.MilvusClientV2.<init>(MilvusClientV2.java:60) at org.example.Main.main(Main.java:20) Caused by: java.nio.channels.UnsupportedAddressTypeException at sun.nio.ch.Net.checkAddress(Net.java:97) at sun.nio.ch.SocketChannelImpl.connect(SocketChannelImpl.java:620) at io.grpc.netty.shaded.io.netty.util.internal.SocketUtils$3.run(SocketUtils.java:91) at io.grpc.netty.shaded.io.netty.util.internal.SocketUtils$3.run(SocketUtils.java:88) at java.security.AccessController.doPrivileged(Native Method) at io.grpc.netty.shaded.io.netty.util.internal.SocketUtils.connect(SocketUtils.java:88) at io.grpc.netty.shaded.io.netty.channel.socket.nio.NioSocketChannel.doConnect(NioSocketChannel.java:322) at io.grpc.netty.shaded.io.netty.channel.nio.AbstractNioChannel$AbstractNioUnsafe.connect(AbstractNioChannel.java:248) at io.grpc.netty.shaded.io.netty.channel.DefaultChannelPipeline$HeadContext.connect(DefaultChannelPipeline.java:1342) at io.grpc.netty.shaded.io.netty.channel.AbstractChannelHandlerContext.invokeConnect(AbstractChannelHandlerContext.java:653) at io.grpc.netty.shaded.io.netty.channel.AbstractChannelHandlerContext.connect(AbstractChannelHandlerContext.java:632) at io.grpc.netty.shaded.io.netty.channel.ChannelDuplexHandler.connect(ChannelDuplexHandler.java:54) at io.grpc.netty.shaded.io.grpc.netty.WriteBufferingAndExceptionHandler.connect(WriteBufferingAndExceptionHandler.java:157) at io.grpc.netty.shaded.io.netty.channel.AbstractChannelHandlerContext.invokeConnect(AbstractChannelHandlerContext.java:655) at io.grpc.netty.shaded.io.netty.channel.AbstractChannelHandlerContext.access$1000(AbstractChannelHandlerContext.java:61) at io.grpc.netty.shaded.io.netty.channel.AbstractChannelHandlerContext$9.run(AbstractChannelHandlerContext.java:637) at io.grpc.netty.shaded.io.netty.util.concurrent.AbstractEventExecutor.runTask(AbstractEventExecutor.java:174) at io.grpc.netty.shaded.io.netty.util.concurrent.AbstractEventExecutor.safeExecute(AbstractEventExecutor.java:167) at io.grpc.netty.shaded.io.netty.util.concurrent.SingleThreadEventExecutor.runAllTasks(SingleThreadEventExecutor.java:470) at io.grpc.netty.shaded.io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:569) at io.grpc.netty.shaded.io.netty.util.concurrent.SingleThreadEventExecutor$4.run(SingleThreadEventExecutor.java:997) at io.grpc.netty.shaded.io.netty.util.internal.ThreadExecutorMap$2.run(ThreadExecutorMap.java:74) at io.grpc.netty.shaded.io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30) at java.lang.Thread.run(Thread.java:750)

Anything else?

No response

@xiaojunxiang2023 xiaojunxiang2023 added kind/bug Issues or changes related a bug needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. labels Nov 18, 2024
Copy link
Contributor

The title and description of this issue contains Chinese. Please use English to describe your issue.

@xiaojunxiang2023 xiaojunxiang2023 changed the title [Bug]: Milvus-java-sdk 打包后不可用, gRpc相关报错 [Bug]: Milvus-java-sdk not working after packaging, gRPC-related error Nov 18, 2024
@yanliang567
Copy link
Contributor

/assign @yhmo
/unassign

@sre-ci-robot sre-ci-robot assigned yhmo and unassigned yanliang567 Nov 18, 2024
@yanliang567 yanliang567 added triage/accepted Indicates an issue or PR is ready to be actively worked on. and removed needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. labels Nov 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Issues or changes related a bug triage/accepted Indicates an issue or PR is ready to be actively worked on.
Projects
None yet
Development

No branches or pull requests

3 participants