# Runtime error: MilvusException: (code=2, message=Fail connecting to server on 127.0.0.1:19530. Timeout

**URL:** <https://discuss.huggingface.co/t/runtime-error-milvusexception-code-2-message-fail-connecting-to-server-on-127-0-0-1-19530-timeout/45338>\
**Category:** Beginners\
**Created:** [July 2, 2023, 5:14am UTC](https://discuss.huggingface.co/t/runtime-error-milvusexception-code-2-message-fail-connecting-to-server-on-127-0-0-1-19530-timeout/45338 "2023-07-02T05:14:43Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![chandrakalagowda](https://avatars.discourse-cdn.com/v4/letter/c/ba8739/32.png) [@chandrakalagowda](https://discuss.huggingface.co/u/chandrakalagowda)\
**Post date:** [July 2, 2023, 5:14am UTC](https://discuss.huggingface.co/t/runtime-error-milvusexception-code-2-message-fail-connecting-to-server-on-127-0-0-1-19530-timeout/45338/1 "2023-07-02T05:14:43Z")

</div>

I am trying to host a gradio app. → refer here

> **[milvuspython - a Hugging Face Space by chandrakalagowda](https://huggingface.co/spaces/chandrakalagowda/milvuspython)**
>
> Discover amazing ML apps made by the community

_Please note the app requires also a docker compose.yml etc… which are all uploaded within the files on huggingface space._

I get the following error.  
The app runs well locally on my computer. I am not sure how to debug this error. Please help.

Runtime error  
Traceback (most recent call last):  
File “/home/user/.local/lib/python3.10/site-packages/pymilvus/client/grpc\_handler.py”, line 114, in \_wait\_for\_channel\_ready  
grpc.channel\_ready\_future(self.\_channel).result(timeout=timeout)  
File “/home/user/.local/lib/python3.10/site-packages/grpc/\_utilities.py”, line 151, in result  
self.\_block(timeout)  
File “/home/user/.local/lib/python3.10/site-packages/grpc/\_utilities.py”, line 97, in \_block  
raise grpc.FutureTimeoutError()  
grpc.FutureTimeoutError

The above exception was the direct cause of the following exception:

Traceback (most recent call last):  
File “/home/user/app/img2txt.py”, line 40, in   
collection = create\_milvus\_collection(‘text\_image\_search’, 512)  
File “/home/user/app/img2txt.py”, line 19, in create\_milvus\_collection  
connections.connect(host=‘127.0.0.1’, port=‘19530’)  
File “/home/user/.local/lib/python3.10/site-packages/pymilvus/orm/connections.py”, line 303, in connect  
connect\_milvus(\*\*kwargs, user=user, password=password)  
File “/home/user/.local/lib/python3.10/site-packages/pymilvus/orm/connections.py”, line 274, in connect\_milvus  
gh.\_wait\_for\_channel\_ready(timeout=timeout)  
File “/home/user/.local/lib/python3.10/site-packages/pymilvus/client/grpc\_handler.py”, line 117, in \_wait\_for\_channel\_ready  
raise MilvusException(Status.CONNECT\_FAILED,  
pymilvus.exceptions.MilvusException: \<MilvusException: (code=2, message=Fail connecting to server on 127.0.0.1:19530. Timeout)\>

---

<div class="post-metadata">

**Author:** ![chandrakalagowda](https://avatars.discourse-cdn.com/v4/letter/c/ba8739/32.png) [@chandrakalagowda](https://discuss.huggingface.co/u/chandrakalagowda)\
**Post date:** [July 2, 2023, 5:23am UTC](https://discuss.huggingface.co/t/runtime-error-milvusexception-code-2-message-fail-connecting-to-server-on-127-0-0-1-19530-timeout/45338/2 "2023-07-02T05:23:43Z")

</div>

@radames Please let me know where I have to run docker compose if this error is related to docker

---

<div class="post-metadata">

**Author:** ![radames](https://sea2.discourse-cdn.com/hellohellohello/user_avatar/discuss.huggingface.co/radames/32/28246_2.png) [@radames](https://discuss.huggingface.co/u/radames)\
**Post date:** [July 4, 2023, 4:24am UTC](https://discuss.huggingface.co/t/runtime-error-milvusexception-code-2-message-fail-connecting-to-server-on-127-0-0-1-19530-timeout/45338/3 "2023-07-04T04:24:21Z")

</div>

hi @chandrakalagowda,

We currently don’t support docker compose on Spaces, so if you’re planning to run your Space app with another extra service you’ll need an extra step with a bash script to run your multiple services on the same container.

Please read more about Spaces Docker here

> **[Docker Spaces](https://huggingface.co/docs/hub/spaces-sdks-docker)**
>
> We’re on a journey to advance and democratize artificial intelligence through open source and open science.

I also notice on your `README.md` the sdk set to `gradio` not Dockerfile, so I’m not sure if you’re trying to run a Gradio app

> **[README.md · chandrakalagowda/milvuspython at main](https://huggingface.co/spaces/chandrakalagowda/milvuspython/blob/main/README.md?code=true#L4)**
>
> We’re on a journey to advance and democratize artificial intelligence through open source and open science.

For a multi-service Dockerfile example here is a complete Space

> **[radames/nginx-gradio-reverse-proxy at main](https://huggingface.co/spaces/radames/nginx-gradio-reverse-proxy/tree/main)**
>
> We’re on a journey to advance and democratize artificial intelligence through open source and open science.

---

<div class="post-metadata">

**Author:** ![chandrakalagowda](https://avatars.discourse-cdn.com/v4/letter/c/ba8739/32.png) [@chandrakalagowda](https://discuss.huggingface.co/u/chandrakalagowda)\
**Post date:** [July 4, 2023, 5:38am UTC](https://discuss.huggingface.co/t/runtime-error-milvusexception-code-2-message-fail-connecting-to-server-on-127-0-0-1-19530-timeout/45338/4 "2023-07-04T05:38:21Z")

</div>

Hello @radames,

Thank you so much for the pointers. My code img2txt.py,  
uses gradio for deploying the app. The code also uses milvus vector database to do a “text to image” search. Locally on my computer, this was achieved using a standalone installation using docker-compose.yml. (see here [https://milvus.io/docs/install\_standalone-docker.md](https://milvus.io/docs/install_standalone-docker.md)). Any pointers to how to enable my code to access milvus vector database without docker-compose.yml on huggingspace will be helpful. Do you have examples where a gradio app uses milvus vector database in the code. I will look for the same meanwhile.

Thank you for your time.

---

<div class="post-metadata">

**Author:** ![radames](https://sea2.discourse-cdn.com/hellohellohello/user_avatar/discuss.huggingface.co/radames/32/28246_2.png) [@radames](https://discuss.huggingface.co/u/radames)\
**Post date:** [July 4, 2023, 6:10am UTC](https://discuss.huggingface.co/t/runtime-error-milvusexception-code-2-message-fail-connecting-to-server-on-127-0-0-1-19530-timeout/45338/5 "2023-07-04T06:10:25Z")

</div>

hi @chandrakalagowda ,

Yes I understand now, maybe you can try the Lite version for now?

> **[Get Started with Milvus Lite](https://milvus.io/docs/milvus_lite.md)**
>
> Learn how to install, configure, and use Milvus Lite v2.2.x.

---

<div class="post-metadata">

**Author:** ![chandrakalagowda](https://avatars.discourse-cdn.com/v4/letter/c/ba8739/32.png) [@chandrakalagowda](https://discuss.huggingface.co/u/chandrakalagowda)\
**Post date:** [July 4, 2023, 8:18am UTC](https://discuss.huggingface.co/t/runtime-error-milvusexception-code-2-message-fail-connecting-to-server-on-127-0-0-1-19530-timeout/45338/6 "2023-07-04T08:18:19Z")

</div>

Yes. Thats good for a start.

Thank you

---

<div class="post-metadata">

**Author:** ![ytang07](https://sea2.discourse-cdn.com/hellohellohello/user_avatar/discuss.huggingface.co/ytang07/32/19669_2.png) [@ytang07](https://discuss.huggingface.co/u/ytang07)\
**Post date:** [September 20, 2023, 3:48pm UTC](https://discuss.huggingface.co/t/runtime-error-milvusexception-code-2-message-fail-connecting-to-server-on-127-0-0-1-19530-timeout/45338/7 "2023-09-20T15:48:35Z")

</div>

I just want to check to see if using Milvus Lite works for you?
