OpenSearchClient doesn't have a query method implemented #3570

Closed
opened 2025-11-11 15:34:06 -06:00 by GiteaMirror · 0 comments
Owner

Originally created by @vinsdragonis on GitHub (Feb 4, 2025).

Bug Report

Important Notes

  • Before submitting a bug report: Please check the Issues or Discussions section to see if a similar issue or feature request has already been posted. It's likely we're already tracking it! If you’re unsure, start a discussion post first. This will help us efficiently focus on improving the project.

  • Collaborate respectfully: We value a constructive attitude, so please be mindful of your communication. If negativity is part of your approach, our capacity to engage may be limited. We’re here to help if you’re open to learning and communicating positively. Remember, Open WebUI is a volunteer-driven project managed by a single maintainer and supported by contributors who also have full-time jobs. We appreciate your time and ask that you respect ours.

  • Contributing: If you encounter an issue, we highly encourage you to submit a pull request or fork the project. We actively work to prevent contributor burnout to maintain the quality and continuity of Open WebUI.

  • Bug reproducibility: If a bug cannot be reproduced with a :main or :dev Docker setup, or a pip install with Python 3.11, it may require additional help from the community. In such cases, we will move it to the "issues" Discussions section due to our limited resources. We encourage the community to assist with these issues. Remember, it’s not that the issue doesn’t exist; we need your help!

Note: Please remove the notes above when submitting your post. Thank you for your understanding and support!


Installation Method

Docker pull, docker run

Environment

  • Open WebUI Version: 0.5.4

  • Ollama (if applicable): 0.4.5

  • Operating System: Windows 10

  • Browser (if applicable): Chrome 100.0

Confirmation:

  • I have read and followed all the instructions provided in the README.md.
  • I am on the latest Open WebUI and Ollama version.
  • I have included the browser console logs.
  • I have included the Docker container logs.
  • I have provided the exact steps to reproduce the bug in the "Steps to Reproduce" section below.

Expected Behavior:

When adding files to a collection (index, in this case), vector embeddings should be generated, and data needs to be inserted in the chosen vector db.

Actual Behavior:

OpenSearch is chosen in this particular case. When uploading files, an error occurs stating that the 'OpenSeachClient' object has no attribute 'query'.

Description

Bug Summary:
This bug prevents the user from uploading vectors to OpenSearch.

Reproduction Details

Steps to Reproduce:

  1. Install and setup Open-WebUI as a docker container with the required env variables VECTOR_DB, OPENSEARCH_URI, OPENSEARCH_USERNAME, and OPENSEARCH_PASSWORD
  2. Create an account and go to the default page in Open-WebUI
  3. Upload any file.
  4. This file is successfully uploaded to the data folder in Open-WebUI's /backend/data/ folder
  5. The issue arises when the generated embeddings are to be sent to OpenSearch, which is running and active
  6. An error shows up saying "'OpenSeachClient' object has no attribute 'query'"

Logs and Screenshots

Browser Console Logs:
Error 400 :
{
"detail": "400: 'OpenSearchClient' object has no attribute 'query'"
}

