1

I have created a GCP cloud function (gen 1) in python, which connects to a Milvus deployment deployed on the same GCP project where the cloud function is created.

When connecting to the Milvus deployment from my local PC through telepresence I have no issues, but there seems to be a connection error when the cloud function is triggered and runs the same code.

connections.connect(alias="default", host='10.127.255.140', port='19530')

Specifically, when the above line is executed, it should connect to the Milvus server at the internal IP above. But the following timeout error occurs.

pymilvus.exceptions.MilvusException: <MilvusException: (code=2, message=Fail connecting to server on 10.127.255.140:19530. Timeout)

Has anyone had similar problems with Milvus and GCP cloud functions? I would much appreciate it if someone could help me out. Thank you!

P.S. Also it is the first time uploading a question here, so please let me know if you need more info about my situation. Thanks again!

Dez
  • 11
  • 1
  • Have you checked External IP of Milvus for cloud function? – Roopa M Sep 13 '22 at 11:14
  • I checked the loadbalancer IP for the Milvus deployment, but that doesn't seem to connect to Milvus at all :( – Dez Sep 14 '22 at 04:52
  • + The loadbalancer IP failed when attempting to connect from my local PC, but worked on the cloud functions. Thank you very much for your help. – Dez Sep 14 '22 at 05:02
  • Can you confirm how your issue resolved? Is it by changing `loadbalancer` IP? – Roopa M Sep 14 '22 at 05:06
  • Yes, by changing the host IP from `internal IP (ClusterIP)` to `external IP(loadbalancer)`, I successfully connected to the Milvus deployment from a GCP cloud function. But I'm not sure why connecting through the external IP from my local PC does not work. – Dez Sep 14 '22 at 05:11
  • This issue might be resolved by using Pymilvus 0.2.10 with Milvus 0.10.2. if you still face any problem do let us know. – Veera Nagireddy Oct 09 '22 at 09:32

1 Answers1

0

I met the same problem.

I tried to connect with:

connections.connect(alias='default', uri=MILVUS_HOST + ':' + MILVUS_PORT,
                    user=USER, password=PASSWORD, secure=True)
  • MILVUS_HOST should be https://url
einverne
  • 6,454
  • 6
  • 45
  • 91