Exception when I try to upload CSV file #1362

Closed
opened 2025-11-11 14:43:39 -06:00 by GiteaMirror · 0 comments
Owner

Originally created by @krikz on GitHub (Jun 24, 2024).

Bug Report

Description

Exception when I try to upload CSV file

Bug Summary:
I cannot load CSV file
UnicodeDecodeError: 'utf-8' codec can't decode byte 0xff in position 0: invalid start byte

Example of CSV file content:
ID Name Designator Footprint Quantity Manufacturer Part Manufacturer Supplier Supplier Part Price
"3" "600-518S-250" "U1,U2" "KEY-SMD_DB5.0" "2" "600-518S-250" "HYP(鸿源精密)" "LCSC" "C256265" "0.004"

Steps to Reproduce:
[Outline the steps to reproduce the bug. Be as detailed as possible.]

Expected Behavior:
[Describe what you expected to happen.]

Actual Behavior:
[Describe what actually happened.]

Environment

  • Open WebUI Version: [e.g., 0.1.120]

  • Ollama (if applicable): [e.g., 0.1.30, 0.1.32-rc1]

  • Operating System: manjaro-kde-24.0.2-240611-linux69

  • Browser (if applicable): Firefox 98.0

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 browser console logs.
  • I have included the Docker container logs.

Logs and Screenshots

INFO: 192.168.1.103:62473 - "POST /rag/api/v1/doc HTTP/1.1" 400 Bad Request
ERROR:apps.rag.main:Error loading /app/backend/data/uploads/
Traceback (most recent call last):
File "/usr/local/lib/python3.11/site-packages/langchain_community/document_loaders/csv_loader.py", line 68, in lazy_load
yield from self.__read_file(csvfile)
File "/usr/local/lib/python3.11/site-packages/langchain_community/document_loaders/csv_loader.py", line 88, in __read_file
for i, row in enumerate(csv_reader):
File "/usr/local/lib/python3.11/csv.py", line 110, in next
self.fieldnames
File "/usr/local/lib/python3.11/csv.py", line 97, in fieldnames
self._fieldnames = next(self.reader)
^^^^^^^^^^^^^^^^^
File "", line 322, in decode
UnicodeDecodeError: 'utf-8' codec can't decode byte 0xff in position 0: invalid start byte

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
File "/app/backend/apps/rag/main.py", line 1091, in store_doc
data = loader.load()
^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/langchain_core/document_loaders/base.py", line 29, in load
return list(self.lazy_load())
^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/langchain_community/document_loaders/csv_loader.py", line 82, in lazy_load
raise RuntimeError(f"Error loading {self.file_path}") from e

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

Docker Container Logs:
[Include relevant Docker container logs, if applicable]

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

Installation Method

[Describe the method you used to install the project, e.g., manual installation, Docker, package manager, etc.]

Additional Information

[Include any additional details that may help in understanding and reproducing the issue. This could include specific configurations, error messages, or anything else relevant to the bug.]

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 @krikz on GitHub (Jun 24, 2024). # Bug Report ## Description Exception when I try to upload CSV file **Bug Summary:** I cannot load CSV file UnicodeDecodeError: 'utf-8' codec can't decode byte 0xff in position 0: invalid start byte Example of CSV file content: ID Name Designator Footprint Quantity Manufacturer Part Manufacturer Supplier Supplier Part Price "3" "600-518S-250" "U1,U2" "KEY-SMD_DB5.0" "2" "600-518S-250" "HYP(鸿源精密)" "LCSC" "C256265" "0.004" **Steps to Reproduce:** [Outline the steps to reproduce the bug. Be as detailed as possible.] **Expected Behavior:** [Describe what you expected to happen.] **Actual Behavior:** [Describe what actually happened.] ## Environment - **Open WebUI Version:** [e.g., 0.1.120] - **Ollama (if applicable):** [e.g., 0.1.30, 0.1.32-rc1] - **Operating System:** manjaro-kde-24.0.2-240611-linux69 - **Browser (if applicable):** Firefox 98.0 ## 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 browser console logs. - [ ] I have included the Docker container logs. ## Logs and Screenshots INFO: 192.168.1.103:62473 - "POST /rag/api/v1/doc HTTP/1.1" 400 Bad Request ERROR:apps.rag.main:Error loading /app/backend/data/uploads/ Traceback (most recent call last): File "/usr/local/lib/python3.11/site-packages/langchain_community/document_loaders/csv_loader.py", line 68, in lazy_load yield from self.__read_file(csvfile) File "/usr/local/lib/python3.11/site-packages/langchain_community/document_loaders/csv_loader.py", line 88, in __read_file for i, row in enumerate(csv_reader): File "/usr/local/lib/python3.11/csv.py", line 110, in __next__ self.fieldnames File "/usr/local/lib/python3.11/csv.py", line 97, in fieldnames self._fieldnames = next(self.reader) ^^^^^^^^^^^^^^^^^ File "<frozen codecs>", line 322, in decode UnicodeDecodeError: 'utf-8' codec can't decode byte 0xff in position 0: invalid start byte The above exception was the direct cause of the following exception: Traceback (most recent call last): File "/app/backend/apps/rag/main.py", line 1091, in store_doc data = loader.load() ^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/site-packages/langchain_core/document_loaders/base.py", line 29, in load return list(self.lazy_load()) ^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/site-packages/langchain_community/document_loaders/csv_loader.py", line 82, in lazy_load raise RuntimeError(f"Error loading {self.file_path}") from e **Browser Console Logs:** [Include relevant browser console logs, if applicable] **Docker Container Logs:** [Include relevant Docker container logs, if applicable] **Screenshots (if applicable):** [Attach any relevant screenshots to help illustrate the issue] ## Installation Method [Describe the method you used to install the project, e.g., manual installation, Docker, package manager, etc.] ## Additional Information [Include any additional details that may help in understanding and reproducing the issue. This could include specific configurations, error messages, or anything else relevant to the bug.] ## 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#1362