[PR #20016] [CLOSED] feat: add configurable timeout for MinerU document processing API #48477

Closed
opened 2026-04-30 00:24:35 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/open-webui/open-webui/pull/20016
Author: @creasysee
Created: 12/17/2025
Status: Closed

Base: devHead: mineru-request-timeout


📝 Commits (9)

  • fe6783c Merge pull request #19030 from open-webui/dev
  • fc05e0a Merge pull request #19405 from open-webui/dev
  • e3faec6 Merge pull request #19416 from open-webui/dev
  • 9899293 Merge pull request #19448 from open-webui/dev
  • 140605e Merge pull request #19462 from open-webui/dev
  • 6f1486f Merge pull request #19466 from open-webui/dev
  • d75d2a4 Update mineru.py by set requests.post timeout to env MINERU_API_TIMEOUT
  • 6379c0c Update config.py set env MINERU_API_TIMEOUT
  • d4c43bf Update mineru.py by set timeout env MINERU_API_TIMEOUT

📊 Changes

2 files changed (+5 additions, -2 deletions)

View changed files

📝 backend/open_webui/config.py (+2 -0)
📝 backend/open_webui/retrieval/loaders/mineru.py (+3 -2)

📄 Description

Pull Request Checklist

Note to first-time contributors: Please open a discussion post in Discussions to discuss your idea/fix with the community before creating a pull request, and describe your changes before submitting a pull request.

This is to ensure large feature PRs are discussed with the community first, before starting work on it. If the community does not want this feature or it is not relevant for Open WebUI as a project, it can be identified in the discussion before working on the feature and submitting the PR.

Before submitting, make sure you've checked the following:

  • Target branch: Verify that the pull request targets the dev branch. Not targeting the dev branch will lead to immediate closure of the PR.
  • Description: Provide a concise description of the changes made in this pull request down below.
  • Changelog: Ensure a changelog entry following the format of Keep a Changelog is added at the bottom of the PR description.
  • Documentation: If necessary, update relevant documentation Open WebUI Docs like environment variables, the tutorials, or other documentation sources.
  • Dependencies: Are there any new dependencies? Have you updated the dependency versions in the documentation?
  • Testing: Perform manual tests to verify the implemented fix/feature works as intended AND does not break any other functionality. Take this as an opportunity to make screenshots of the feature/fix and include it in the PR description.
  • Agentic AI Code: Confirm this Pull Request is not written by any AI Agent or has at least gone through additional human review AND manual testing. If any AI Agent is the co-author of this PR, it may lead to immediate closure of the PR.
  • Code review: Have you performed a self-review of your code, addressing any coding standard issues and ensuring adherence to the project's coding standards?
  • Title Prefix: To clearly categorize this pull request, prefix the pull request title using one of the following:
    • feat: Introduces a new feature or enhancement to the codebase

Changelog Entry

Description

  • The feature adds a configurable timeout setting for MinerU API calls, similar to existing timeout configurations for other services. This allows you to process large files, which can take more than 5 minutes by default.

Added

  • MINERU_API_TIMEOUT environment variable (default: 300)

Fixed

  • Fixed error ReadTimeoutError: HTTPConnectionPool(host='XX.XX.XX.XX', port=8000): Read timed out. (read timeout=300)

Tested

openwebui-1  | 2025-12-16 18:42:55.275 | INFO     | open_webui.routers.files:upload_file_handler:182 - file.content_type: application/pdf
openwebui-1  | 2025-12-16 18:42:55.312 | INFO     | uvicorn.protocols.http.httptools_impl:send:476 - YY.YY.YY.YY:64080 - "POST /api/v1/files/ HTTP/1.1" 200
openwebui-1  | 2025-12-16 18:42:55.331 | INFO     | open_webui.retrieval.loaders.mineru:_load_local_api:75 - Using MinerU Local API at http://XX.XX.XX.XX:8000
openwebui-1  | 2025-12-16 18:42:55.331 | INFO     | open_webui.retrieval.loaders.mineru:_load_local_api:98 - Sending file to MinerU Local API: c0470ae8-c872-4fae-92aa-5bdd0c34b63c_XXXXXXXXXXX_split_3.pdf
openwebui-1  | 2025-12-16 18:42:55.357 | INFO     | uvicorn.protocols.http.httptools_impl:send:476 - YY.YY.YY.YY:64080 - "GET /api/v1/files/c0470ae8-c872-4fae-92aa-5bdd0c34b63c/process/status?stream=true HTTP/1.1" 200
openwebui-1  | 2025-12-16 18:44:20.850 | INFO     | uvicorn.protocols.http.httptools_impl:send:476 - YY.YY.YY.YY:50609 - "GET /_app/version.json HTTP/1.1" 200
openwebui-1  | 2025-12-16 18:45:26.851 | INFO     | uvicorn.protocols.http.httptools_impl:send:476 - YY.YY.YY.YY:50972 - "GET /_app/version.json HTTP/1.1" 200
openwebui-1  | 2025-12-16 18:45:59.021 | INFO     | uvicorn.protocols.http.httptools_impl:send:476 - YY.YY.YY.YY:51157 - "GET /api/v1/files/71c68e35-7af8-4927-9c31-fe72a955f395 HTTP/1.1" 200
openwebui-1  | 2025-12-16 18:46:26.679 | INFO     | uvicorn.protocols.http.httptools_impl:send:476 - YY.YY.YY.YY:51318 - "GET /_app/version.json HTTP/1.1" 200
openwebui-1  | 2025-12-16 18:46:27.267 | INFO     | uvicorn.protocols.http.httptools_impl:send:476 - YY.YY.YY.YY:51318 - "GET /api/v1/files/a6a50018-aaad-41eb-8530-b78a8814f726 HTTP/1.1" 200
openwebui-1  | 2025-12-16 18:47:26.858 | INFO     | uvicorn.protocols.http.httptools_impl:send:476 - YY.YY.YY.YY:51630 - "GET /_app/version.json HTTP/1.1" 200
openwebui-1  | 2025-12-16 18:48:26.675 | INFO     | uvicorn.protocols.http.httptools_impl:send:476 - YY.YY.YY.YY:51969 - "GET /_app/version.json HTTP/1.1" 200
openwebui-1  | 2025-12-16 18:49:26.663 | INFO     | uvicorn.protocols.http.httptools_impl:send:476 - YY.YY.YY.YY:52266 - "GET /_app/version.json HTTP/1.1" 200
openwebui-1  | 2025-12-16 18:49:36.491 | INFO     | open_webui.retrieval.loaders.mineru:_load_local_api:166 - Successfully parsed document with MinerU Local API: c0470ae8-c872-4fae-92aa-5bdd0c34b63c_XXXXXXXXXXX_split_3.pdf

Here you can see time between sending a file to MinerU 18:42:55 and receiving a parsed doc from MinerU 18:49:36. The diff of time is 6 minutes 41 seconds that more than 300 seconds of a default timeout.

Also tested a request timed out with MINERU_API_TIMEOUT=900:

2025-12-18 13:11:51.676 | INFO     | open_webui.retrieval.loaders.mineru:_load_local_api:75 - Using MinerU Local API at http://YY.YY.YY.YY:8000
2025-12-18 13:11:51.676 | INFO     | open_webui.retrieval.loaders.mineru:_load_local_api:98 - Sending file to MinerU Local API: 7b6e1d8e-619a-409d-9285-9282e3e4bb71_XXXXXXXXXX.pdf
2025-12-18 13:11:51.685 | INFO     | uvicorn.protocols.http.httptools_impl:send:476 - YY.YY.YY.YY:54660 - "GET /api/v1/files/7b6e1d8e-619a-409d-9285-9282e3e4bb71/process/status?stream=true HTTP/1.1" 200
2025-12-18 13:12:09.307 | INFO     | uvicorn.protocols.http.httptools_impl:send:476 - YY.YY.YY.YY:54764 - "GET /_app/version.json HTTP/1.1" 200
2025-12-18 13:13:10.305 | INFO     | uvicorn.protocols.http.httptools_impl:send:476 - YY.YY.YY.YY:55109 - "GET /_app/version.json HTTP/1.1" 200
2025-12-18 13:14:29.780 | INFO     | uvicorn.protocols.http.httptools_impl:send:476 - YY.YY.YY.YY:55571 - "GET /_app/version.json HTTP/1.1" 200
2025-12-18 13:15:28.317 | INFO     | uvicorn.protocols.http.httptools_impl:send:476 - YY.YY.YY.YY:55909 - "GET /_app/version.json HTTP/1.1" 200
2025-12-18 13:16:29.298 | INFO     | uvicorn.protocols.http.httptools_impl:send:476 - YY.YY.YY.YY:56259 - "GET /_app/version.json HTTP/1.1" 200
2025-12-18 13:17:46.409 | INFO     | uvicorn.protocols.http.httptools_impl:send:476 - YY.YY.YY.YY:56706 - "GET /_app/version.json HTTP/1.1" 200
2025-12-18 13:18:47.295 | INFO     | uvicorn.protocols.http.httptools_impl:send:476 - YY.YY.YY.YY:57075 - "GET /_app/version.json HTTP/1.1" 200
2025-12-18 13:20:28.329 | INFO     | uvicorn.protocols.http.httptools_impl:send:476 - YY.YY.YY.YY:57654 - "GET /_app/version.json HTTP/1.1" 200
2025-12-18 13:22:28.307 | INFO     | uvicorn.protocols.http.httptools_impl:send:476 - YY.YY.YY.YY:58292 - "GET /_app/version.json HTTP/1.1" 200
2025-12-18 13:23:28.311 | INFO     | uvicorn.protocols.http.httptools_impl:send:476 - YY.YY.YY.YY:58629 - "GET /_app/version.json HTTP/1.1" 200
2025-12-18 13:24:28.316 | INFO     | uvicorn.protocols.http.httptools_impl:send:476 - YY.YY.YY.YY:58961 - "GET /_app/version.json HTTP/1.1" 200
2025-12-18 13:25:28.323 | INFO     | uvicorn.protocols.http.httptools_impl:send:476 - YY.YY.YY.YY:59303 - "GET /_app/version.json HTTP/1.1" 200
2025-12-18 13:26:28.495 | INFO     | uvicorn.protocols.http.httptools_impl:send:476 - YY.YY.YY.YY:59622 - "GET /_app/version.json HTTP/1.1" 200
2025-12-18 13:26:52.035 | ERROR    | open_webui.retrieval.loaders.mineru:load:67 - Error loading document with MinerU: 504: MinerU Local API request timed out
2025-12-18 13:26:52.035 | ERROR    | open_webui.routers.retrieval:process_file:1651 - 504: MinerU Local API request timed out

Here you can see 901 seconds between sending a file to MinerU 13:11:51 and the Error timed out meassge 13:26:52.

Additional Information

Related Issue: #18495
Related Discussion: #18552

Contributor License Agreement

By submitting this pull request, I confirm that I have read and fully agree to the Contributor License Agreement (CLA), and I am providing my contributions under its terms.

Note

Deleting the CLA section will lead to immediate closure of your PR and it will not be merged in.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/open-webui/open-webui/pull/20016 **Author:** [@creasysee](https://github.com/creasysee) **Created:** 12/17/2025 **Status:** ❌ Closed **Base:** `dev` ← **Head:** `mineru-request-timeout` --- ### 📝 Commits (9) - [`fe6783c`](https://github.com/open-webui/open-webui/commit/fe6783c16699911c7be17392596d579333fb110c) Merge pull request #19030 from open-webui/dev - [`fc05e0a`](https://github.com/open-webui/open-webui/commit/fc05e0a6c5d39da60b603b4d520f800d6e36f748) Merge pull request #19405 from open-webui/dev - [`e3faec6`](https://github.com/open-webui/open-webui/commit/e3faec62c58e3a83d89aa3df539feacefa125e0c) Merge pull request #19416 from open-webui/dev - [`9899293`](https://github.com/open-webui/open-webui/commit/9899293f050ad50ae12024cbebee7e018acd851e) Merge pull request #19448 from open-webui/dev - [`140605e`](https://github.com/open-webui/open-webui/commit/140605e660b8186a7d5c79fb3be6ffb147a2f498) Merge pull request #19462 from open-webui/dev - [`6f1486f`](https://github.com/open-webui/open-webui/commit/6f1486ffd0cb288d0e21f41845361924e0d742b3) Merge pull request #19466 from open-webui/dev - [`d75d2a4`](https://github.com/open-webui/open-webui/commit/d75d2a4313df2e344f342c6c938d62f6a644ca63) Update mineru.py by set requests.post timeout to env MINERU_API_TIMEOUT - [`6379c0c`](https://github.com/open-webui/open-webui/commit/6379c0c6a0b19c02e63927476dea9e49a11284d2) Update config.py set env MINERU_API_TIMEOUT - [`d4c43bf`](https://github.com/open-webui/open-webui/commit/d4c43bfc36c7451ffd558663987e8a86e7b15ea5) Update mineru.py by set timeout env MINERU_API_TIMEOUT ### 📊 Changes **2 files changed** (+5 additions, -2 deletions) <details> <summary>View changed files</summary> 📝 `backend/open_webui/config.py` (+2 -0) 📝 `backend/open_webui/retrieval/loaders/mineru.py` (+3 -2) </details> ### 📄 Description # Pull Request Checklist ### Note to first-time contributors: Please open a discussion post in [Discussions](https://github.com/open-webui/open-webui/discussions) to discuss your idea/fix with the community before creating a pull request, and describe your changes before submitting a pull request. This is to ensure large feature PRs are discussed with the community first, before starting work on it. If the community does not want this feature or it is not relevant for Open WebUI as a project, it can be identified in the discussion before working on the feature and submitting the PR. #### Before submitting, make sure you've checked the following: - [x] **Target branch:** Verify that the pull request targets the dev branch. Not targeting the dev branch will lead to immediate closure of the PR. - [x] **Description:** Provide a concise description of the changes made in this pull request down below. - [x] **Changelog:** Ensure a changelog entry following the format of [Keep a Changelog](https://keepachangelog.com/) is added at the bottom of the PR description. - [x] **Documentation:** If necessary, update relevant documentation [Open WebUI Docs](https://github.com/open-webui/docs) like environment variables, the tutorials, or other documentation sources. - [x] **Dependencies:** Are there any new dependencies? Have you updated the dependency versions in the documentation? - [x] **Testing:** Perform manual tests to **verify the implemented fix/feature works as intended AND does not break any other functionality**. Take this as an opportunity to **make screenshots of the feature/fix and include it in the PR description**. - [x] **Agentic AI Code:** Confirm this Pull Request is **not written by any AI Agent** or has at least **gone through additional human review AND manual testing**. If any AI Agent is the co-author of this PR, it may lead to immediate closure of the PR. - [x] **Code review:** Have you performed a self-review of your code, addressing any coding standard issues and ensuring adherence to the project's coding standards? - [x] **Title Prefix:** To clearly categorize this pull request, prefix the pull request title using one of the following: - **feat**: Introduces a new feature or enhancement to the codebase # Changelog Entry ### Description - The feature adds a configurable timeout setting for MinerU API calls, similar to existing timeout configurations for other services. This allows you to process large files, which can take more than 5 minutes by default. ### Added - MINERU_API_TIMEOUT environment variable (default: 300) ### Fixed - Fixed error ReadTimeoutError: HTTPConnectionPool(host='XX.XX.XX.XX', port=8000): Read timed out. (read timeout=300) ### Tested ``` openwebui-1 | 2025-12-16 18:42:55.275 | INFO | open_webui.routers.files:upload_file_handler:182 - file.content_type: application/pdf openwebui-1 | 2025-12-16 18:42:55.312 | INFO | uvicorn.protocols.http.httptools_impl:send:476 - YY.YY.YY.YY:64080 - "POST /api/v1/files/ HTTP/1.1" 200 openwebui-1 | 2025-12-16 18:42:55.331 | INFO | open_webui.retrieval.loaders.mineru:_load_local_api:75 - Using MinerU Local API at http://XX.XX.XX.XX:8000 openwebui-1 | 2025-12-16 18:42:55.331 | INFO | open_webui.retrieval.loaders.mineru:_load_local_api:98 - Sending file to MinerU Local API: c0470ae8-c872-4fae-92aa-5bdd0c34b63c_XXXXXXXXXXX_split_3.pdf openwebui-1 | 2025-12-16 18:42:55.357 | INFO | uvicorn.protocols.http.httptools_impl:send:476 - YY.YY.YY.YY:64080 - "GET /api/v1/files/c0470ae8-c872-4fae-92aa-5bdd0c34b63c/process/status?stream=true HTTP/1.1" 200 openwebui-1 | 2025-12-16 18:44:20.850 | INFO | uvicorn.protocols.http.httptools_impl:send:476 - YY.YY.YY.YY:50609 - "GET /_app/version.json HTTP/1.1" 200 openwebui-1 | 2025-12-16 18:45:26.851 | INFO | uvicorn.protocols.http.httptools_impl:send:476 - YY.YY.YY.YY:50972 - "GET /_app/version.json HTTP/1.1" 200 openwebui-1 | 2025-12-16 18:45:59.021 | INFO | uvicorn.protocols.http.httptools_impl:send:476 - YY.YY.YY.YY:51157 - "GET /api/v1/files/71c68e35-7af8-4927-9c31-fe72a955f395 HTTP/1.1" 200 openwebui-1 | 2025-12-16 18:46:26.679 | INFO | uvicorn.protocols.http.httptools_impl:send:476 - YY.YY.YY.YY:51318 - "GET /_app/version.json HTTP/1.1" 200 openwebui-1 | 2025-12-16 18:46:27.267 | INFO | uvicorn.protocols.http.httptools_impl:send:476 - YY.YY.YY.YY:51318 - "GET /api/v1/files/a6a50018-aaad-41eb-8530-b78a8814f726 HTTP/1.1" 200 openwebui-1 | 2025-12-16 18:47:26.858 | INFO | uvicorn.protocols.http.httptools_impl:send:476 - YY.YY.YY.YY:51630 - "GET /_app/version.json HTTP/1.1" 200 openwebui-1 | 2025-12-16 18:48:26.675 | INFO | uvicorn.protocols.http.httptools_impl:send:476 - YY.YY.YY.YY:51969 - "GET /_app/version.json HTTP/1.1" 200 openwebui-1 | 2025-12-16 18:49:26.663 | INFO | uvicorn.protocols.http.httptools_impl:send:476 - YY.YY.YY.YY:52266 - "GET /_app/version.json HTTP/1.1" 200 openwebui-1 | 2025-12-16 18:49:36.491 | INFO | open_webui.retrieval.loaders.mineru:_load_local_api:166 - Successfully parsed document with MinerU Local API: c0470ae8-c872-4fae-92aa-5bdd0c34b63c_XXXXXXXXXXX_split_3.pdf ``` Here you can see time between sending a file to MinerU `18:42:55` and receiving a parsed doc from MinerU `18:49:36`. The diff of time is 6 minutes 41 seconds that more than 300 seconds of a default timeout. Also tested a request timed out with MINERU_API_TIMEOUT=900: ``` 2025-12-18 13:11:51.676 | INFO | open_webui.retrieval.loaders.mineru:_load_local_api:75 - Using MinerU Local API at http://YY.YY.YY.YY:8000 2025-12-18 13:11:51.676 | INFO | open_webui.retrieval.loaders.mineru:_load_local_api:98 - Sending file to MinerU Local API: 7b6e1d8e-619a-409d-9285-9282e3e4bb71_XXXXXXXXXX.pdf 2025-12-18 13:11:51.685 | INFO | uvicorn.protocols.http.httptools_impl:send:476 - YY.YY.YY.YY:54660 - "GET /api/v1/files/7b6e1d8e-619a-409d-9285-9282e3e4bb71/process/status?stream=true HTTP/1.1" 200 2025-12-18 13:12:09.307 | INFO | uvicorn.protocols.http.httptools_impl:send:476 - YY.YY.YY.YY:54764 - "GET /_app/version.json HTTP/1.1" 200 2025-12-18 13:13:10.305 | INFO | uvicorn.protocols.http.httptools_impl:send:476 - YY.YY.YY.YY:55109 - "GET /_app/version.json HTTP/1.1" 200 2025-12-18 13:14:29.780 | INFO | uvicorn.protocols.http.httptools_impl:send:476 - YY.YY.YY.YY:55571 - "GET /_app/version.json HTTP/1.1" 200 2025-12-18 13:15:28.317 | INFO | uvicorn.protocols.http.httptools_impl:send:476 - YY.YY.YY.YY:55909 - "GET /_app/version.json HTTP/1.1" 200 2025-12-18 13:16:29.298 | INFO | uvicorn.protocols.http.httptools_impl:send:476 - YY.YY.YY.YY:56259 - "GET /_app/version.json HTTP/1.1" 200 2025-12-18 13:17:46.409 | INFO | uvicorn.protocols.http.httptools_impl:send:476 - YY.YY.YY.YY:56706 - "GET /_app/version.json HTTP/1.1" 200 2025-12-18 13:18:47.295 | INFO | uvicorn.protocols.http.httptools_impl:send:476 - YY.YY.YY.YY:57075 - "GET /_app/version.json HTTP/1.1" 200 2025-12-18 13:20:28.329 | INFO | uvicorn.protocols.http.httptools_impl:send:476 - YY.YY.YY.YY:57654 - "GET /_app/version.json HTTP/1.1" 200 2025-12-18 13:22:28.307 | INFO | uvicorn.protocols.http.httptools_impl:send:476 - YY.YY.YY.YY:58292 - "GET /_app/version.json HTTP/1.1" 200 2025-12-18 13:23:28.311 | INFO | uvicorn.protocols.http.httptools_impl:send:476 - YY.YY.YY.YY:58629 - "GET /_app/version.json HTTP/1.1" 200 2025-12-18 13:24:28.316 | INFO | uvicorn.protocols.http.httptools_impl:send:476 - YY.YY.YY.YY:58961 - "GET /_app/version.json HTTP/1.1" 200 2025-12-18 13:25:28.323 | INFO | uvicorn.protocols.http.httptools_impl:send:476 - YY.YY.YY.YY:59303 - "GET /_app/version.json HTTP/1.1" 200 2025-12-18 13:26:28.495 | INFO | uvicorn.protocols.http.httptools_impl:send:476 - YY.YY.YY.YY:59622 - "GET /_app/version.json HTTP/1.1" 200 2025-12-18 13:26:52.035 | ERROR | open_webui.retrieval.loaders.mineru:load:67 - Error loading document with MinerU: 504: MinerU Local API request timed out 2025-12-18 13:26:52.035 | ERROR | open_webui.routers.retrieval:process_file:1651 - 504: MinerU Local API request timed out ``` Here you can see 901 seconds between sending a file to MinerU `13:11:51` and the Error timed out meassge `13:26:52`. ### Additional Information Related Issue: [#18495](https://github.com/open-webui/open-webui/issues/18495) Related Discussion: [#18552](https://github.com/open-webui/open-webui/discussions/18552) ### Contributor License Agreement By submitting this pull request, I confirm that I have read and fully agree to the [Contributor License Agreement (CLA)](https://github.com/open-webui/open-webui/blob/main/CONTRIBUTOR_LICENSE_AGREEMENT), and I am providing my contributions under its terms. > [!NOTE] > Deleting the CLA section will lead to immediate closure of your PR and it will not be merged in. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
GiteaMirror added the pull-request label 2026-04-30 00:24:36 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/open-webui#48477