[PR #11955] [MERGED] fix: Improve error handling in ChromaDB delete function for non-existent collections #38456

Closed
opened 2026-04-25 11:28:00 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/open-webui/open-webui/pull/11955
Author: @jfbloom22
Created: 3/22/2025
Status: Merged
Merged: 3/22/2025
Merged by: @tjbck

Base: devHead: dev


📝 Commits (1)

  • bdd236f improved error handling for deleting collections that do not exist in chromadb

📊 Changes

1 file changed (+11 additions, -6 deletions)

View changed files

📝 backend/open_webui/retrieval/vector/dbs/chroma.py (+11 -6)

📄 Description

Pull Request Checklist

Note to first-time contributors: Please open a discussion post in Discussions and describe your changes before submitting a pull request.

Before submitting, make sure you've checked the following:

  • Target branch: Please verify that the pull request targets the dev branch.
  • Description: Provide a concise description of the changes made in this pull request.
  • Changelog: Ensure a changelog entry following the format of Keep a Changelog is added at the bottom of the PR description.
  • Documentation: Have you updated relevant documentation Open WebUI Docs, or other documentation sources?
    No updates needed.
  • Dependencies: Are there any new dependencies? Have you updated the dependency versions in the documentation?
  • Testing: Have you written and run sufficient tests for validating the changes?
  • Code review: Have you performed a self-review of your code, addressing any coding standard issues and ensuring adherence to the project's coding standards?
  • Prefix: To cleary categorize this pull request, prefix the pull request title, using one of the following:
    • fix: Bug fix or error correction

Changelog Entry

Description

This PR improves error handling in the ChromaDB delete function to gracefully handle attempts to delete from non-existent collections. Previously, attempting to delete from a collection that doesn't exist would raise an exception, potentially disrupting application flow. Now, such attempts simply log a debug message and continue execution.

This addresses an issue described in this discussion, where users were experiencing exceptions when trying to delete from a collection that doesn't exist.

Added

  • Added debug logging when attempting to delete from non-existent collections

Changed

  • Enhanced error handling in ChromaDB's delete function with try/except block

Fixed

  • Fixed potential application disruption when attempting to delete from non-existent ChromaDB collections

Additional Information

This improvement makes the ChromaDB client more resilient by preventing exceptions when deleting from collections that don't exist. This is particularly useful in cleanup operations where the code may attempt to delete collections regardless of their existence status.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/open-webui/open-webui/pull/11955 **Author:** [@jfbloom22](https://github.com/jfbloom22) **Created:** 3/22/2025 **Status:** ✅ Merged **Merged:** 3/22/2025 **Merged by:** [@tjbck](https://github.com/tjbck) **Base:** `dev` ← **Head:** `dev` --- ### 📝 Commits (1) - [`bdd236f`](https://github.com/open-webui/open-webui/commit/bdd236fa3aa1efc038d2992a5a0f9a05e9a156ea) improved error handling for deleting collections that do not exist in chromadb ### 📊 Changes **1 file changed** (+11 additions, -6 deletions) <details> <summary>View changed files</summary> 📝 `backend/open_webui/retrieval/vector/dbs/chroma.py` (+11 -6) </details> ### 📄 Description # Pull Request Checklist ### Note to first-time contributors: Please open a discussion post in [Discussions](https://github.com/open-webui/open-webui/discussions) and describe your changes before submitting a pull request. **Before submitting, make sure you've checked the following:** - [x] **Target branch:** Please verify that the pull request targets the `dev` branch. - [x] **Description:** Provide a concise description of the changes made in this pull request. - [x] **Changelog:** Ensure a changelog entry following the format of [Keep a Changelog](https://keepachangelog.com/) is added at the bottom of the PR description. - [x] **Documentation:** Have you updated relevant documentation [Open WebUI Docs](https://github.com/open-webui/docs), or other documentation sources? No updates needed. - [x] **Dependencies:** Are there any new dependencies? Have you updated the dependency versions in the documentation? - [x] **Testing:** Have you written and run sufficient tests for validating the changes? - [x] **Code review:** Have you performed a self-review of your code, addressing any coding standard issues and ensuring adherence to the project's coding standards? - [x] **Prefix:** To cleary categorize this pull request, prefix the pull request title, using one of the following: - **fix**: Bug fix or error correction # Changelog Entry ### Description This PR improves error handling in the ChromaDB delete function to gracefully handle attempts to delete from non-existent collections. Previously, attempting to delete from a collection that doesn't exist would raise an exception, potentially disrupting application flow. Now, such attempts simply log a debug message and continue execution. This addresses an issue described in [this discussion](https://github.com/open-webui/open-webui/discussions/9860), where users were experiencing exceptions when trying to delete from a collection that doesn't exist. ### Added - Added debug logging when attempting to delete from non-existent collections ### Changed - Enhanced error handling in ChromaDB's delete function with try/except block ### Fixed - Fixed potential application disruption when attempting to delete from non-existent ChromaDB collections --- ### Additional Information This improvement makes the ChromaDB client more resilient by preventing exceptions when deleting from collections that don't exist. This is particularly useful in cleanup operations where the code may attempt to delete collections regardless of their existence status. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
GiteaMirror added the pull-request label 2026-04-25 11:28:00 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/open-webui#38456