Qdrant Database Timeout

Hello,

I have a local setup as follows:

database = QdrantClient(host=settings().HOST, port=6333, api_key=settings().QDRANT_API)

where HOST and QDRANT are defined in a dotenv file where HOST points to a QDRANT cloud instance ‘.*.aws.cloud.qdrant.io’. This works great when initializing the db locally using fastAPI with:

uvicorn main:app --reload 

As soon as I try deploying on fly.io I get the following error:

Traceback (most recent call last):
2023-02-21T06:46:23Z   [info]  File "/usr/local/lib/python3.9/site-packages/starlette/routing.py", line 671, in lifespan
2023-02-21T06:46:23Z   [info]    async with self.lifespan_context(app):
2023-02-21T06:46:23Z   [info]  File "/usr/local/lib/python3.9/site-packages/starlette/routing.py", line 566, in __aenter__
2023-02-21T06:46:23Z   [info]    await self._router.startup()
2023-02-21T06:46:23Z   [info]  File "/usr/local/lib/python3.9/site-packages/starlette/routing.py", line 648, in startup
2023-02-21T06:46:23Z   [info]    await handler()
2023-02-21T06:46:23Z   [info]  File "/code/./app/main.py", line 119, in startup_event
2023-02-21T06:46:23Z   [info]    database.recreate_collection(
2023-02-21T06:46:23Z   [info]  File "/usr/local/lib/python3.9/site-packages/qdrant_client/qdrant_client.py", line 1609, in recreate_collection
2023-02-21T06:46:23Z   [info]    self.delete_collection(collection_name)
2023-02-21T06:46:23Z   [info]  File "/usr/local/lib/python3.9/site-packages/qdrant_client/qdrant_client.py", line 1543, in delete_collection
2023-02-21T06:46:23Z   [info]    result: Optional[bool] = self.http.collections_api.delete_collection(
2023-02-21T06:46:23Z   [info]  File "/usr/local/lib/python3.9/site-packages/qdrant_client/http/api/collections_api.py", line 788, in delete_collection
2023-02-21T06:46:23Z   [info]    return self._build_for_delete_collection(
2023-02-21T06:46:23Z   [info]  File "/usr/local/lib/python3.9/site-packages/qdrant_client/http/api/collections_api.py", line 268, in _build_for_delete_collection
2023-02-21T06:46:23Z   [info]    return self.api_client.request(
2023-02-21T06:46:23Z   [info]  File "/usr/local/lib/python3.9/site-packages/qdrant_client/http/api_client.py", line 68, in request
2023-02-21T06:46:23Z   [info]    return self.send(request, type_)
2023-02-21T06:46:23Z   [info]  File "/usr/local/lib/python3.9/site-packages/qdrant_client/http/api_client.py", line 85, in send
2023-02-21T06:46:23Z   [info]    response = self.middleware(request, self.send_inner)
2023-02-21T06:46:23Z   [info]  File "/usr/local/lib/python3.9/site-packages/qdrant_client/http/api_client.py", line 188, in __call__
2023-02-21T06:46:23Z   [info]    return call_next(request)
2023-02-21T06:46:23Z   [info]  File "/usr/local/lib/python3.9/site-packages/qdrant_client/http/api_client.py", line 97, in send_inner
2023-02-21T06:46:23Z   [info]    raise ResponseHandlingException(e)
2023-02-21T06:46:23Z   [info]qdrant_client.http.exceptions.ResponseHandlingException: timed out
2023-02-21T06:46:23Z   [info]ERROR:    Application startup failed. Exiting.
2023-02-21T06:46:24Z   [info]Starting clean up.

I’ve tried setting the port to 80 or 443 but the timeout persists. Any help would be greatly appreciated!

EDIT: Turns out Qdrant only listens on ports 6333 (REST) and 6334 (gRPC). Would it be possible to set port 6333?

Did you fix it?