Lokal RAG - The content provided is empty #4173

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

Originally created by @Napoletron on GitHub (Feb 27, 2025).

Bug Report

When fetching a document locally via RAG and ENABLE_RAG_LOCAL_WEB_FETCH is set to False the exception is swallowed in the end of the function safe_validate_urls in the file backend/open_webui/retrieval/web/utils.py.
This makes it very frustrating to search for the bug:

If onyl lokal URLs are fetched with a model, there is no data to be added to the database leading to the error:
ERROR [open_webui.routers.retrieval] The content provided is empty. Please ensure that there is text or data present before proceeding.

A log message cann be added by adding a log.warning(...)

def safe_validate_urls(url: Sequence[str]) -> Sequence[str]:
    valid_urls = []
    for u in url:
        try:
            if validate_url(u):
                valid_urls.append(u)
        except ValueError **as e:
            log.warning(f"URL \'{url}\' was not valid: {str(e)}")**
            continue
    return valid_urls

The problem with the local URLs can be solved by setting ENABLE_RAG_LOCAL_WEB_FETCH to True in the environment variables.

Would be nice if a contributer made the simple fix.
Also I hope this message helps bug report helps others :)


Installation Method

apt install open-webui
but also via
git pull open-webui

Environment

  • Open WebUI Version: v0.5.17

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 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:

Should fetch local doc via RAG

Actual Behavior:

Throws error The content provided is empty. Please ensure that there is text or data present before proceeding

Originally created by @Napoletron on GitHub (Feb 27, 2025). # Bug Report When fetching a document locally via RAG and `ENABLE_RAG_LOCAL_WEB_FETCH `is set to `False` the exception is swallowed in the end of the function `safe_validate_urls` in the file `backend/open_webui/retrieval/web/utils.py`. This makes it very frustrating to search for the bug: If onyl lokal URLs are fetched with a model, there is no data to be added to the database leading to the error: `ERROR [open_webui.routers.retrieval] The content provided is empty. Please ensure that there is text or data present before proceeding.` A log message cann be added by adding a log.warning(...) ``` def safe_validate_urls(url: Sequence[str]) -> Sequence[str]: valid_urls = [] for u in url: try: if validate_url(u): valid_urls.append(u) except ValueError **as e: log.warning(f"URL \'{url}\' was not valid: {str(e)}")** continue return valid_urls ``` The problem with the local URLs can be solved by setting `ENABLE_RAG_LOCAL_WEB_FETCH ` to `True` in the environment variables. Would be nice if a contributer made the simple fix. Also I hope this message helps bug report helps others :) --- ## Installation Method `apt install open-webui` but also via `git pull open-webui` ## Environment - **Open WebUI Version:** v0.5.17 **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 browser console logs. - [ ] 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: Should fetch local doc via RAG ## Actual Behavior: Throws error _The content provided is empty. Please ensure that there is text or data present before proceeding_
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/open-webui#4173