weaviate.exceptions.UnexpectedStatusCodeException: Create objects in batch! Unexpected status code: #7002

Closed
opened 2026-02-21 18:18:20 -05:00 by yindo · 2 comments
Owner

Originally created by @majestichou on GitHub (Dec 1, 2024).

Self Checks

  • This is only for bug report, if you would like to ask a question, please head to Discussions.
  • I have searched for existing issues search for existing issues, including closed ones.
  • I confirm that I am using English to submit this report (我已阅读并同意 Language Policy).
  • [FOR CHINESE USERS] 请务必使用英文提交 Issue,否则会被关闭。谢谢!:)
  • Please do not modify this template :) and fill in all the required fields.

Dify version

0.11.2

Cloud or Self Hosted

Self Hosted (Docker)

Steps to reproduce

1.Start the Dify of the 0.11.2 version, set ETL_TYPE to Unstructured, build a knowledge base, and discard hundreds of Markdown and docx files
2. An error occurred halfway through document processing.
3. Check the logs of the docker-api-1 container. The following error information is displayed:


2024-11-29 18:27:42.910 ERROR [Dummy-22] [app.py:838] - Exception on /console/api/datasets/indexing-estimate [POST]
Traceback (most recent call last):
  File "/app/api/controllers/console/datasets/datasets.py", line 449, in post
    response = indexing_runner.indexing_estimate(
  File "/app/api/core/indexing_runner.py", line 262, in indexing_estimate
    text_docs = index_processor.extract(extract_setting, process_rule_mode=tmp_processing_rule["mode"])
  File "/app/api/core/rag/index_processor/processor/paragraph_index_processor.py", line 20, in extract
    text_docs = ExtractProcessor.extract(
  File "/app/api/core/rag/extractor/extract_processor.py", line 157, in extract
    return extractor.extract()
  File "/app/api/core/rag/extractor/word_extractor.py", line 65, in extract
    content = self.parse_docx(self.file_path, "storage")
  File "/app/api/core/rag/extractor/word_extractor.py", line 211, in parse_docx
    image_map = self._extract_images_from_docx(doc, image_folder)
  File "/app/api/core/rag/extractor/word_extractor.py", line 89, in _extract_images_from_docx
    response = ssrf_proxy.get(url, stream=True)
  File "/app/api/core/helper/ssrf_proxy.py", line 70, in get
    return make_request("GET", url, max_retries=max_retries, **kwargs)
  File "/app/api/core/helper/ssrf_proxy.py", line 49, in make_request
    response = client.request(method=method, url=url, **kwargs)
TypeError: Client.request() got an unexpected keyword argument 'stream'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/app/api/.venv/lib/python3.10/site-packages/flask/app.py", line 880, in full_dispatch_request
    rv = self.dispatch_request()
  File "/app/api/.venv/lib/python3.10/site-packages/flask/app.py", line 865, in dispatch_request
    return self.ensure_sync(self.view_functions[rule.endpoint])(**view_args)  # type: ignore[no-any-return]
  File "/app/api/.venv/lib/python3.10/site-packages/flask_restful/__init__.py", line 489, in wrapper
    resp = resource(*args, **kwargs)
  File "/app/api/.venv/lib/python3.10/site-packages/flask/views.py", line 110, in view
    return current_app.ensure_sync(self.dispatch_request)(**kwargs)  # type: ignore[no-any-return]
  File "/app/api/.venv/lib/python3.10/site-packages/flask_restful/__init__.py", line 604, in dispatch_request
    resp = meth(*args, **kwargs)
  File "/app/api/controllers/console/wraps.py", line 142, in decorated
    return view(*args, **kwargs)
  File "/app/api/libs/login.py", line 92, in decorated_view
    return current_app.ensure_sync(func)(*args, **kwargs)
  File "/app/api/controllers/console/wraps.py", line 26, in decorated
    return view(*args, **kwargs)
  File "/app/api/controllers/console/datasets/datasets.py", line 465, in post
    raise IndexingEstimateError(str(e))
controllers.console.datasets.error.IndexingEstimateError: 500 Internal Server Error: Client.request() got an unexpected keyword argument 'stream'
/usr/local/lib/python3.10/asyncio/base_events.py:688: ResourceWarning: unclosed event loop <_UnixSelectorEventLoop running=False closed=False debug=False>
  _warn(f"unclosed event loop {self!r}", ResourceWarning, source=self)
ResourceWarning: Enable tracemalloc to get the object allocation traceback
/app/api/.venv/lib/python3.10/site-packages/sqlalchemy/orm/state.py:205: ResourceWarning: unclosed <socket object, fd=38, family=2, type=1, proto=6>
  self.committed_state = {}
ResourceWarning: Enable tracemalloc to get the object allocation traceback
  1. Check the logs of the docker-worker-1 container. The following error information is displayed:
2024-11-29 19:04:18.162 WARNING [ThreadPoolExecutor-5000_0] [log.py:232] - [ERROR] Batch ConnectionError Exception occurred! Retrying in 2s. [1/3]
2024-11-29 20:30:56.994 WARNING [ThreadPoolExecutor-8343_0] [log.py:232] - [ERROR] Batch ConnectionError Exception occurred! Retrying in 2s. [1/3]
2024-11-29 21:03:46.392 WARNING [ThreadPoolExecutor-9894_0] [log.py:232] - [ERROR] Batch ConnectionError Exception occurred! Retrying in 2s. [1/3]
2024-11-30 01:38:50.698 WARNING [ThreadPoolExecutor-19429_0] [log.py:232] - [ERROR] Batch ConnectionError Exception occurred! Retrying in 2s. [1/3]
2024-11-30 02:42:23.401 WARNING [ThreadPoolExecutor-22097_0] [log.py:232] - [ERROR] Batch ConnectionError Exception occurred! Retrying in 2s. [1/3]
2024-11-30 03:12:00.582 WARNING [ThreadPoolExecutor-23261_0] [log.py:232] - [ERROR] Batch ConnectionError Exception occurred! Retrying in 2s. [1/3]
2024-11-30 03:54:50.351 WARNING [ThreadPoolExecutor-24825_0] [log.py:232] - [ERROR] Batch ConnectionError Exception occurred! Retrying in 2s. [1/3]
2024-11-30 03:58:21.949 WARNING [ThreadPoolExecutor-24948_0] [log.py:232] - [ERROR] Batch ConnectionError Exception occurred! Retrying in 2s. [1/3]
2024-11-30 05:12:59.903 WARNING [ThreadPoolExecutor-28565_0] [log.py:232] - [ERROR] Batch ConnectionError Exception occurred! Retrying in 2s. [1/3]
2024-11-30 07:15:57.619 WARNING [ThreadPoolExecutor-34041_0] [log.py:232] - [ERROR] Batch ConnectionError Exception occurred! Retrying in 2s. [1/3]
2024-11-30 09:20:24.878 WARNING [ThreadPoolExecutor-40650_0] [log.py:232] - [ERROR] Batch ConnectionError Exception occurred! Retrying in 2s. [1/3]
2024-11-30 11:12:42.018 WARNING [ThreadPoolExecutor-44787_0] [log.py:232] - [ERROR] Batch ConnectionError Exception occurred! Retrying in 2s. [1/3]
2024-11-30 12:16:20.147 WARNING [ThreadPoolExecutor-46845_0] [log.py:232] - [ERROR] Batch ConnectionError Exception occurred! Retrying in 2s. [1/3]
2024-11-30 12:17:18.332 ERROR [Dummy-50] [indexing_runner.py:92] - consume document failed
Traceback (most recent call last):
  File "/app/api/core/indexing_runner.py", line 76, in run
    self._load(
  File "/app/api/core/indexing_runner.py", line 661, in _load
    tokens += future.result()
  File "/usr/local/lib/python3.10/concurrent/futures/_base.py", line 451, in result
    return self.__get_result()
  File "/usr/local/lib/python3.10/concurrent/futures/_base.py", line 403, in __get_result
    raise self._exception
  File "/usr/local/lib/python3.10/concurrent/futures/thread.py", line 58, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/app/api/core/indexing_runner.py", line 718, in _process_chunk
    index_processor.load(dataset, chunk_documents, with_keywords=False)
  File "/app/api/core/rag/index_processor/processor/paragraph_index_processor.py", line 60, in load
    vector.create(documents)
  File "/app/api/core/rag/datasource/vdb/vector_factory.py", line 151, in create
    self._vector_processor.create(texts=texts, embeddings=embeddings, **kwargs)
  File "/app/api/core/rag/datasource/vdb/weaviate/weaviate_vector.py", line 85, in create
    self.add_texts(texts, embeddings)
  File "/app/api/core/rag/datasource/vdb/weaviate/weaviate_vector.py", line 106, in add_texts
    with self._client.batch as batch:
  File "/app/api/.venv/lib/python3.10/site-packages/weaviate/batch/crud_batch.py", line 1534, in __exit__
    self.flush()
  File "/app/api/.venv/lib/python3.10/site-packages/weaviate/batch/crud_batch.py", line 1152, in flush
    self._send_batch_requests(force_wait=True)
  File "/app/api/.venv/lib/python3.10/site-packages/weaviate/batch/crud_batch.py", line 1063, in _send_batch_requests
    response_objects, nr_objects = done_future.result()
  File "/usr/local/lib/python3.10/concurrent/futures/_base.py", line 451, in result
    return self.__get_result()
  File "/usr/local/lib/python3.10/concurrent/futures/_base.py", line 403, in __get_result
    raise self._exception
  File "/usr/local/lib/python3.10/concurrent/futures/thread.py", line 58, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/app/api/.venv/lib/python3.10/site-packages/weaviate/batch/crud_batch.py", line 1012, in _flush_in_thread
    response = self._create_data(
  File "/app/api/.venv/lib/python3.10/site-packages/weaviate/batch/crud_batch.py", line 673, in _create_data
    raise UnexpectedStatusCodeException(f"Create {data_type} in batch", response)
weaviate.exceptions.UnexpectedStatusCodeException: Create objects in batch! Unexpected status code: 400, with response body: {'code': 400, 'message': 'parsing body body from "" failed, because read tcp 172.19.0.2:8080->172.19.0.7:38882: i/o timeout'}.
2024-11-30 12:36:06.563 WARNING [ThreadPoolExecutor-47101_0] [log.py:232] - [ERROR] Batch ConnectionError Exception occurred! Retrying in 2s. [1/3]
2024-11-30 13:03:25.901 WARNING [ThreadPoolExecutor-48488_0] [log.py:232] - [ERROR] Batch ConnectionError Exception occurred! Retrying in 2s. [1/3]
2024-11-30 16:10:04.877 WARNING [ThreadPoolExecutor-57519_0] [log.py:232] - [ERROR] Batch ConnectionError Exception occurred! Retrying in 2s. [1/3]
2024-11-30 18:17:27.533 WARNING [ThreadPoolExecutor-64879_0] [log.py:232] - [ERROR] Batch ConnectionError Exception occurred! Retrying in 2s. [1/3]
2024-11-30 18:53:08.592 WARNING [ThreadPoolExecutor-66737_0] [log.py:232] - [ERROR] Batch ConnectionError Exception occurred! Retrying in 2s. [1/3]
2024-11-30 18:56:20.099 WARNING [ThreadPoolExecutor-66900_0] [log.py:232] - [ERROR] Batch ConnectionError Exception occurred! Retrying in 2s. [1/3]
2024-11-30 23:20:56.052 WARNING [ThreadPoolExecutor-77996_0] [log.py:232] - [ERROR] Batch ConnectionError Exception occurred! Retrying in 2s. [1/3]
2024-11-30 23:27:50.217 WARNING [ThreadPoolExecutor-78352_0] [log.py:232] - [ERROR] Batch ConnectionError Exception occurred! Retrying in 2s. [1/3]
2024-11-30 23:45:29.027 WARNING [ThreadPoolExecutor-78890_0] [log.py:232] - [ERROR] Batch ConnectionError Exception occurred! Retrying in 2s. [1/3]
2024-12-01 00:31:28.921 WARNING [ThreadPoolExecutor-81012_0] [log.py:232] - [ERROR] Batch ConnectionError Exception occurred! Retrying in 2s. [1/3]
2024-12-01 03:00:23.319 WARNING [ThreadPoolExecutor-87393_0] [log.py:232] - [ERROR] Batch ConnectionError Exception occurred! Retrying in 2s. [1/3]
2024-12-01 03:50:00.062 WARNING [ThreadPoolExecutor-89010_0] [log.py:232] - [ERROR] Batch ConnectionError Exception occurred! Retrying in 2s. [1/3]
2024-12-01 04:10:49.136 WARNING [ThreadPoolExecutor-89714_0] [log.py:232] - [ERROR] Batch ConnectionError Exception occurred! Retrying in 2s. [1/3]

✔️ Expected Behavior

Hundreds of documents can be correctly embedded.

Actual Behavior

weaviate.exceptions.UnexpectedStatusCodeException: Create objects in batch! Unexpected status code:

Originally created by @majestichou on GitHub (Dec 1, 2024). ### Self Checks - [X] This is only for bug report, if you would like to ask a question, please head to [Discussions](https://github.com/langgenius/dify/discussions/categories/general). - [X] I have searched for existing issues [search for existing issues](https://github.com/langgenius/dify/issues), including closed ones. - [X] I confirm that I am using English to submit this report (我已阅读并同意 [Language Policy](https://github.com/langgenius/dify/issues/1542)). - [X] [FOR CHINESE USERS] 请务必使用英文提交 Issue,否则会被关闭。谢谢!:) - [X] Please do not modify this template :) and fill in all the required fields. ### Dify version 0.11.2 ### Cloud or Self Hosted Self Hosted (Docker) ### Steps to reproduce 1.Start the Dify of the 0.11.2 version, set ETL_TYPE to Unstructured, build a knowledge base, and discard hundreds of Markdown and docx files 2. An error occurred halfway through document processing. 3. Check the logs of the docker-api-1 container. The following error information is displayed: ``` 2024-11-29 18:27:42.910 ERROR [Dummy-22] [app.py:838] - Exception on /console/api/datasets/indexing-estimate [POST] Traceback (most recent call last): File "/app/api/controllers/console/datasets/datasets.py", line 449, in post response = indexing_runner.indexing_estimate( File "/app/api/core/indexing_runner.py", line 262, in indexing_estimate text_docs = index_processor.extract(extract_setting, process_rule_mode=tmp_processing_rule["mode"]) File "/app/api/core/rag/index_processor/processor/paragraph_index_processor.py", line 20, in extract text_docs = ExtractProcessor.extract( File "/app/api/core/rag/extractor/extract_processor.py", line 157, in extract return extractor.extract() File "/app/api/core/rag/extractor/word_extractor.py", line 65, in extract content = self.parse_docx(self.file_path, "storage") File "/app/api/core/rag/extractor/word_extractor.py", line 211, in parse_docx image_map = self._extract_images_from_docx(doc, image_folder) File "/app/api/core/rag/extractor/word_extractor.py", line 89, in _extract_images_from_docx response = ssrf_proxy.get(url, stream=True) File "/app/api/core/helper/ssrf_proxy.py", line 70, in get return make_request("GET", url, max_retries=max_retries, **kwargs) File "/app/api/core/helper/ssrf_proxy.py", line 49, in make_request response = client.request(method=method, url=url, **kwargs) TypeError: Client.request() got an unexpected keyword argument 'stream' During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/app/api/.venv/lib/python3.10/site-packages/flask/app.py", line 880, in full_dispatch_request rv = self.dispatch_request() File "/app/api/.venv/lib/python3.10/site-packages/flask/app.py", line 865, in dispatch_request return self.ensure_sync(self.view_functions[rule.endpoint])(**view_args) # type: ignore[no-any-return] File "/app/api/.venv/lib/python3.10/site-packages/flask_restful/__init__.py", line 489, in wrapper resp = resource(*args, **kwargs) File "/app/api/.venv/lib/python3.10/site-packages/flask/views.py", line 110, in view return current_app.ensure_sync(self.dispatch_request)(**kwargs) # type: ignore[no-any-return] File "/app/api/.venv/lib/python3.10/site-packages/flask_restful/__init__.py", line 604, in dispatch_request resp = meth(*args, **kwargs) File "/app/api/controllers/console/wraps.py", line 142, in decorated return view(*args, **kwargs) File "/app/api/libs/login.py", line 92, in decorated_view return current_app.ensure_sync(func)(*args, **kwargs) File "/app/api/controllers/console/wraps.py", line 26, in decorated return view(*args, **kwargs) File "/app/api/controllers/console/datasets/datasets.py", line 465, in post raise IndexingEstimateError(str(e)) controllers.console.datasets.error.IndexingEstimateError: 500 Internal Server Error: Client.request() got an unexpected keyword argument 'stream' /usr/local/lib/python3.10/asyncio/base_events.py:688: ResourceWarning: unclosed event loop <_UnixSelectorEventLoop running=False closed=False debug=False> _warn(f"unclosed event loop {self!r}", ResourceWarning, source=self) ResourceWarning: Enable tracemalloc to get the object allocation traceback /app/api/.venv/lib/python3.10/site-packages/sqlalchemy/orm/state.py:205: ResourceWarning: unclosed <socket object, fd=38, family=2, type=1, proto=6> self.committed_state = {} ResourceWarning: Enable tracemalloc to get the object allocation traceback ``` 4. Check the logs of the docker-worker-1 container. The following error information is displayed: ``` 2024-11-29 19:04:18.162 WARNING [ThreadPoolExecutor-5000_0] [log.py:232] - [ERROR] Batch ConnectionError Exception occurred! Retrying in 2s. [1/3] 2024-11-29 20:30:56.994 WARNING [ThreadPoolExecutor-8343_0] [log.py:232] - [ERROR] Batch ConnectionError Exception occurred! Retrying in 2s. [1/3] 2024-11-29 21:03:46.392 WARNING [ThreadPoolExecutor-9894_0] [log.py:232] - [ERROR] Batch ConnectionError Exception occurred! Retrying in 2s. [1/3] 2024-11-30 01:38:50.698 WARNING [ThreadPoolExecutor-19429_0] [log.py:232] - [ERROR] Batch ConnectionError Exception occurred! Retrying in 2s. [1/3] 2024-11-30 02:42:23.401 WARNING [ThreadPoolExecutor-22097_0] [log.py:232] - [ERROR] Batch ConnectionError Exception occurred! Retrying in 2s. [1/3] 2024-11-30 03:12:00.582 WARNING [ThreadPoolExecutor-23261_0] [log.py:232] - [ERROR] Batch ConnectionError Exception occurred! Retrying in 2s. [1/3] 2024-11-30 03:54:50.351 WARNING [ThreadPoolExecutor-24825_0] [log.py:232] - [ERROR] Batch ConnectionError Exception occurred! Retrying in 2s. [1/3] 2024-11-30 03:58:21.949 WARNING [ThreadPoolExecutor-24948_0] [log.py:232] - [ERROR] Batch ConnectionError Exception occurred! Retrying in 2s. [1/3] 2024-11-30 05:12:59.903 WARNING [ThreadPoolExecutor-28565_0] [log.py:232] - [ERROR] Batch ConnectionError Exception occurred! Retrying in 2s. [1/3] 2024-11-30 07:15:57.619 WARNING [ThreadPoolExecutor-34041_0] [log.py:232] - [ERROR] Batch ConnectionError Exception occurred! Retrying in 2s. [1/3] 2024-11-30 09:20:24.878 WARNING [ThreadPoolExecutor-40650_0] [log.py:232] - [ERROR] Batch ConnectionError Exception occurred! Retrying in 2s. [1/3] 2024-11-30 11:12:42.018 WARNING [ThreadPoolExecutor-44787_0] [log.py:232] - [ERROR] Batch ConnectionError Exception occurred! Retrying in 2s. [1/3] 2024-11-30 12:16:20.147 WARNING [ThreadPoolExecutor-46845_0] [log.py:232] - [ERROR] Batch ConnectionError Exception occurred! Retrying in 2s. [1/3] 2024-11-30 12:17:18.332 ERROR [Dummy-50] [indexing_runner.py:92] - consume document failed Traceback (most recent call last): File "/app/api/core/indexing_runner.py", line 76, in run self._load( File "/app/api/core/indexing_runner.py", line 661, in _load tokens += future.result() File "/usr/local/lib/python3.10/concurrent/futures/_base.py", line 451, in result return self.__get_result() File "/usr/local/lib/python3.10/concurrent/futures/_base.py", line 403, in __get_result raise self._exception File "/usr/local/lib/python3.10/concurrent/futures/thread.py", line 58, in run result = self.fn(*self.args, **self.kwargs) File "/app/api/core/indexing_runner.py", line 718, in _process_chunk index_processor.load(dataset, chunk_documents, with_keywords=False) File "/app/api/core/rag/index_processor/processor/paragraph_index_processor.py", line 60, in load vector.create(documents) File "/app/api/core/rag/datasource/vdb/vector_factory.py", line 151, in create self._vector_processor.create(texts=texts, embeddings=embeddings, **kwargs) File "/app/api/core/rag/datasource/vdb/weaviate/weaviate_vector.py", line 85, in create self.add_texts(texts, embeddings) File "/app/api/core/rag/datasource/vdb/weaviate/weaviate_vector.py", line 106, in add_texts with self._client.batch as batch: File "/app/api/.venv/lib/python3.10/site-packages/weaviate/batch/crud_batch.py", line 1534, in __exit__ self.flush() File "/app/api/.venv/lib/python3.10/site-packages/weaviate/batch/crud_batch.py", line 1152, in flush self._send_batch_requests(force_wait=True) File "/app/api/.venv/lib/python3.10/site-packages/weaviate/batch/crud_batch.py", line 1063, in _send_batch_requests response_objects, nr_objects = done_future.result() File "/usr/local/lib/python3.10/concurrent/futures/_base.py", line 451, in result return self.__get_result() File "/usr/local/lib/python3.10/concurrent/futures/_base.py", line 403, in __get_result raise self._exception File "/usr/local/lib/python3.10/concurrent/futures/thread.py", line 58, in run result = self.fn(*self.args, **self.kwargs) File "/app/api/.venv/lib/python3.10/site-packages/weaviate/batch/crud_batch.py", line 1012, in _flush_in_thread response = self._create_data( File "/app/api/.venv/lib/python3.10/site-packages/weaviate/batch/crud_batch.py", line 673, in _create_data raise UnexpectedStatusCodeException(f"Create {data_type} in batch", response) weaviate.exceptions.UnexpectedStatusCodeException: Create objects in batch! Unexpected status code: 400, with response body: {'code': 400, 'message': 'parsing body body from "" failed, because read tcp 172.19.0.2:8080->172.19.0.7:38882: i/o timeout'}. 2024-11-30 12:36:06.563 WARNING [ThreadPoolExecutor-47101_0] [log.py:232] - [ERROR] Batch ConnectionError Exception occurred! Retrying in 2s. [1/3] 2024-11-30 13:03:25.901 WARNING [ThreadPoolExecutor-48488_0] [log.py:232] - [ERROR] Batch ConnectionError Exception occurred! Retrying in 2s. [1/3] 2024-11-30 16:10:04.877 WARNING [ThreadPoolExecutor-57519_0] [log.py:232] - [ERROR] Batch ConnectionError Exception occurred! Retrying in 2s. [1/3] 2024-11-30 18:17:27.533 WARNING [ThreadPoolExecutor-64879_0] [log.py:232] - [ERROR] Batch ConnectionError Exception occurred! Retrying in 2s. [1/3] 2024-11-30 18:53:08.592 WARNING [ThreadPoolExecutor-66737_0] [log.py:232] - [ERROR] Batch ConnectionError Exception occurred! Retrying in 2s. [1/3] 2024-11-30 18:56:20.099 WARNING [ThreadPoolExecutor-66900_0] [log.py:232] - [ERROR] Batch ConnectionError Exception occurred! Retrying in 2s. [1/3] 2024-11-30 23:20:56.052 WARNING [ThreadPoolExecutor-77996_0] [log.py:232] - [ERROR] Batch ConnectionError Exception occurred! Retrying in 2s. [1/3] 2024-11-30 23:27:50.217 WARNING [ThreadPoolExecutor-78352_0] [log.py:232] - [ERROR] Batch ConnectionError Exception occurred! Retrying in 2s. [1/3] 2024-11-30 23:45:29.027 WARNING [ThreadPoolExecutor-78890_0] [log.py:232] - [ERROR] Batch ConnectionError Exception occurred! Retrying in 2s. [1/3] 2024-12-01 00:31:28.921 WARNING [ThreadPoolExecutor-81012_0] [log.py:232] - [ERROR] Batch ConnectionError Exception occurred! Retrying in 2s. [1/3] 2024-12-01 03:00:23.319 WARNING [ThreadPoolExecutor-87393_0] [log.py:232] - [ERROR] Batch ConnectionError Exception occurred! Retrying in 2s. [1/3] 2024-12-01 03:50:00.062 WARNING [ThreadPoolExecutor-89010_0] [log.py:232] - [ERROR] Batch ConnectionError Exception occurred! Retrying in 2s. [1/3] 2024-12-01 04:10:49.136 WARNING [ThreadPoolExecutor-89714_0] [log.py:232] - [ERROR] Batch ConnectionError Exception occurred! Retrying in 2s. [1/3] ``` ### ✔️ Expected Behavior Hundreds of documents can be correctly embedded. ### ❌ Actual Behavior weaviate.exceptions.UnexpectedStatusCodeException: Create objects in batch! Unexpected status code:
yindo added the 🐞 bug👻 feat:rag labels 2026-02-21 18:18:20 -05:00
yindo closed this issue 2026-02-21 18:18:20 -05:00
Author
Owner

@dosubot[bot] commented on GitHub (Dec 1, 2024):

The error you're encountering, weaviate.exceptions.UnexpectedStatusCodeException, occurs when the Weaviate server returns an unexpected HTTP status code during batch operations. In your case, the status code is 400, indicating a bad request, with a message about a timeout during body parsing. This suggests that the server is unable to process the request within the expected time frame, possibly due to network issues or server overload.

To address this issue, consider the following steps:

  1. Check Network Stability: Ensure that the network connection between your application and the Weaviate server is stable and has sufficient bandwidth to handle large batch operations.

  2. Increase Timeout Settings: If possible, increase the timeout settings for the Weaviate client to allow more time for the server to process requests.

  3. Reduce Batch Size: Try reducing the batch size for your operations. Smaller batches may be processed more reliably, especially if the server is under heavy load or if network latency is an issue.

  4. Monitor Server Load: Check the load on the Weaviate server to ensure it is not overwhelmed. If necessary, scale the server resources to handle the increased demand.

  5. Retry Logic: Implement or adjust retry logic to handle transient network issues more gracefully. Ensure that retries are spaced out to avoid overwhelming the server.

These steps should help mitigate the issue and improve the reliability of your batch operations with Weaviate [1].

To continue talking to Dosu, mention @dosu.

@dosubot[bot] commented on GitHub (Dec 1, 2024): <!-- Answer --> The error you're encountering, `weaviate.exceptions.UnexpectedStatusCodeException`, occurs when the Weaviate server returns an unexpected HTTP status code during batch operations. In your case, the status code is 400, indicating a bad request, with a message about a timeout during body parsing. This suggests that the server is unable to process the request within the expected time frame, possibly due to network issues or server overload. To address this issue, consider the following steps: 1. **Check Network Stability**: Ensure that the network connection between your application and the Weaviate server is stable and has sufficient bandwidth to handle large batch operations. 2. **Increase Timeout Settings**: If possible, increase the timeout settings for the Weaviate client to allow more time for the server to process requests. 3. **Reduce Batch Size**: Try reducing the batch size for your operations. Smaller batches may be processed more reliably, especially if the server is under heavy load or if network latency is an issue. 4. **Monitor Server Load**: Check the load on the Weaviate server to ensure it is not overwhelmed. If necessary, scale the server resources to handle the increased demand. 5. **Retry Logic**: Implement or adjust retry logic to handle transient network issues more gracefully. Ensure that retries are spaced out to avoid overwhelming the server. These steps should help mitigate the issue and improve the reliability of your batch operations with Weaviate <sup>[[1]](https://github.com/langgenius/dify/blob/main/api/core/rag/datasource/vdb/weaviate/weaviate_vector.py)</sup>. <!-- Dosu Comment Footer --> *To continue talking to [Dosu](https://dosu.dev), mention @dosu.*
Author
Owner

@majestichou commented on GitHub (Dec 2, 2024):

I updated to the latest version 0.12.1 and the problem is gone.

@majestichou commented on GitHub (Dec 2, 2024): I updated to the latest version 0.12.1 and the problem is gone.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langgenius/dify#7002