fix: Datalab Marker extraction fails on installs outside the Docker image (#32164)

With Datalab Marker as the content extraction engine, every file upload it processed failed on pip and source installs with `Permission denied: '/app'`, because Open WebUI saved a copy of the extracted text under `/app`, a folder that only exists inside the Docker image. That copy now goes to the uploads folder inside `DATA_DIR`, so extraction works on any install. Docker installs with the default data directory keep the same location.

Fixes #32025
This commit is contained in:
Classic298 2026-10-10 18:00:02 +02:00 • committed by GitHub
parent c9f9c4b1da
commit 8fa22d0997
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -7,6 +7,7 @@ from typing import List, Optional
import requests
from fastapi import HTTPException, status
from langchain_core.documents import Document
from open_webui.config import UPLOAD_DIR
from open_webui.utils.json_codec import JSONCodec
log = logging.getLogger(__name__)
@ -208,7 +209,7 @@ class DatalabMarkerLoader:
detail='Marker returned empty content',
)
marker_output_dir = os.path.join('/app/backend/data/uploads', 'marker_output')
marker_output_dir = os.path.join(UPLOAD_DIR, 'marker_output')
os.makedirs(marker_output_dir, exist_ok=True)
file_ext_map = {'markdown': 'md', 'json': 'json', 'html': 'html'}