[GH-ISSUE #3680] Back-end error when uploading the same document twice in two conversations #13346

Closed
opened 2026-04-19 20:06:42 -05:00 by GiteaMirror · 4 comments
Owner

Originally created by @leobenkel on GitHub (Jul 6, 2024).
Original GitHub issue: https://github.com/open-webui/open-webui/issues/3680

Bug Report

Description

Bug Summary:

Error are showing up in the log when the same document is uploaded twice.

Steps to Reproduce:

  1. open a conversation, drop a document, as a question
  2. open a different conversation, drop the same document, look at back end log.

Expected Behavior:

Would identify that this document as already been vectorized and stored and reuse the cache. Maybe have a hash of (the doc content + modified date + name) as collection name ?

Actual Behavior:

It seems to be working, but i see errors in the back-end log.

Environment

all latest
firefox

Reproduction Details

Confirmation:

  • I have read and followed all the instructions provided in the README.md.
  • I am on the latest version of both Open WebUI and Ollama.
  • I have included the Docker container logs.

Logs and Screenshots

Docker Container Logs:

ERROR:apps.rag.main:Collection 0509bce7e32b04c3892a9f838867309b3000d9f323673549489899b60021bfd already exists
Traceback (most recent call last):
  File "/app/./src/apps/rag/main.py", line 956, in store_docs_in_vector_db
    collection = CHROMA_CLIENT.create_collection(name=collection_name)
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/root/.local/lib/python3.11/site-packages/chromadb/api/client.py", line 112, in create_collection
    return self._server.create_collection(
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/root/.local/lib/python3.11/site-packages/chromadb/telemetry/opentelemetry/__init__.py", line 146, in wrapper
    return f(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^
  File "/root/.local/lib/python3.11/site-packages/chromadb/api/segment.py", line 171, in create_collection
    coll, created = self._sysdb.create_collection(
                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/root/.local/lib/python3.11/site-packages/chromadb/telemetry/opentelemetry/__init__.py", line 146, in wrapper
    return f(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^
  File "/root/.local/lib/python3.11/site-packages/chromadb/db/mixins/sysdb.py", line 220, in create_collection
    raise UniqueConstraintError(f"Collection {name} already exists")
Originally created by @leobenkel on GitHub (Jul 6, 2024). Original GitHub issue: https://github.com/open-webui/open-webui/issues/3680 # Bug Report ## Description **Bug Summary:** Error are showing up in the log when the same document is uploaded twice. **Steps to Reproduce:** 1. open a conversation, drop a document, as a question 2. open a different conversation, drop the same document, look at back end log. **Expected Behavior:** Would identify that this document as already been vectorized and stored and reuse the cache. Maybe have a hash of (the doc content + modified date + name) as collection name ? **Actual Behavior:** It seems to be working, but i see errors in the back-end log. ## Environment all latest firefox ## Reproduction Details **Confirmation:** - [x] I have read and followed all the instructions provided in the README.md. - [x] I am on the latest version of both Open WebUI and Ollama. - [x] I have included the Docker container logs. ## Logs and Screenshots **Docker Container Logs:** ``` ERROR:apps.rag.main:Collection 0509bce7e32b04c3892a9f838867309b3000d9f323673549489899b60021bfd already exists Traceback (most recent call last): File "/app/./src/apps/rag/main.py", line 956, in store_docs_in_vector_db collection = CHROMA_CLIENT.create_collection(name=collection_name) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/root/.local/lib/python3.11/site-packages/chromadb/api/client.py", line 112, in create_collection return self._server.create_collection( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/root/.local/lib/python3.11/site-packages/chromadb/telemetry/opentelemetry/__init__.py", line 146, in wrapper return f(*args, **kwargs) ^^^^^^^^^^^^^^^^^^ File "/root/.local/lib/python3.11/site-packages/chromadb/api/segment.py", line 171, in create_collection coll, created = self._sysdb.create_collection( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/root/.local/lib/python3.11/site-packages/chromadb/telemetry/opentelemetry/__init__.py", line 146, in wrapper return f(*args, **kwargs) ^^^^^^^^^^^^^^^^^^ File "/root/.local/lib/python3.11/site-packages/chromadb/db/mixins/sysdb.py", line 220, in create_collection raise UniqueConstraintError(f"Collection {name} already exists") ```
Author
Owner

@tjbck commented on GitHub (Jul 6, 2024):

This is just for logging purposes! Everything should work as intended.

<!-- gh-comment-id:2211847144 --> @tjbck commented on GitHub (Jul 6, 2024): This is just for logging purposes! Everything should work as intended.
Author
Owner

@leobenkel commented on GitHub (Jul 6, 2024):

ok, maybe not printing the stack trace would be nicer?

<!-- gh-comment-id:2211888823 --> @leobenkel commented on GitHub (Jul 6, 2024): ok, maybe not printing the stack trace would be nicer?
Author
Owner

@tjbck commented on GitHub (Jul 6, 2024):

Feel free to make a PR!

<!-- gh-comment-id:2211928806 --> @tjbck commented on GitHub (Jul 6, 2024): Feel free to make a PR!
Author
Owner

@leobenkel commented on GitHub (Jul 6, 2024):

@tjbck done

<!-- gh-comment-id:2211973098 --> @leobenkel commented on GitHub (Jul 6, 2024): @tjbck done
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/open-webui#13346