File upload broken specifically for .md files (.py works fine) #1884

Closed
opened 2025-11-11 14:55:37 -06:00 by GiteaMirror · 3 comments
Owner

Originally created by @1200bps on GitHub (Aug 25, 2024).

Bug Report

Installation Method

I installed Open WebUI on my VPS using Docker:

docker run -d -p 3000:8080 -v open-webui:/app/backend/data --name open-webui --restart always ghcr.io/open-webui/open-webui:main

Environment

  • Open WebUI Version: v0.3.15

  • Ollama (if applicable): N/A (using OpenRouter API)

  • Operating System: Ubuntu 24.04

  • Browser (if applicable): Firefox 129.0.2

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

Upon dragging and dropping a .md file into the browser, the file should be sent to the model with no error messages.

Actual Behavior:

Open WebUI throws an in-browser error, and the .md file isn't sent to the model for inference. Python source files are handled perfectly.

Description

Bug Summary:
Open WebUI is throwing errors saying that it can't find NLTK packages.

Reproduction Details

Steps to Reproduce:
Install Open WebUI normally, create an account etc., and drag-and-drop a .md file into a chat (new or existing, doesn't matter).

Logs and Screenshots

Browser Console Logs:
[Include relevant browser console logs, if applicable]

Docker Container Logs:

Loading WEBUI_SECRET_KEY from file, not provided as an environment variable.
  File "/usr/local/lib/python3.11/site-packages/unstructured/partition/html/parser.py", line 385, in _element_from_text_or_tail
    yield from element_accum.flush(ElementCls)
  File "/usr/local/lib/python3.11/site-packages/unstructured/partition/html/parser.py", line 253, in flush
    ElementCls = derive_element_type_from_text(normalized_text)
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/unstructured/partition/html/parser.py", line 885, in derive_element_type_from_text
    if is_possible_narrative_text(text):
       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/unstructured/partition/text_type.py", line 90, in is_possible_narrative_text
    if "eng" in languages and (sentence_count(text, 3) < 2) and (not contains_verb(text)):
                                                                     ^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/unstructured/partition/text_type.py", line 192, in contains_verb
    pos_tags = pos_tag(text)
               ^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/unstructured/nlp/tokenize.py", line 152, in pos_tag
    parts_of_speech.extend(_pos_tag(tokens))
                           ^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/nltk/tag/__init__.py", line 168, in pos_tag
    tagger = _get_tagger(lang)
             ^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/nltk/tag/__init__.py", line 110, in _get_tagger
    tagger = PerceptronTagger()
             ^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/nltk/tag/perceptron.py", line 183, in __init__
    self.load_from_json(lang)
  File "/usr/local/lib/python3.11/site-packages/nltk/tag/perceptron.py", line 273, in load_from_json
    loc = find(f"taggers/averaged_perceptron_tagger_{lang}/")
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/nltk/data.py", line 579, in find
    raise LookupError(resource_not_found)
LookupError:
**********************************************************************
  Resource averaged_perceptron_tagger_eng not found.
  Please use the NLTK Downloader to obtain the resource:

  >>> import nltk
  >>> nltk.download('averaged_perceptron_tagger_eng')

  For more information see: https://www.nltk.org/data.html

  Attempted to load taggers/averaged_perceptron_tagger_eng/

  Searched in:
    - '/root/nltk_data'
    - '/usr/local/nltk_data'
    - '/usr/local/share/nltk_data'
    - '/usr/local/lib/nltk_data'
    - '/usr/share/nltk_data'
    - '/usr/local/share/nltk_data'
    - '/usr/lib/nltk_data'
    - '/usr/local/lib/nltk_data'
**********************************************************************

Screenshots/Screen Recordings (if applicable):

Something went wrong :/ ********************************************************************** Resource punkt_tab not found. Please use the NLTK Downloader to obtain the resource: >>> import nltk >>> nltk.download('punkt_tab')  For more information see: https://www.nltk.org/data.html Attempted to load tokenizers/punkt_tab/english/ Searched in: - '/root/nltk_data' - '/usr/local/nltk_data' - '/usr/local/share/nltk_data' - '/usr/local/lib/nltk_data' - '/usr/share/nltk_data' - '/usr/local/share/nltk_data' - '/usr/lib/nltk_data' - '/usr/local/lib/nltk_data' **********************************************************************

Additional Information

I tried installing the relevant packages (punkt, punkt_tab, averaged_perceptron_tagger_eng) and modifying the docker run command to add -v /usr/local/nltk_data:/root/nltk_data, which fixed the error related to punkt but caused a new/similar error related to averaged_perceptron_tagger_eng.

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 @1200bps on GitHub (Aug 25, 2024). # Bug Report ## Installation Method I installed Open WebUI on my VPS using Docker: ``` docker run -d -p 3000:8080 -v open-webui:/app/backend/data --name open-webui --restart always ghcr.io/open-webui/open-webui:main ``` ## Environment - **Open WebUI Version:** v0.3.15 - **Ollama (if applicable):** N/A (using OpenRouter API) - **Operating System:** Ubuntu 24.04 - **Browser (if applicable):** Firefox 129.0.2 **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. - [ ] 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: Upon dragging and dropping a .md file into the browser, the file should be sent to the model with no error messages. ## Actual Behavior: Open WebUI throws an in-browser error, and the .md file isn't sent to the model for inference. Python source files are handled perfectly. ## Description **Bug Summary:** Open WebUI is throwing errors saying that it can't find NLTK packages. ## Reproduction Details **Steps to Reproduce:** Install Open WebUI normally, create an account etc., and drag-and-drop a .md file into a chat (new or existing, doesn't matter). ## Logs and Screenshots **Browser Console Logs:** [Include relevant browser console logs, if applicable] **Docker Container Logs:** ``` Loading WEBUI_SECRET_KEY from file, not provided as an environment variable. File "/usr/local/lib/python3.11/site-packages/unstructured/partition/html/parser.py", line 385, in _element_from_text_or_tail yield from element_accum.flush(ElementCls) File "/usr/local/lib/python3.11/site-packages/unstructured/partition/html/parser.py", line 253, in flush ElementCls = derive_element_type_from_text(normalized_text) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/site-packages/unstructured/partition/html/parser.py", line 885, in derive_element_type_from_text if is_possible_narrative_text(text): ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/site-packages/unstructured/partition/text_type.py", line 90, in is_possible_narrative_text if "eng" in languages and (sentence_count(text, 3) < 2) and (not contains_verb(text)): ^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/site-packages/unstructured/partition/text_type.py", line 192, in contains_verb pos_tags = pos_tag(text) ^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/site-packages/unstructured/nlp/tokenize.py", line 152, in pos_tag parts_of_speech.extend(_pos_tag(tokens)) ^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/site-packages/nltk/tag/__init__.py", line 168, in pos_tag tagger = _get_tagger(lang) ^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/site-packages/nltk/tag/__init__.py", line 110, in _get_tagger tagger = PerceptronTagger() ^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/site-packages/nltk/tag/perceptron.py", line 183, in __init__ self.load_from_json(lang) File "/usr/local/lib/python3.11/site-packages/nltk/tag/perceptron.py", line 273, in load_from_json loc = find(f"taggers/averaged_perceptron_tagger_{lang}/") ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/site-packages/nltk/data.py", line 579, in find raise LookupError(resource_not_found) LookupError: ********************************************************************** Resource averaged_perceptron_tagger_eng not found. Please use the NLTK Downloader to obtain the resource: >>> import nltk >>> nltk.download('averaged_perceptron_tagger_eng') For more information see: https://www.nltk.org/data.html Attempted to load taggers/averaged_perceptron_tagger_eng/ Searched in: - '/root/nltk_data' - '/usr/local/nltk_data' - '/usr/local/share/nltk_data' - '/usr/local/lib/nltk_data' - '/usr/share/nltk_data' - '/usr/local/share/nltk_data' - '/usr/lib/nltk_data' - '/usr/local/lib/nltk_data' ********************************************************************** ``` **Screenshots/Screen Recordings (if applicable):** ``` Something went wrong :/ ********************************************************************** Resource punkt_tab not found. Please use the NLTK Downloader to obtain the resource: >>> import nltk >>> nltk.download('punkt_tab')  For more information see: https://www.nltk.org/data.html Attempted to load tokenizers/punkt_tab/english/ Searched in: - '/root/nltk_data' - '/usr/local/nltk_data' - '/usr/local/share/nltk_data' - '/usr/local/lib/nltk_data' - '/usr/share/nltk_data' - '/usr/local/share/nltk_data' - '/usr/lib/nltk_data' - '/usr/local/lib/nltk_data' ********************************************************************** ``` ## Additional Information I tried installing the relevant packages (punkt, punkt_tab, averaged_perceptron_tagger_eng) and modifying the docker run command to add `-v /usr/local/nltk_data:/root/nltk_data`, which fixed the error related to punkt but caused a new/similar error related to averaged_perceptron_tagger_eng. ## 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!
Author
Owner

@1200bps commented on GitHub (Aug 25, 2024):

(I've never submitted an issue to a project before, so let me know if more detail is needed or if I missed anything!)

@1200bps commented on GitHub (Aug 25, 2024): (I've never submitted an issue to a project before, so let me know if more detail is needed or if I missed anything!)
Author
Owner

@tjbck commented on GitHub (Aug 26, 2024):

Should be fixed on dev, testing wanted here!

@tjbck commented on GitHub (Aug 26, 2024): Should be fixed on dev, testing wanted here!
Author
Owner

@jbants commented on GitHub (Aug 26, 2024):

I was running into this issue on main.

I'm using docker-compose and dev is working with .md documents uploaded to a workspace.

 ollama-webui:
    image: ghcr.io/open-webui/open-webui:dev
    container_name: ollama-webui
    volumes:
      - ./ollama/ollama-webui:/app/backend/data
    depends_on:
      - ollama-server
    ports:
      - 8080:8080
@jbants commented on GitHub (Aug 26, 2024): I was running into this issue on `main`. I'm using docker-compose and `dev` is working with `.md` documents uploaded to a workspace. ``` ollama-webui: image: ghcr.io/open-webui/open-webui:dev container_name: ollama-webui volumes: - ./ollama/ollama-webui:/app/backend/data depends_on: - ollama-server ports: - 8080:8080
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/open-webui#1884