# ReadTimeout error on query

**URL:** <https://forum.weaviate.io/t/readtimeout-error-on-query/1330>\
**Category:** Support\
**Created:** [January 30, 2024, 10:38am UTC](https://forum.weaviate.io/t/readtimeout-error-on-query/1330 "2024-01-30T10:38:29Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![mahima-manik](https://yyz1.discourse-cdn.com/flex027/user_avatar/forum.weaviate.io/mahima-manik/32/886_2.png) [@mahima-manik](https://forum.weaviate.io/u/mahima-manik)\
**Post date:** [January 30, 2024, 10:38am UTC](https://forum.weaviate.io/t/readtimeout-error-on-query/1330/1 "2024-01-30T10:38:29Z")

</div>

Hi,

I am using Python client to connect with weaviate. Connect timeout is 30 sec and Read timeout is set to _600 sec_. Weaviate class has ~70,000 objects.

`where_filter` is the query filter with AND operator based on 2 more class properties.

Here is the code snippet:

```auto
import weaviate

client = weaviate.Client(weaviate_url, **kwargs, timeout_config=(30, 600))
res = (
            self.client.query
            .get(class_name=self._class_name, properties=["video_id"])
            .with_where(where_filter.dict())
            .with_limit(1)
            .do()
        )

```

Here is the error:

```auto
File "weaviate_manager.py", line 359, in my_function
    .do()
  File "/home/airflow/.local/lib/python3.10/site-packages/weaviate/gql/get.py", line 1205, in do
    return super().do()
  File "/home/airflow/.local/lib/python3.10/site-packages/weaviate/gql/filter.py", line 76, in do
    response = self._connection.post(path="/graphql", weaviate_object={"query": query})
  File "/home/airflow/.local/lib/python3.10/site-packages/weaviate/connect/connection.py", line 427, in post
    return self._session.post(
  File "/home/airflow/.local/lib/python3.10/site-packages/requests/sessions.py", line 635, in post
    return self.request("POST", url, data=data, json=json, **kwargs)
  File "/home/airflow/.local/lib/python3.10/site-packages/requests/sessions.py", line 587, in request
    resp = self.send(prep, **send_kwargs)
  File "/home/airflow/.local/lib/python3.10/site-packages/requests/sessions.py", line 701, in send
    r = adapter.send(request, **kwargs)
  File "/home/airflow/.local/lib/python3.10/site-packages/requests/adapters.py", line 578, in send
    raise ReadTimeout(e, request=request)
requests.exceptions.ReadTimeout: HTTPSConnectionPool(host='qwerty.c0.us-east1.gcp.weaviate.cloud', port=443): Read timed out. (read timeout=600)

```

Read timeout is quite high already. How do I fix this issue?

---

<div class="post-metadata">

**Author:** ![DudaNogueira](https://yyz1.discourse-cdn.com/flex027/user_avatar/forum.weaviate.io/dudanogueira/32/7846_2.png) [@DudaNogueira](https://forum.weaviate.io/u/DudaNogueira)\
**Post date:** [January 30, 2024, 12:26pm UTC](https://forum.weaviate.io/t/readtimeout-error-on-query/1330/2 "2024-01-30T12:26:57Z")

</div>

Hi @mahima-manik ! Welcome to our community 🤗

The new version of the python client ([2.26.2](https://pypi.org/project/weaviate-client/3.26.2/)) has a fix for a bug that was affecting this:

> <https://github.com/weaviate/weaviate-python-client/issues/753>
>
> In the Python v3 SDK, the Weaviate \`Client\` has \`timeout\_config\` and \`startup\_pe…riod\` parameters, which sound like they will raise an exception if the Weaviate server can't be reached within that amount of time. However, I'm seeing that when my server is overloaded and not responding, my client hangs indefinitely instead.
> 
> Looking at \`weaviate/connect/connection.py \> wait\_for\_weaviate()\` \[method\](https://github.com/weaviate/weaviate-python-client/blob/main/weaviate/connect/connection.py#L644), it seems like you're making a \`requests.get()\` call without any timeout specified, and that \`startup\_period\` is used as a retry limit, not a timeout.
> 
> I thought that \`requests.get()\` needed to explicitly set a timeout, otherwise the default is to wait indefinitely

What python client version are you using?

---

<div class="post-metadata">

**Author:** ![mahima-manik](https://yyz1.discourse-cdn.com/flex027/user_avatar/forum.weaviate.io/mahima-manik/32/886_2.png) [@mahima-manik](https://forum.weaviate.io/u/mahima-manik)\
**Post date:** [January 30, 2024, 2:04pm UTC](https://forum.weaviate.io/t/readtimeout-error-on-query/1330/3 "2024-01-30T14:04:29Z")

</div>

Hey @DudaNogueira, Thanks for your response.

I was using 3.18.0 and have updated to 3.26.2 now. In the error log, you can see that the timeout was thrown after 600 sec, so I believe the timeout is being honoured with both versions.

The problem still persists. What else I can try here?

---

<div class="post-metadata">

**Author:** ![DudaNogueira](https://yyz1.discourse-cdn.com/flex027/user_avatar/forum.weaviate.io/dudanogueira/32/7846_2.png) [@DudaNogueira](https://forum.weaviate.io/u/DudaNogueira)\
**Post date:** [January 30, 2024, 2:14pm UTC](https://forum.weaviate.io/t/readtimeout-error-on-query/1330/4 "2024-01-30T14:14:30Z")

</div>

Can you try that same filter using py v4?

Also, how big is that where\_filter?

That is hosted in WCS, right? I would need to check the logs to understand it better.

Can you please open a support ticket? So we can follow on from there?

Thanks!

---

<div class="post-metadata">

**Author:** ![Dharanish](https://yyz1.discourse-cdn.com/flex027/user_avatar/forum.weaviate.io/dharanish/32/659_2.png) [@Dharanish](https://forum.weaviate.io/u/Dharanish)\
**Post date:** [January 31, 2024, 5:06am UTC](https://forum.weaviate.io/t/readtimeout-error-on-query/1330/5 "2024-01-31T05:06:21Z")

</div>

Hi @DudaNogueira @mahima-manik ,I also faced the above issue in my current running weaviate-1.21.2 (not on WCS) at number of parallel requests even with  
connectionpoolsize=40 and maxpoolsize=40. for very less number of parallel requests it works fine. it is fine if you share the exact root cause as well as solution 🙂

---

<div class="post-metadata">

**Author:** ![mahima-manik](https://yyz1.discourse-cdn.com/flex027/user_avatar/forum.weaviate.io/mahima-manik/32/886_2.png) [@mahima-manik](https://forum.weaviate.io/u/mahima-manik)\
**Post date:** [January 31, 2024, 12:28pm UTC](https://forum.weaviate.io/t/readtimeout-error-on-query/1330/6 "2024-01-31T12:28:39Z")

</div>

Yes, it is hosted in WCS. I have opened a support ticket (#43).

@Dharanish I will share the root cause and solution here once I have it 🙂

---

<div class="post-metadata">

**Author:** ![DudaNogueira](https://yyz1.discourse-cdn.com/flex027/user_avatar/forum.weaviate.io/dudanogueira/32/7846_2.png) [@DudaNogueira](https://forum.weaviate.io/u/DudaNogueira)\
**Post date:** [January 31, 2024, 12:42pm UTC](https://forum.weaviate.io/t/readtimeout-error-on-query/1330/7 "2024-01-31T12:42:15Z")

</div>

@Dharanish If you throttle or reduce the amount of data sent will it work fine?

This looks like a connection issue on load balancer due to the ammount of data sent.

AFAIK, Weaviate will ingest (or try to) whatever amount of data you throw at.

So reducing the amount of data may give it more time to process. That’s when the new ASYNC INDEX comes handy, as you first send all data, then Weaviate will ingest and index on a timely manner.
