milvus-io / milvus

A cloud-native vector database, storage for next generation AI applications
https://milvus.io
Apache License 2.0
31.02k stars 2.95k forks source link

[Bug]: illegal connection params or server unavailable #36663

Open magallardo opened 1 month ago

magallardo commented 1 month ago

Is there an existing issue for this?

Environment

- Milvus version: 2.4.x
- Deployment mode(standalone or cluster): Docker
- MQ type(rocksmq, pulsar or kafka):    
- SDK version(e.g. pymilvus v2.0.0rc2): langchain-milvus 0.1.5
- OS(Ubuntu or CentOS): Docker
- CPU/Memory: 
- GPU: 
- Others:

Current Behavior

When I try to connect, I get the following error

2024-10-07 12:06:00 vectorDB = Milvus( 2024-10-07 12:06:00 File "/usr/local/lib/python3.10/site-packages/langchain_milvus/vectorstores/milvus.py", line 326, in init 2024-10-07 12:06:00 self.alias = self._create_connection_alias(connection_args) 2024-10-07 12:06:00 File "/usr/local/lib/python3.10/site-packages/langchain_milvus/vectorstores/milvus.py", line 410, in _create_connection_alias 2024-10-07 12:06:00 raise e 2024-10-07 12:06:00 File "/usr/local/lib/python3.10/site-packages/langchain_milvus/vectorstores/milvus.py", line 405, in _create_connection_alias 2024-10-07 12:06:00 connections.connect(alias=alias, connection_args) 2024-10-07 12:06:00 File "/usr/local/lib/python3.10/site-packages/pymilvus/orm/connections.py", line 449, in connect 2024-10-07 12:06:00 connect_milvus(kwargs, user=user, password=password, token=token, db_name=db_name) 2024-10-07 12:06:00 File "/usr/local/lib/python3.10/site-packages/pymilvus/orm/connections.py", line 400, in connect_milvus 2024-10-07 12:06:00 gh._wait_for_channel_ready(timeout=timeout) 2024-10-07 12:06:00 File "/usr/local/lib/python3.10/site-packages/pymilvus/client/grpc_handler.py", line 150, in _wait_for_channel_ready 2024-10-07 12:06:00 raise MilvusException( 2024-10-07 12:06:00 pymilvus.exceptions.MilvusException: <MilvusException: (code=2, message=Fail connecting to server on 76.208.102.187:19530, illegal connection params or server unavailable)>

Expected Behavior

Successful connection

Steps To Reproduce

vector_store_loaded = Milvus(
    embeddings,
    connection_args={"uri": URI},
    collection_name="langchain_example",
)

Milvus Log

milvus.log

Anything else?

No response

yanliang567 commented 1 month ago

did not find any unexpected info in the logs. @congqixia could you please help to double check it?

/assign @congqixia /unassign

congqixia commented 1 month ago

From the information provided, are you trying to connect milvus with langchain-milvus? Did you try using vanilla milvus pymilvus sdk?

zc277584121 commented 1 month ago

hi, @magallardo Is your pymilvus version == v2.0.0rc2 ? maybe it is a little bit old for langchain_milvus. and after you upgrade your pymilvus version, can you try this code snippet

from pymilvus import MilvusClient
URI = "http://76.208.102.187:19530" # your uri
milvus_client = MilvusClient(uri=URI)

then try your langchain milvus code

vector_store_loaded = Milvus(
    embeddings,
    connection_args={"uri": URI},
    collection_name="langchain_example",
)
stale[bot] commented 2 weeks ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. Rotten issues close after 30d of inactivity. Reopen the issue with /reopen.