mirror of
https://github.com/open-webui/open-webui.git
synced 2026-05-06 02:48:13 -05:00
[GH-ISSUE #20649] issue: IndicesClient.refresh() TypeError with opensearch-py >= 3.0.0 #57913
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @scy11a on GitHub (Jan 13, 2026).
Original GitHub issue: https://github.com/open-webui/open-webui/issues/20649
Check Existing Issues
Installation Method
Docker
Open WebUI Version
0.7.2
Ollama Version (if applicable)
No response
Operating System
Debian 12
Browser (if applicable)
No response
Confirmation
README.md.Expected Behavior
Document should be successfully add to a knowledge using OpenSearch database.
Actual Behavior
File upload fails with TypeError in save_docs_to_vector_db() function when VECTOR_DB_CLIENT.insert() is called. Because of this it is impossible to add a document to a knowledge with OpenSearch backend.
Steps to Reproduce
Logs & Screenshots
open-webui | 2026-01-13 19:15:13.436 | ERROR | open_webui.routers.retrieval:process_file:1792 - IndicesClient.refresh() takes 1 positional argument but 2 positional arguments (and 2 keyword-only arguments) were given
open-webui | Traceback (most recent call last):
open-webui |
open-webui | File "/usr/local/lib/python3.11/threading.py", line 1002, in _bootstrap
open-webui | self._bootstrap_inner()
open-webui | │ └ <function Thread._bootstrap_inner at 0x7633a17554e0>
open-webui | └ <WorkerThread(AnyIO worker thread, started 129962262644416)>
open-webui | File "/usr/local/lib/python3.11/threading.py", line 1045, in _bootstrap_inner
open-webui | self.run()
open-webui | │ └ <function WorkerThread.run at 0x763339d9da80>
open-webui | └ <WorkerThread(AnyIO worker thread, started 129962262644416)>
open-webui | File "/usr/local/lib/python3.11/site-packages/anyio/_backends/_asyncio.py", line 986, in run
open-webui | result = context.run(func, *args)
open-webui | │ │ │ └ ()
open-webui | │ │ └ functools.partial(<function process_uploaded_file at 0x76333d6ad9e0>, <starlette.requests.Request object at 0x7633302eee50>, ...
open-webui | │ └ <method 'run' of '_contextvars.Context' objects>
open-webui | └ <_contextvars.Context object at 0x76333059d180>
open-webui |
open-webui | File "/app/backend/open_webui/routers/files.py", line 189, in process_uploaded_file
open-webui | _process_handler(db_session)
open-webui | │ └ <sqlalchemy.orm.session.Session object at 0x763331cd1f10>
open-webui | └ <function process_uploaded_file.._process_handler at 0x763339e13a60>
open-webui |
open-webui | File "/app/backend/open_webui/routers/files.py", line 153, in _process_handler
open-webui | process_file(
open-webui | └ <function process_file at 0x76333d6ad260>
open-webui |
open-webui | > File "/app/backend/open_webui/routers/retrieval.py", line 1789, in process_file
open-webui | raise e
open-webui | └ TypeError('IndicesClient.refresh() takes 1 positional argument but 2 positional arguments (and 2 keyword-only arguments) were...
open-webui |
open-webui | File "/app/backend/open_webui/routers/retrieval.py", line 1750, in process_file
open-webui | result = save_docs_to_vector_db(
open-webui | └ <function save_docs_to_vector_db at 0x76333d6ad080>
open-webui |
open-webui | File "/app/backend/open_webui/routers/retrieval.py", line 1571, in save_docs_to_vector_db
open-webui | raise e
open-webui |
open-webui | File "/app/backend/open_webui/routers/retrieval.py", line 1562, in save_docs_to_vector_db
open-webui | VECTOR_DB_CLIENT.insert(
open-webui | │ └ <function OpenSearchClient.insert at 0x76336e674cc0>
open-webui | └ <open_webui.retrieval.vector.dbs.opensearch.OpenSearchClient object at 0x76336e8fdb90>
open-webui |
open-webui | File "/app/backend/open_webui/retrieval/vector/dbs/opensearch.py", line 214, in insert
open-webui | self.client.indices.refresh(self._get_index_name(collection_name))
open-webui | │ │ │ │ │ │ └ 'file-d6928264-f421-42b7-8fa3-df84dc3632fa'
open-webui | │ │ │ │ │ └ <function OpenSearchClient._get_index_name at 0x76336e6bf2e0>
open-webui | │ │ │ │ └ <open_webui.retrieval.vector.dbs.opensearch.OpenSearchClient object at 0x76336e8fdb90>
open-webui | │ │ │ └ <function IndicesClient.refresh at 0x76336e7aa340>
open-webui | │ │ └ <opensearchpy.client.indices.IndicesClient object at 0x76336e47c290>
open-webui | │ └ <OpenSearch([{'host': '10.111.111.63', 'port': 9200}])>
open-webui | └ <open_webui.retrieval.vector.dbs.opensearch.OpenSearchClient object at 0x76336e8fdb90>
open-webui |
open-webui | File "/usr/local/lib/python3.11/site-packages/opensearchpy/client/utils.py", line 176, in _wrapped
open-webui | return func(*args, params=params, headers=headers, **kwargs)
open-webui | │ │ │ │ └ {}
open-webui | │ │ │ └ {}
open-webui | │ │ └ {}
open-webui | │ └ (<opensearchpy.client.indices.IndicesClient object at 0x76336e47c290>, 'open_webui_file-d6928264-f421-42b7-8fa3-df84dc3632fa')
open-webui | └ <function IndicesClient.refresh at 0x76336e7aa2a0>
open-webui |
open-webui | TypeError: IndicesClient.refresh() takes 1 positional argument but 2 positional arguments (and 2 keyword-only arguments) were given
open-webui | 2026-01-13 19:15:13.445 | ERROR | open_webui.routers.files:_process_handler:175 - Error processing file: d6928264-f421-42b7-8fa3-df84dc3632fa
Additional Information
The probable Root Cause
In opensearch-py >= 3.0.0, the
IndicesClient.refresh()method signature changed to accept only keyword-only arguments. However, the code inopen_webui/retrieval/vector/dbs/opensearch.py(line 214) calls this method with a positional argument:Possible solution (after this modification I was able to upload a file):
Current (broken) code:
self.client.indices.refresh(self._get_index_name(collection_name))
Expected (working) code:
self.client.indices.refresh(index=self._get_index_name(collection_name))
@Classic298 commented on GitHub (Feb 10, 2026):
Pr merged