qdrant-client: Requests Timed out

Hi there, using the client like this

from qdrant_client import QdrantClient

url = "https://<QDRANT_SERVER>"
client = QdrantClient(
    url=url,
    timeout=10,
)

client.<do_stuff>

results in timeout in every requests, if I use my local one running I don’t have any issue.

If I use curl I don’t have timeouts, I was wondering if you have any idea why calling the APIs with the sdks doesn’t work but with curl yes. Maybe some options for https in the client?

Thanks you so much.

I cannot share the server URL because is deployed on Azure in our private network, but it is just qdrant in docker

Checking inside the container, there is not log for the requests, while if I use curl I can see that it hits the container

About this issue

  • Original URL
  • State: closed
  • Created 7 months ago
  • Comments: 25 (10 by maintainers)

Most upvoted comments

Fixed nothing.

This is still alive and causing troubles.

Running a collection indexing and saving vectors with llamaindex and getting this stuff. Fix it.

2024-03-03 22:26:23 +0000 24957 execution WARNING [Node_002_qdrant_txt_read in line 0 (index starts from 0)] stderrGenerating embeddings: 45%|####5 | 10/22 [00:02<00:03, 3.62it/s] 2024-03-03 22:26:23 +0000 24957 execution ERROR Node test in line 0 failed. Exception: Execution failure in ‘test’: (ResponseHandlingException) timed out. Traceback (most recent call last): File “/home/vscode/.local/lib/python3.11/site-packages/httpx/_transports/default.py”, line 69, in map_httpcore_exceptions yield File “/home/vscode/.local/lib/python3.11/site-packages/httpx/_transports/default.py”, line 233, in handle_request resp = self._pool.handle_request(req) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File “/home/vscode/.local/lib/python3.11/site-packages/httpcore/_sync/connection_pool.py”, line 216, in handle_request raise exc from None File “/home/vscode/.local/lib/python3.11/site-packages/httpcore/_sync/connection_pool.py”, line 196, in handle_request response = connection.handle_request( ^^^^^^^^^^^^^^^^^^^^^^^^^^ File “/home/vscode/.local/lib/python3.11/site-packages/httpcore/_sync/connection.py”, line 101, in handle_request return self._connection.handle_request(request) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File “/home/vscode/.local/lib/python3.11/site-packages/httpcore/_sync/http11.py”, line 143, in handle_request raise exc File “/home/vscode/.local/lib/python3.11/site-packages/httpcore/_sync/http11.py”, line 113, in handle_request ) = self._receive_response_headers(**kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File “/home/vscode/.local/lib/python3.11/site-packages/httpcore/_sync/http11.py”, line 186, in _receive_response_headers event = self._receive_event(timeout=timeout) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File “/home/vscode/.local/lib/python3.11/site-packages/httpcore/_sync/http11.py”, line 224, in _receive_event data = self._network_stream.read( ^^^^^^^^^^^^^^^^^^^^^^^^^^ File “/home/vscode/.local/lib/python3.11/site-packages/httpcore/_backends/sync.py”, line 124, in read with map_exceptions(exc_map): File “/usr/local/lib/python3.11/contextlib.py”, line 158, in exit self.gen.throw(typ, value, traceback) File “/home/vscode/.local/lib/python3.11/site-packages/httpcore/_exceptions.py”, line 14, in map_exceptions raise to_exc(exc) from exc httpcore.ReadTimeout: timed out

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

Traceback (most recent call last): File “/home/vscode/.local/lib/python3.11/site-packages/qdrant_client/http/api_client.py”, line 101, in send_inner response = self._client.send(request) ^^^^^^^^^^^^^^^^^^^^^^^^^^ File “/home/vscode/.local/lib/python3.11/site-packages/httpx/_client.py”, line 914, in send response = self._send_handling_auth( ^^^^^^^^^^^^^^^^^^^^^^^^^ File “/home/vscode/.local/lib/python3.11/site-packages/httpx/_client.py”, line 942, in _send_handling_auth response = self._send_handling_redirects( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File “/home/vscode/.local/lib/python3.11/site-packages/httpx/_client.py”, line 979, in _send_handling_redirects response = self._send_single_request(request) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File “/home/vscode/.local/lib/python3.11/site-packages/httpx/_client.py”, line 1015, in _send_single_request response = transport.handle_request(request) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File “/home/vscode/.local/lib/python3.11/site-packages/httpx/_transports/default.py”, line 232, in handle_request with map_httpcore_exceptions(): File “/usr/local/lib/python3.11/contextlib.py”, line 158, in exit self.gen.throw(typ, value, traceback) File “/home/vscode/.local/lib/python3.11/site-packages/httpx/_transports/default.py”, line 86, in map_httpcore_exceptions raise mapped_exc(message) from exc httpx.ReadTimeout: timed out

Hi!

I have an additional solution to try. Looking through the SDK code, if you don’t set port=None when instantiating a QdrantClient object, the string :6333 gets added onto the request URL.

This was causing timeout issues for us with our hosted database. So…

https://my-url.com:6333/collections -> timeout error https://my-url.com/collections -> Success!

Using the test code below allowed me to connect to our hosted database.

qdrant_api_key = "my-api-key"
qdrant_url = "https://my-url.com"
dev_client = QdrantClient(url=qdrant_url, port=None, api_key=qdrant_api_key)
dev_client.get_collections()

Hopefully this helps!

@FrancescoSaverioZuppichini it seems for me that we can proceed like this infinitely, I suggest you to concat me in discord so we could solve the issue in real-time, and then publish a post-mortem here

To find me in discord go to our discord channel and look for george.panchuk.

hi @FrancescoSaverioZuppichini

sorry for the late response

I’ve checked various configurations on qdrant-client==1.7.0

client = QdrantClient(url='https://aws.aws.com:6333', api_key='api_key')
client = QdrantClient(url='https://aws.aws.com:6333', api_key='api_key', https=True)
client = QdrantClient(url='https://aws.aws.com:6333')
client = QdrantClient(url='https://aws.aws.com:6333', https=True)

client = QdrantClient(url='https://aws.aws.com:6333', api_key='api_key', prefer_grpc=True)
client = QdrantClient(url='https://aws.aws.com:6333', api_key='api_key', https=True, prefer_grpc=True)
client = QdrantClient(url='https://aws.aws.com:6333', prefer_grpc=True)
client = QdrantClient(url='https://aws.aws.com:6333', https=True, prefer_grpc=True)

All of them seem to work correctly and https is enabled if the scheme contains ‘https’ regardless of https flag being set or not

As I wrote here, I had tried these configurations and they were correct: all of them set QdrantClient._client._https flag correctly and constructed QdrantClient._client.rest_uri.

If you can’t share even an obfuscated uri, then it might be helpful if you could check values of the mentioned variables on your own and write the result here

@FrancescoSaverioZuppichini @Thiru-GVT could you please provide qdrant version you are using and qdrant-client version?

Btw, in some setups azure deployment requires setting port as 443 instead of 6333