You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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
When I vectorize the knowledge base file
docker-worker-1 logs:
024-11-19 07:52:13.154 ERROR [Dummy-3] [indexing_runner.py:92] - consume document failed
Traceback (most recent call last):
File "/app/api/core/indexing_runner.py", line 66, in run
text_docs = self._extract(index_processor, dataset_document, processing_rule.to_dict())
File "/app/api/core/indexing_runner.py", line 313, in _extract
text_docs = index_processor.extract(extract_setting, process_rule_mode=process_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'
docker-api-1 logs:
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'
docker ps:
✔️ Expected Behavior
I vectorized the knowledge base file successfully.
❌ Actual Behavior
I failed to vectorize the knowledge base file.
The text was updated successfully, but these errors were encountered:
To resolve the "TypeError: Client.request() got an unexpected keyword argument 'stream'" error, ensure that the requests.request method is being called with the correct arguments. The error suggests that the stream argument is not expected in the context where it is being used.
In the Dify codebase, the make_request function in the ssrf_proxy.py file is responsible for handling HTTP requests. It uses the httpx.Client().request() method, which does not support the stream parameter. To fix this issue, you should remove the stream argument from the ssrf_proxy.get call or ensure that the httpx library version you are using supports this parameter.
Here's a brief guide to address the issue:
Check the httpx Library Version: Ensure that you are using a compatible version of the httpx library. You can update it using:
pip install --upgrade httpx
Modify the Code: If updating the library does not resolve the issue, you may need to modify the code to remove the stream parameter from the ssrf_proxy.get call in the word_extractor.py file.
By following these steps, you should be able to resolve the error and successfully vectorize the knowledge base file.
Self Checks
Dify version
0.11.2
Cloud or Self Hosted
Self Hosted (Docker)
Steps to reproduce
When I vectorize the knowledge base file
docker-worker-1 logs:
docker-api-1 logs:
docker ps:
✔️ Expected Behavior
I vectorized the knowledge base file successfully.
❌ Actual Behavior
I failed to vectorize the knowledge base file.
The text was updated successfully, but these errors were encountered: