PDF upload fails if images present #2118

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

Originally created by @danpicton on GitHub (Sep 19, 2024).

Bug Report

Installation Method

podman-compose.yml

services:
  open-webui:
    image: ghcr.io/open-webui/open-webui:${WEBUI_DOCKER_TAG-main}
    container_name: open-webui
    volumes:
      - ./open-webui:/app/backend/data
    ports:
      - ${OPEN_WEBUI_PORT-5000}:8080
    environment:
      - 'OLLAMA_BASE_URL=http://192.168.0.123:11434'
      - 'WEBUI_SECRET_KEY=zzz'
    extra_hosts:
      - host.docker.internal:127.0.0.1
    restart: unless-stopped

.env

# Ollama URL for the backend to connect
# The path '/ollama' will be redirected to the specified backend URL
OLLAMA_BASE_URL='http://192.168.0.123:11434'

OPENAI_API_BASE_URL='https://api.openai.com/v1'
OPENAI_API_KEY='xxx'

# AUTOMATIC1111_BASE_URL="http://localhost:7860"

# DO NOT TRACK
SCARF_NO_ANALYTICS=true
DO_NOT_TRACK=true
ANONYMIZED_TELEMETRY=false


WEBUI_DOCKER_TAG=latest

Environment

  • Open WebUI Version: v0.3.13, v0.3.20 tested

  • Ollama (if applicable): n/a

  • Operating System: Debian 12.7

  • Browser (if applicable): Brave (Version 1.69.168 Chromium: 128.0.6613.138 (Official Build) unknown (64-bit))

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:

PDFs containing images upload/embed for querying.

Actual Behavior:

Persistent "in progress" indicator; unable to query.

Description

Bug Summary:

During PDF upload, if the PDF contains an image, the upload fails to complete. PDFs without images fail to load.

The issue persists even if I rename the PDF as suggested in a number of other similar issues.

Reproduction Details

Use sample PDF here: https://www.learningcontainer.com/download/sample-pdf-with-images/

Non-image PDF also used to confirm standard functionality: https://www.learningcontainer.com/download/sample-pdf-file-for-testing/

Steps to Reproduce:

  1. Upload test PDF
  2. Observe failure

Logs and Screenshots

Browser Console Logs:

image

 'pdf'
MessageInput.svelte:94 FilelastModified: 1726736394003lastModifiedDate: Thu Sep 19 2024 09:59:54 GMT+0100 (British Summer Time) {}name: "sample-pdf-with-images.pdf"size: 3976877type: "application/pdf"webkitRelativePath: ""[[Prototype]]: FilelastModified: (...)lastModifiedDate: (...)name: (...)webkitRelativePath: (...)constructor: ƒ File()Symbol(Symbol.toStringTag): "File"size: (...)type: (...)get lastModified: ƒ lastModified()get lastModifiedDate: ƒ lastModifiedDate()get name: ƒ name()get webkitRelativePath: ƒ webkitRelativePath()[[Prototype]]: Blob
index.ts:22 SyntaxError: Unexpected token '<', "<html>
<h"... is not valid JSON

Docker Container Logs:

None relevant.

Screenshots/Screen Recordings (if applicable):

This persists indefinitely:

Screencast from 2024-09-19 10-27-08.webm

Additional Information

Default model is gpt-4o-mini, embedding model is OpenAI's text-embedding-3-small. I have also tested with the default sentence-transformers/all-MiniLM-L6-v2 model, but hit the same issue.

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 @danpicton on GitHub (Sep 19, 2024). # Bug Report ## Installation Method `podman-compose.yml` ``` services: open-webui: image: ghcr.io/open-webui/open-webui:${WEBUI_DOCKER_TAG-main} container_name: open-webui volumes: - ./open-webui:/app/backend/data ports: - ${OPEN_WEBUI_PORT-5000}:8080 environment: - 'OLLAMA_BASE_URL=http://192.168.0.123:11434' - 'WEBUI_SECRET_KEY=zzz' extra_hosts: - host.docker.internal:127.0.0.1 restart: unless-stopped ``` `.env` ``` # Ollama URL for the backend to connect # The path '/ollama' will be redirected to the specified backend URL OLLAMA_BASE_URL='http://192.168.0.123:11434' OPENAI_API_BASE_URL='https://api.openai.com/v1' OPENAI_API_KEY='xxx' # AUTOMATIC1111_BASE_URL="http://localhost:7860" # DO NOT TRACK SCARF_NO_ANALYTICS=true DO_NOT_TRACK=true ANONYMIZED_TELEMETRY=false WEBUI_DOCKER_TAG=latest ``` ## Environment - **Open WebUI Version:** v0.3.13, v0.3.20 tested - **Ollama (if applicable):** n/a - **Operating System:** Debian 12.7 - **Browser (if applicable):** Brave (Version 1.69.168 Chromium: 128.0.6613.138 (Official Build) unknown (64-bit)) **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. - [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: PDFs containing images upload/embed for querying. ## Actual Behavior: Persistent "in progress" indicator; unable to query. ## Description **Bug Summary:** During PDF upload, if the PDF contains an image, the upload fails to complete. PDFs without images fail to load. **The issue persists even if I rename the PDF as suggested in a number of other similar issues.** ## Reproduction Details Use sample PDF here: https://www.learningcontainer.com/download/sample-pdf-with-images/ Non-image PDF also used to confirm standard functionality: https://www.learningcontainer.com/download/sample-pdf-file-for-testing/ **Steps to Reproduce:** 1. Upload test PDF 2. Observe failure ## Logs and Screenshots **Browser Console Logs:** ![image](https://github.com/user-attachments/assets/84a13b9b-a2f1-421e-ab77-9d2a5005dace) ``` 'pdf' MessageInput.svelte:94 FilelastModified: 1726736394003lastModifiedDate: Thu Sep 19 2024 09:59:54 GMT+0100 (British Summer Time) {}name: "sample-pdf-with-images.pdf"size: 3976877type: "application/pdf"webkitRelativePath: ""[[Prototype]]: FilelastModified: (...)lastModifiedDate: (...)name: (...)webkitRelativePath: (...)constructor: ƒ File()Symbol(Symbol.toStringTag): "File"size: (...)type: (...)get lastModified: ƒ lastModified()get lastModifiedDate: ƒ lastModifiedDate()get name: ƒ name()get webkitRelativePath: ƒ webkitRelativePath()[[Prototype]]: Blob index.ts:22 SyntaxError: Unexpected token '<', "<html> <h"... is not valid JSON ``` **Docker Container Logs:** None relevant. **Screenshots/Screen Recordings (if applicable):** This persists indefinitely: [Screencast from 2024-09-19 10-27-08.webm](https://github.com/user-attachments/assets/b84902d3-04fa-4fc5-8943-8c9dc718ffae) ## Additional Information Default model is `gpt-4o-mini`, embedding model is OpenAI's `text-embedding-3-small`. I have also tested with the default `sentence-transformers/all-MiniLM-L6-v2` model, but hit the same issue. ## 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#2118