Docker Container Logs:
INFO [open_webui.routers.retrieval] save_docs_to_vector_db: document XXXXXXXX-0c90d78c-8c05-4132-a656-a543c7288581
ERROR [open_webui.routers.retrieval] 'OpenSearchClient' object has no attribute 'query'
Traceback (most recent call last):
File "/app/backend/open_webui/routers/retrieval.py", line 953, in process_file
raise e
File "/app/backend/open_webui/routers/retrieval.py", line 926, in process_file
result = save_docs_to_vector_db(
^^^^^^^^^^^^^^^^^^^^^^^
File "/app/backend/open_webui/routers/retrieval.py", line 686, in save_docs_to_vector_db
result = VECTOR_DB_CLIENT.query(
^^^^^^^^^^^^^^^^^^^^^^
AttributeError: 'OpenSearchClient' object has no attribute 'query'
ERROR [open_webui.routers.files] 400: 'OpenSearchClient' object has no attribute 'query'
Traceback (most recent call last):
File "/app/backend/open_webui/routers/retrieval.py", line 953, in process_file
raise e
File "/app/backend/open_webui/routers/retrieval.py", line 926, in process_file
result = save_docs_to_vector_db(
^^^^^^^^^^^^^^^^^^^^^^^
File "/app/backend/open_webui/routers/retrieval.py", line 686, in save_docs_to_vector_db
result = VECTOR_DB_CLIENT.query(
^^^^^^^^^^^^^^^^^^^^^^
AttributeError: 'OpenSearchClient' object has no attribute 'query'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/app/backend/open_webui/routers/files.py", line 74, in upload_file
process_file(request, ProcessFileForm(file_id=id))
File "/app/backend/open_webui/routers/retrieval.py", line 962, in process_file
raise HTTPException(
fastapi.exceptions.HTTPException: 400: 'OpenSearchClient' object has no attribute 'query'
ERROR [open_webui.routers.files] Error processing file: 0c90d78c-8c05-4132-a656-a543c7288581
INFO: 158.255.116.146:0 - "POST /api/v1/files/ HTTP/1.1" 200 OK
ERROR [open_webui.routers.retrieval] 'OpenSearchClient' object has no attribute 'query'
Traceback (most recent call last):
File "/app/backend/open_webui/routers/retrieval.py", line 846, in process_file
result = VECTOR_DB_CLIENT.query(
^^^^^^^^^^^^^^^^^^^^^^
AttributeError: 'OpenSearchClient' object has no attribute 'query'
INFO: 158.255.116.146:0 - "POST /api/v1/knowledge/1a1c6ad0-aa9a-497d-aa2b-7c07737fc5bd/file/add HTTP/1.1" 400 Bad Request

Screenshots/Screen Recordings (if applicable):
[Attach any relevant screenshots to help illustrate the issue]

Additional Information

Based on a brief analysis, this is primarily caused by the query() method not being implemented in backend/open_webui/retrieval/vector/dbs/opensearch.py.

Note

If the bug report is incomplete or does not follow the provided instructions, it may not be addressed. Please ensure that you have followed the steps outlined in the README.md and troubleshooting.md documents, and provide all necessary information for us to reproduce and address the issue. Thank you!

Originally created by @vinsdragonis on GitHub (Feb 4, 2025). # Bug Report ## Important Notes - **Before submitting a bug report**: Please check the Issues or Discussions section to see if a similar issue or feature request has already been posted. It's likely we're already tracking it! If you’re unsure, start a discussion post first. This will help us efficiently focus on improving the project. - **Collaborate respectfully**: We value a constructive attitude, so please be mindful of your communication. If negativity is part of your approach, our capacity to engage may be limited. We’re here to help if you’re open to learning and communicating positively. Remember, Open WebUI is a volunteer-driven project managed by a single maintainer and supported by contributors who also have full-time jobs. We appreciate your time and ask that you respect ours. - **Contributing**: If you encounter an issue, we highly encourage you to submit a pull request or fork the project. We actively work to prevent contributor burnout to maintain the quality and continuity of Open WebUI. - **Bug reproducibility**: If a bug cannot be reproduced with a `:main` or `:dev` Docker setup, or a pip install with Python 3.11, it may require additional help from the community. In such cases, we will move it to the "issues" Discussions section due to our limited resources. We encourage the community to assist with these issues. Remember, it’s not that the issue doesn’t exist; we need your help! Note: Please remove the notes above when submitting your post. Thank you for your understanding and support! --- ## Installation Method Docker pull, docker run ## Environment - **Open WebUI Version:** 0.5.4 - **Ollama (if applicable):** 0.4.5 - **Operating System:** Windows 10 - **Browser (if applicable):** Chrome 100.0 **Confirmation:** - [x] I have read and followed all the instructions provided in the README.md. - [x] I am on the latest Open WebUI and Ollama version. - [x] I have included the browser console logs. - [x] I have included the Docker container logs. - [x] I have provided the exact steps to reproduce the bug in the "Steps to Reproduce" section below. ## Expected Behavior: When adding files to a collection (index, in this case), vector embeddings should be generated, and data needs to be inserted in the chosen vector db. ## Actual Behavior: OpenSearch is chosen in this particular case. When uploading files, an error occurs stating that the 'OpenSeachClient' object has no attribute 'query'. ## Description **Bug Summary:** This bug prevents the user from uploading vectors to OpenSearch. ## Reproduction Details **Steps to Reproduce:** 1. Install and setup Open-WebUI as a docker container with the required env variables `VECTOR_DB`, `OPENSEARCH_URI`, `OPENSEARCH_USERNAME`, and `OPENSEARCH_PASSWORD` 2. Create an account and go to the default page in Open-WebUI 3. Upload any file. 4. This file is successfully uploaded to the `data` folder in Open-WebUI's `/backend/data/` folder 5. The issue arises when the generated embeddings are to be sent to OpenSearch, which is running and active 6. An error shows up saying **"'OpenSeachClient' object has no attribute 'query'"** ## Logs and Screenshots **Browser Console Logs:** Error 400 : { "detail": "400: 'OpenSearchClient' object has no attribute 'query'" } **Docker Container Logs:** INFO [open_webui.routers.retrieval] save_docs_to_vector_db: document XXXXXXXX-0c90d78c-8c05-4132-a656-a543c7288581 ERROR [open_webui.routers.retrieval] 'OpenSearchClient' object has no attribute 'query' Traceback (most recent call last): File "/app/backend/open_webui/routers/retrieval.py", line 953, in process_file raise e File "/app/backend/open_webui/routers/retrieval.py", line 926, in process_file result = save_docs_to_vector_db( ^^^^^^^^^^^^^^^^^^^^^^^ File "/app/backend/open_webui/routers/retrieval.py", line 686, in save_docs_to_vector_db result = VECTOR_DB_CLIENT.query( ^^^^^^^^^^^^^^^^^^^^^^ AttributeError: 'OpenSearchClient' object has no attribute 'query' ERROR [open_webui.routers.files] 400: 'OpenSearchClient' object has no attribute 'query' Traceback (most recent call last): File "/app/backend/open_webui/routers/retrieval.py", line 953, in process_file raise e File "/app/backend/open_webui/routers/retrieval.py", line 926, in process_file result = save_docs_to_vector_db( ^^^^^^^^^^^^^^^^^^^^^^^ File "/app/backend/open_webui/routers/retrieval.py", line 686, in save_docs_to_vector_db result = VECTOR_DB_CLIENT.query( ^^^^^^^^^^^^^^^^^^^^^^ AttributeError: 'OpenSearchClient' object has no attribute 'query' During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/app/backend/open_webui/routers/files.py", line 74, in upload_file process_file(request, ProcessFileForm(file_id=id)) File "/app/backend/open_webui/routers/retrieval.py", line 962, in process_file raise HTTPException( fastapi.exceptions.HTTPException: 400: 'OpenSearchClient' object has no attribute 'query' ERROR [open_webui.routers.files] Error processing file: 0c90d78c-8c05-4132-a656-a543c7288581 INFO: 158.255.116.146:0 - "POST /api/v1/files/ HTTP/1.1" 200 OK ERROR [open_webui.routers.retrieval] 'OpenSearchClient' object has no attribute 'query' Traceback (most recent call last): File "/app/backend/open_webui/routers/retrieval.py", line 846, in process_file result = VECTOR_DB_CLIENT.query( ^^^^^^^^^^^^^^^^^^^^^^ AttributeError: 'OpenSearchClient' object has no attribute 'query' INFO: 158.255.116.146:0 - "POST /api/v1/knowledge/1a1c6ad0-aa9a-497d-aa2b-7c07737fc5bd/file/add HTTP/1.1" 400 Bad Request **Screenshots/Screen Recordings (if applicable):** [Attach any relevant screenshots to help illustrate the issue] ## Additional Information Based on a brief analysis, this is primarily caused by the `query()` method not being implemented in `backend/open_webui/retrieval/vector/dbs/opensearch.py`. ## Note If the bug report is incomplete or does not follow the provided instructions, it may not be addressed. Please ensure that you have followed the steps outlined in the README.md and troubleshooting.md documents, and provide all necessary information for us to reproduce and address the issue. Thank you!
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/open-webui#3570