Client.Timeout exceeded while awaiting headers - During insertion data in weaviate

Here is my code

client = weaviate.connect_to_local(
    host="localhost",  # Use a string to specify the host
    port=8080,
    grpc_port=50051,
    additional_config=AdditionalConfig(
        timeout=Timeout(init=600, query=500, insert=1000)  # Values in seconds
    )
)

        with collection.batch.rate_limit(requests_per_minute=10) as batch:
            batch.add_object(properties=data_row)

        if len(collection.batch.failed_objects) > 0:
            print(collection.batch.failed_objects)
           

its giving me error related to timeout even though I have increased the timeout as well in above connection thing here is the error I am facing I have content of almost 10K words.

[ErrorObject(message=‘WeaviateInsertManyAllFailedError('Every object failed during insertion. Here is the set of all errors: send POST request: Post “http://t2v-transformers:8080/vectors”: context deadline exceeded (Client.Timeout exceeded while awaiting headers)')’, object_=_BatchObject(collection=‘Collection_83cdb7b2569a428095e38b73e8348168’, vector=None, uuid=‘f42b6ee8-f256-4bd3-9f6a-c53ec77fe27d’,

I have tired dynamic import as well.

hi @Muhammad_Ashir !!

The issue here seems to be the time out from Weaviate server to your embedding service at http://t2v-transformers:8080/vectors.

So changing the timeout on client will take no effect and the fact that it is timeouting is because you are away from an acceptable threshold :grimacing:

We have two options from here:

  1. Increase the resource of your embedding service, making sure you get it is below to what Weaviate understands as acceptable.

  2. Increase the module client timeout (default as I write 50s), allowing Weaviate to wait for this vectorization for more time by setting a different MODULES_CLIENT_TIMEOUT as documented here.

Let me know if that helps!

Thanks!