I’m building a chatbot that uses Weaviate and t2v-transformers for vectorizing my knowledge base. My way of sends batches like this:
var batchResponse = await _httpClient.PostAsync($"{_weaviateUrl}/v1/batch/objects", batchContent);
Each batch contains 50 objects, runs with 5 parallel processes, and each object includes about 12 sentences. Most batches succeed, but occasionally I run into this error:
t2v-transformers-1 | INFO: 172.21.0.4:55808 - “POST /vectors HTTP/1.1” 200 OK
weaviate-1 | {“build_git_commit”:“584532a”, … “error”:“write tcp 172.21.0.4:8080->172.21.0.1:33884: i/o timeout”, “hint”:“Either try increasing the server-side timeout using e.g. ‘–write-timeout=600s’ …”}
The error suggests increasing the server-side timeout using --write-timeout=600s
. When I added that to my Weaviate Docker configuration, the container started to reload repeatedly with errors about missing TLS certificates. To resolve the TLS issue, I generated certificates with OpenSSL, mapped them into the container, and configured Weaviate to use them.
Here’s my current Docker Compose configuration for Weaviate and t2v-transformers:
weaviate:
image: cr.weaviate.io/semitechnologies/weaviate:1.26.4
restart: unless-stopped
ports:
- 8080:8080
- 50051:50051
volumes:
- /var/beyond_weaviate_data:/data
- ./certs:/certs
command: [
"/app/weaviate",
"--write-timeout=600s",
"--tls-certificate=/certs/cert.pem",
"--tls-key=/certs/key.pem"
]
environment:
QUERY_DEFAULTS_LIMIT: 100
AUTHENTICATION_ANONYMOUS_ACCESS_ENABLED: 'true'
PERSISTENCE_DATA_PATH: "/data"
DEFAULT_VECTORIZER_MODULE: text2vec-transformers
ENABLE_MODULES: text2vec-transformers
TRANSFORMERS_INFERENCE_API: http://t2v-transformers:8080
CLUSTER_HOSTNAME: 'node1'
BATCH_TIMEOUT: 300
t2v-transformers:
image: cr.weaviate.io/semitechnologies/transformers-inference:sentence-transformers-multi-qa-MiniLM-L6-cos-v1
restart: unless-stopped
environment:
ENABLE_CUDA: 0
USE_SENTENCE_TRANSFORMERS_MULTI_PROCESS: "true"
ENABLE_CACHE: "true"
After adding the certificate parameters, the container stopped reloading, but now my application cannot connect. I get connection errors in my .NET client similar to:
at System.Net.Http.HttpConnection.<SendAsync>d__57.MoveNext()
...
at NLP_LLMEngine.Services.WeaviateVectorizationService.<CreateCollectionIfNotExistsAsync>d__11.MoveNext() in ...\WeaviateVectorizationService.cs:line 70
Weaviate logs show that the transformer remote inference service is not ready (connection refused on t2v-transformers:8080
). And thats how i get connectivity issues and timeout errors.
My Question
How can I safely add a server-side write timeout (e.g., --write-timeout=600s
) for batch vectorization without causing TLS certificate issues or container restarts? And if the tls is needed in my case is there a way to configure Weaviate to use the specified TLS certificate and key without interfering with communication between Weaviate and t2v-transformers?
Any help to handle these issues would be greatly appreciated. I’m fairly new to vector databases and Weaviate, so any help would be great, thanks in advance.