Repository navigation
[Bug]: regress parsing result from minerU #12080
Copy link
Copy link
Closed
Labels
🐞 bugSomething isn't working, pull request that fix bug.Something isn't working, pull request that fix bug.
Description
Self Checks
- I have searched for existing issues search for existing issues, including closed ones.
- I confirm that I am using English to submit this report (Language Policy).
- Non-english title submitions will be closed directly ( 非英文标题的提交将会被直接关闭 ) (Language Policy).
- Please do not modify this template :) and fill in all the required fields.
RAGFlow workspace code commit ID
31f4e6f70a98f54734d68b18971fc7ca2f6d1e38
RAGFlow image version
main
Other environment information
Actual behavior
I'm using the latest main, I've currently launched minerU and connected it to the ragflow UI,
pipeline backend (the rest of the backend options don't work for me because they return TypeError: 'NoneType' object is not iterable, log below).
Why do we get a lot of chaos after parsing using this pipeline backend, and a completely different PDF cut (less granularity) than through minerU-gradio (UI)?
thanks for the explanation, I appreciate your work
this is my docker-compose if you want to launch mineru:
docker-compose-mineru.yml
version: '3.8'
services:
# MinerU with integrated vLLM - Latest unified image
# This image includes both MinerU and vLLM server
mineru-server:
image: mineru:latest
container_name: mineru-server
profiles:
- mineru-gpu
environment:
# GPU device selection (change to "0,1" for multi-GPU)
- CUDA_VISIBLE_DEVICES=0
# Hugging Face mirror for faster model downloads
- HF_ENDPOINT=${HF_ENDPOINT:-https://hf-mirror.com/}
# Complex PDF processing optimizations
- MINERU_PDF_RENDER_TIMEOUT=600
- MINERU_TABLE_MERGE_ENABLE=true
- MINERU_FORMULA_CH_SUPPORT=true
# vLLM engine settings
- VLLM_GPU_MEMORY_UTILIZATION=0.85
- VLLM_MAX_MODEL_LEN=32768
command: "mineru-api --host 0.0.0.0 --port 30000"
ports:
- "30000:30000" # MinerU API
- "8000:8000" # vLLM OpenAI-compatible API (if exposed)
volumes:
- mineru-output:/app/output
- mineru-models:/root/.cache/huggingface
- mineru-data:/app/data
shm_size: 32g
ipc: host
ulimits:
memlock: -1
stack: 67108864
networks:
- ragflow
restart: always
deploy:
resources:
reservations:
devices:
- driver: nvidia
# Use device_ids: ['0'] for specific GPU or count: all for all GPUs
device_ids: ['0']
capabilities: [gpu]
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:30000/openapi.json"]
interval: 30s
timeout: 10s
retries: 5
start_period: 300s # Allow time for model download and loading
# MinerU Gradio WebUI (Optional - for testing and debugging)
mineru-gradio:
image: mineru:latest
container_name: mineru-gradio
profiles:
- mineru-gradio
depends_on:
mineru-server:
condition: service_healthy
environment:
- MINERU_API_URL=http://mineru-server:30000/
- HF_ENDPOINT=${HF_ENDPOINT:-https://hf-mirror.com/}
command: "mineru-gradio --server-name 0.0.0.0 --server-port 7860 --enable-vllm-engine true"
ports:
- "7860:7860"
networks:
- ragflow
restart: always
volumes:
mineru-output:
driver: local
mineru-models:
driver: local
mineru-data:
driver: local
networks:
ragflow:
external: trueDockerfile.mineru
# Use the official vllm image for gpu with Ampere architecture and above (Compute Capability>=8.0)
# Compute Capability version query (https://developer.nvidia.com/cuda-gpus)
FROM vllm/vllm-openai:v0.10.1.1
# Use the official vllm image for gpu with Turing architecture and below (Compute Capability<8.0)
# FROM vllm/vllm-openai:v0.10.2
# Install libgl for opencv support & Noto fonts for Chinese characters
RUN apt-get update && \
apt-get install -y \
fonts-noto-core \
fonts-noto-cjk \
fontconfig \
libgl1 && \
fc-cache -fv && \
apt-get clean && \
rm -rf /var/lib/apt/lists/*
# Install mineru latest
RUN python3 -m pip install -U 'mineru[core]' --break-system-packages && \
python3 -m pip cache purge
# Download models and update the configuration file
RUN /bin/bash -c "mineru-models-download -s huggingface -m all"
# Set the entry point to activate the virtual environment and run the command line tool
ENTRYPOINT ["/bin/bash", "-c", "export MINERU_MODEL_SOURCE=local && exec \"$@\"", "--"]mineru-startup.sh
#!/bin/bash
# MinerU GPU Server Startup Script
set -e
COMPOSE_FILE="docker-compose-mineru.yml"
case "${1:-help}" in
start)
docker compose -f "$COMPOSE_FILE" --profile mineru-gpu up -d
echo "MinerU started. Logs: docker logs -f mineru-server"
;;
start-ui)
docker compose -f "$COMPOSE_FILE" --profile mineru-gpu --profile mineru-gradio up -d
echo "MinerU + UI started"
echo "API: http://localhost:30000/"
echo "UI: http://localhost:7860/"
;;
stop)
docker compose -f "$COMPOSE_FILE" --profile mineru-gpu --profile mineru-gradio down
;;
restart)
docker compose -f "$COMPOSE_FILE" --profile mineru-gpu restart
;;
logs)
docker compose -f "$COMPOSE_FILE" logs -f "${@:2}"
;;
status)
docker compose -f "$COMPOSE_FILE" ps
echo ""
curl -f http://localhost:30000/openapi.json &> /dev/null && \
echo "✓ API is running" || echo "✗ API not responding"
;;
*)
echo "Usage: $0 {start|start-ui|stop|restart|logs|status}"
echo ""
echo " start - Start MinerU server"
echo " start-ui - Start MinerU server + Web UI"
echo " stop - Stop MinerU"
echo " restart - Restart MinerU"
echo " logs - View logs"
echo " status - Check status"
;;
esacTypeError: 'NoneType' object is not iterable
await do_handle_task(task) File "/ragflow/common/connection_utils.py", line 74, in async_wrapper return await func(*args, **kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/ragflow/rag/svr/task_executor.py", line 1004, in do_handle_task chunks = await build_chunks(task, progress_callback) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/ragflow/common/connection_utils.py", line 74, in async_wrapper return await func(*args, **kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/ragflow/rag/svr/task_executor.py", line 252, in build_chunks cks = await asyncio.to_thread( ^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3.12/asyncio/threads.py", line 25, in to_thread return await loop.run_in_executor(None, func_call) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3.12/asyncio/futures.py", line 287, in __await__ yield self # This tells Task to wait for completion. ^^^^^^^^^^ File "/usr/lib/python3.12/asyncio/tasks.py", line 385, in __wakeup future.result() File "/usr/lib/python3.12/asyncio/futures.py", line 203, in result raise self._exception.with_traceback(self._exception_tb) File "/usr/lib/python3.12/concurrent/futures/thread.py", line 58, in run result = self.fn(*self.args, **self.kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/ragflow/rag/app/manual.py", line 248, in chunk sections = [_normalize_section(sec) for sec in sections] ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ TypeError: 'NoneType' object is not iterable [2025-12-19 14:29:20 +0100] [19] [INFO] 127.0.0.1:60452 GET /v1/kb/detail 1.1 200 1320 1008895 [2025-12-19 14:29:24 +0100] [19] [INFO] 127.0.0.1:60466 POST /v1/document/list 1.1 200 30183 7521 [2025-12-19 14:29:24 +0100] [19] [INFO] 127.0.0.1:60476 GET /v1/kb/detail 1.1 200 1320 8031 2025-12-19 14:29:30,051 INFO 35 task_executor_1cfae6aae9d7_0 reported heartbeat: {"ip_address": "172.18.0.8", "pid": 35, "name": "task_executor_1cfae6aae9d7_0", "now": "2025-12-19T14:29:30.051+01:00", "boot_at": "2025-12-19T13:55:28.929+01:00", "pending": 0, "lag": 0, "done": 2, "failed": 1, "current": {}} 2025-12-19 14:30:00,056 INFO 35 task_executor_1cfae6aae9d7_0 reported heartbeat: {"ip_address": "172.18.0.8", "pid": 35, "name": "task_executor_1cfae6aae9d7_0", "now": "2025-12-19T14:30:00.054+01:00", "boot_at": "2025-12-19T13:55:28.929+01:00", "pending": 0, "lag": 0, "done": 2, "failed": 1, "current": {}}Expected behavior
No response
Steps to reproduce
1. model provider MinerU (local docker app)
2. pdf parser this minerU added, pipeline backendAdditional information
No response
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
🐞 bugSomething isn't working, pull request that fix bug.Something isn't working, pull request that fix bug.

Activity
dosubot commentedon Dec 22, 2025
The "TypeError: 'NoneType' object is not iterable" happens when the MinerU parser fails (often due to misconfiguration or API issues) and returns None, but the pipeline backend tries to process it as if it were a list of sections. This is a known gap in error handling: if MinerU can't parse or connect, the error surfaces as a crash instead of a clear message. This can also explain why you see "chaotic" or less granular parsing—if MinerU returns empty or malformed output, the chunking logic can't recover and produces poor results or nothing at all. The UI (MinerU-gradio) may use different defaults or connect to MinerU differently, so it can succeed where the pipeline backend fails or produces different chunking granularity.
Recent code changes refactored how MinerU config is parsed and how environment variables like MINERU_APISERVER, MINERU_BACKEND, and MINERU_SERVER_URL are resolved. If these aren't set correctly, or if the backend type doesn't match your MinerU deployment, the pipeline backend may not be able to reach MinerU or may call it with the wrong parameters, leading to None returns and the error you see. The chunk_token_num is also set to 0 for 'mineru', which can affect chunking granularity and lead to different results than the UI, which may use a different chunk size or parsing method by default (source, source, source).
To improve consistency and avoid the error, double-check that your pipeline backend and MinerU-gradio UI use the same MinerU API endpoint, backend type, and parser settings. Make sure MINERU_APISERVER and MINERU_BACKEND are set and reachable from the RAGFlow backend. If you still see the error, adding a guard in the code to check for None before iterating over sections would prevent the crash and surface a clearer error message.
Finally, MinerU integration is marked as experimental, so some inconsistencies between UI and backend are expected until the integration matures (source).
To reply, just mention @dosu.
How did I do? Good | Irrelevant | Incorrect | Verbose | Hallucination | Report 🐛 | Other
yongtenglei commentedon Dec 22, 2025
Hi, @adagora
Please test the latest codebase. RAGFlow currently only retrieves and parses the
content_list.jsonfile from MinerU. Let me know the parsing result from the latest code. All backends are expected fully operational.adagora commentedon Dec 22, 2025
@yonghuili1
backend works, same messy parsing result, deepdoc seems works better in this pdf more granurality
Build in: Manual
logs:
deepdoc result:
TypeError: 'NoneType' object is not iterable
This may be due to the graphics card. I have a new NVIDIA model, which may not be supported.
yongtenglei commentedon Dec 23, 2025
Hi, @adagora
Please use General rather than Manual, you should get the same results from minerU-gradio, I guess. Let me know if it solves the odd parsing result.
adagora commentedon Dec 23, 2025
Hi @yongtenglei
General - a lot better, faster parsing
still not all images are attached
for example, this section with the color pallets is missing
also MinerU Options I am not sure if they only apply to the backend pipeline, vlm-vllm-async-engine is supported?
yongtenglei commentedon Dec 24, 2025
Hi, @adagora
RAGFlow simply parse the result from MinerU. If MinerU cannot recognize this section well, this would be the expected behavior I guess :(
vlm-vllm-async-engineis theoretically supported.pipeline,vlm-http-client,vlm-transformers,vlm-vllm-engine vlm-mlx-engineare offically tested.Since these texts are "mis-recognized" and too short (less than 8 tokens, kind of), thus, these texts are simply treat as chunks without extra processing.
I hope this would be helpful.
adagora commentedon Dec 24, 2025
@yongtenglei Ok, but mineru recognizes these sections, i.e. there is a bounding box around all the images above from the screenshots, maybe it's a problematic pdf I came across
adagora commentedon Jan 8, 2026
@yongtenglei I tried all this methods
for example:
SAFETY PIN (~4 tokens) there is also text next to this header (more than 8 for sure) but there is no image from the pdf
is it better to customize this limit by user?
looks like incomplete on on all the methods you mentioned
sometimes ive seen in mineru api service logs:
adagora commentedon Jan 21, 2026
@yingfeng there is positons but no image fyi
[-][Bug]: odd parsing result using minerU[/-][+][Bug]: regress parsing result from minerU[/+]