# \[Question\] WeaviateBatchError('Query call with protocol GRPC batch failed with message Deadline Exceeded') while writing store

**URL:** <https://forum.weaviate.io/t/question-weaviatebatcherror-query-call-with-protocol-grpc-batch-failed-with-message-deadline-exceeded-while-writing-store/1925>\
**Category:** Support\
**Tags:** integration, wcs\
**Created:** [April 6, 2024, 3:17am UTC](https://forum.weaviate.io/t/question-weaviatebatcherror-query-call-with-protocol-grpc-batch-failed-with-message-deadline-exceeded-while-writing-store/1925 "2024-04-06T03:17:49Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![eli](https://avatars.discourse-cdn.com/v4/letter/e/a9a28c/32.png) [@eli](https://forum.weaviate.io/u/eli)\
**Post date:** [April 6, 2024, 3:17am UTC](https://forum.weaviate.io/t/question-weaviatebatcherror-query-call-with-protocol-grpc-batch-failed-with-message-deadline-exceeded-while-writing-store/1925/1 "2024-04-06T03:17:49Z")

</div>

Summary: not able to write doc store

Context in short:

- 127.0.0.1:8080/v1/nodes shows health status
- grpc\_startup log shows 50051 is listening
- 127.0.0.1:8080/v1/meta shows all transformers r loaded successfully
- much more longer Timeout is given in weaviate constructor
- client lib: weaviate-haystack
- weaviate python lib version: v4

Error: ‘WeaviateBatchError(‘Query call with protocol GRPC batch failed with message Deadline Exceeded.’)’

* * *

```auto
from haystack import Document
from haystack_integrations.document_stores.weaviate import WeaviateDocumentStore
from weaviate.config import AdditionalConfig, ConnectionConfig, Timeout
from weaviate.collections.classes import grpc

document_store = WeaviateDocumentStore(
  url="http://localhost:8080", 
  additional_config=AdditionalConfig(
    grpc_secure=False,
    connection=ConnectionConfig(
      session_pool_connections=30,
      session_pool_maxsize=200,
      session_pool_max_retries=3,
    ),
    timeout=Timeout(query=500, insert=180),
  )
)
document_store.write_documents([
    Document(content="Allo"),
    Document(content="World")
])

print(document_store.count_documents())

```

---

<div class="post-metadata">

**Author:** ![eli](https://avatars.discourse-cdn.com/v4/letter/e/a9a28c/32.png) [@eli](https://forum.weaviate.io/u/eli)\
**Post date:** [April 6, 2024, 11:13am UTC](https://forum.weaviate.io/t/question-weaviatebatcherror-query-call-with-protocol-grpc-batch-failed-with-message-deadline-exceeded-while-writing-store/1925/2 "2024-04-06T11:13:26Z")

</div>

I tried to insert data using weaviate its own lib and methods. worked. proving that it’s a 3rd integration issue rather than weaviate itself.

---

<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:** [April 8, 2024, 8:01pm UTC](https://forum.weaviate.io/t/question-weaviatebatcherror-query-call-with-protocol-grpc-batch-failed-with-message-deadline-exceeded-while-writing-store/1925/3 "2024-04-08T20:01:20Z")

</div>

hi @eli ! Welcome to our community! 🤗

Can you paste here the entire error stack?

This may mean that the payload you sent is too big to be handled in a single request. It is usually a symptom of a batch size too big, and the GRPC will complain exactly on that.

Assuming there is no “timeout” on that error message.

I tried this code, and it worked as expected, so I am assuming this error happened with other dataset.

I see on Haystack code they seems to be using of the dynamic batch sizing:

> <https://github.com/deepset-ai/haystack-core-integrations/blob/40fe61a4c70b9d36b419268873decb97c1336837/integrations/weaviate/src/haystack_integrations/document_stores/weaviate/document_store.py#L366>

that, according to our docs:

> **[Python | Weaviate - Vector Database](https://weaviate.io/developers/weaviate/client-libraries/python#batch-sizing)**
>
> Overview

> The batch size and the number of concurrent requests are dynamically adjusted on-the-fly during import, depending on the server load.

So this may not be it 🤔

Let me know if this helps, or if you can create a reproducible notebook and/or have more relevant logs.

Thanks!

---

<div class="post-metadata">

**Author:** ![eli](https://avatars.discourse-cdn.com/v4/letter/e/a9a28c/32.png) [@eli](https://forum.weaviate.io/u/eli)\
**Post date:** [April 10, 2024, 12:38pm UTC](https://forum.weaviate.io/t/question-weaviatebatcherror-query-call-with-protocol-grpc-batch-failed-with-message-deadline-exceeded-while-writing-store/1925/4 "2024-04-10T12:38:53Z")

</div>

Hi @DudaNogueira , appreciate your detailed response and trying.

- Data set:  
I can confirm that the dataset are as simple as u can see

```auto
document_store.write_documents([
    Document(content="Allo"),
    Document(content="World")
])

```

- Error log:  
File “/app/tests/weaviate\_docstore.py”, line 24, in   
document\_store.write\_documents([  
File “/env\_py\_12/lib/python3.12/site-packages/haystack\_integrations/document\_stores/weaviate/document\_store.py”, line 444, in write\_documents  
return self.\_batch\_write(documents)  
^^^^^^^^^^^^^^^^^^^^^^^^^^^^  
File “/env\_py\_12/lib/python3.12/site-packages/haystack\_integrations/document\_stores/weaviate/document\_store.py”, line 394, in \_batch\_write  
raise DocumentStoreError(msg)  
haystack.document\_stores.errors.errors.DocumentStoreError: Failed to write object with id ‘f3b66e62b3b5d3e0942135c5cce25f713cf8415328c26ba992ba8f37d1b750e4’. Error: ‘WeaviateBatchError(‘Query call with protocol GRPC batch failed with message Deadline Exceeded.’)’  
Failed to write object with id ‘ec4e7974f6a1f33960b3d53a147158c0aeb554488ea808a74037aa5dcfd89a21’. Error: ‘WeaviateBatchError(‘Query call with protocol GRPC batch failed with message Deadline Exceeded.’)’  
sys:1: ResourceWarning: unclosed \<socket.socket fd=7, family=30, type=1, proto=6, laddr=(‘::1’, 60236, 0, 0), raddr=(‘::1’, 8080, 0, 0)\>

- reproducible notebook:  
on it, will update once make it ready

thx again
