langchain-ai / langchain

šŸ¦œšŸ”— Build context-aware reasoning applications
https://python.langchain.com
MIT License
93.57k stars 15.08k forks source link

Milvus - illegal connection params or server unavailable #27165

Open magallardo opened 1 week ago

magallardo commented 1 week ago

Checked other resources

Example Code

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

Error Message and Stack Trace (if applicable)

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)>

Description

I am using langchain-milvus 0.1.5 and when trying to connect is failing.

System Info

langchain==0.3.0 langchain-core==0.3.5 langchain-milvus==0.1.5

lubancafe commented 1 week ago

Ask for same issue.
langchain==0.3.3 langchain-core-0.3.10 langchain-community==0.3.2 pymilvus==2.4.6

Neither https://python.langchain.com/docs/integrations/vectorstores/zilliz/ nor https://docs.zilliz.com/docs/question-answering-over-documents-with-zilliz-cloud-and-langchain works. Most likely it is a langchain's Milvus /Zilliz wrapper issue.

Reporting: NotFoundError: Error code: 404 - {'error': {'code': 'DeploymentNotFound', 'message': 'The API deployment for this resource does not exist. If you created the deployment within the last 5 minutes, please wait a moment and try again.'}}

However, with same uri and token, following code works,

from pymilvus import MilvusClient

# Authentication enabled with a cluster user
client = MilvusClient(
    uri='my_zilliz_cloud_endpoint', # example: "https://in01-17f69c292d4a5sa.aws-us-west-2.vectordb.zillizcloud.com"
    token="user:pass", # replace this with my token
)

client.list_collections()