milvus-io / pymilvus

Python SDK for Milvus.
Apache License 2.0
957 stars 305 forks source link

[Bug]: Milvus 2.3.5 not compatible with pymilvus 2.3.5? #1901

Closed drawnwren closed 6 months ago

drawnwren commented 6 months ago

Is there an existing issue for this?

Describe the bug

I'm running milvus standalone 2.3.5 and pymilvus 2.3.5. These are the recommended versions according to release notes. However, when I use connections.connect(), I get the error:

E               pymilvus.exceptions.MilvusException: <MilvusException: (code=1, message=this version of sdk is incompatible with server, please downgrade your sdk or upgrade your server)>

Expected Behavior

I expect connections.connect() to connect.

Steps/Code To Reproduce behavior

No response

Environment details

- Hardware/Softward conditions (OS, CPU, GPU, Memory): Archlinux
- Method of installation (Docker, or from source): docker standalone
- Milvus version (v0.3.1, or v0.4.0): v2.3.5

Anything else?

Full backtrace

    @pytest.fixture(scope="module")
    def milvus_client() -> Generator[MilvusClient, None, None]:
        global client
        settings = get_settings()
        # Initialize a Milvus client
        if client is not None:
            yield client
        client = MilvusClient(settings.milvus_host, settings.milvus_port)
>       client.connect()

tests/conftest.py:18:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
rag/retriever.py:51: in connect
    connections.connect("default", host=self.host, port=self.port)
/home/wing/.conda/envs/xoul_API/lib/python3.11/site-packages/pymilvus/orm/connections.py:354: in connect
    connect_milvus(**kwargs, user=user, password=password, token=token, db_name=db_name)
/home/wing/.conda/envs/xoul_API/lib/python3.11/site-packages/pymilvus/orm/connections.py:302: in connect_milvus
    gh._wait_for_channel_ready(timeout=timeout)
/home/wing/.conda/envs/xoul_API/lib/python3.11/site-packages/pymilvus/client/grpc_handler.py:139: in _wait_for_channel_ready
    raise e from e
/home/wing/.conda/envs/xoul_API/lib/python3.11/site-packages/pymilvus/client/grpc_handler.py:132: in _wait_for_channel_ready
    self._setup_identifier_interceptor(self._user)
/home/wing/.conda/envs/xoul_API/lib/python3.11/site-packages/pymilvus/client/grpc_handler.py:249: in _setup_identifier_interceptor
    self._identifier = self.__internal_register(user, host)
/home/wing/.conda/envs/xoul_API/lib/python3.11/site-packages/pymilvus/decorators.py:127: in handler
    raise e from e
/home/wing/.conda/envs/xoul_API/lib/python3.11/site-packages/pymilvus/decorators.py:123: in handler
    return func(*args, **kwargs)
/home/wing/.conda/envs/xoul_API/lib/python3.11/site-packages/pymilvus/decorators.py:162: in handler
    return func(self, *args, **kwargs)
/home/wing/.conda/envs/xoul_API/lib/python3.11/site-packages/pymilvus/decorators.py:102: in handler
    raise e from e
/home/wing/.conda/envs/xoul_API/lib/python3.11/site-packages/pymilvus/decorators.py:68: in handler
    return func(*args, **kwargs)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

args = (<pymilvus.client.grpc_handler.GrpcHandler object at 0x7493d107f790>, '', 'anubis'), kwargs = {}
msg = 'this version of sdk is incompatible with server, please downgrade your sdk or upgrade your server'

    @functools.wraps(func)
    def handler(*args, **kwargs):
        try:
            return func(*args, **kwargs)
        except grpc.RpcError as e:
            if e.code() == grpc.StatusCode.UNIMPLEMENTED:
                msg = (
                    "this version of sdk is incompatible with server, "
                    "please downgrade your sdk or upgrade your server"
                )
>               raise MilvusException(message=msg) from e
E               pymilvus.exceptions.MilvusException: <MilvusException: (code=1, message=this version of sdk is incompatible with server, please downgrade your sdk or upgrade your server)>
drawnwren commented 6 months ago

Turns out it's that you don't use connect at all anymore. Should just instantiate the Milvus object in 2.3.4+