open-webui/open-webui · warning · HTTPException
MinerU returned empty results
Error message
MinerU returned empty results
What it means
Raised as HTTP 400 when the Local API returns a 'results' object that is empty ({}). The service completed with 200 but produced zero per-file entries - i.e. the uploaded file produced no parse result at all, usually because the multipart filename key did not match or parsing silently yielded nothing.
Source
Thrown at backend/open_webui/retrieval/loaders/mineru.py:151
# Parse response
try:
result = response.json()
except ValueError as e:
raise HTTPException(
status.HTTP_502_BAD_GATEWAY,
detail=f'Invalid JSON response from MinerU Local API: {e}',
)
# Extract markdown content from response
if 'results' not in result:
raise HTTPException(
status.HTTP_502_BAD_GATEWAY,
detail="MinerU Local API response missing 'results' field",
)
results = result['results']
if not results:
raise HTTPException(
status.HTTP_400_BAD_REQUEST,
detail='MinerU returned empty results',
)
# Get the first (and typically only) result
file_result = list(results.values())[0]
markdown_content = file_result.get('md_content', '')
if not markdown_content:
raise HTTPException(
status.HTTP_400_BAD_REQUEST,
detail='MinerU returned empty markdown content',
)
log.info(f'Successfully parsed document with MinerU Local API: {filename}')
# Create metadata
metadata = {View on GitHub (pinned to 01f4282f1f)
Solutions
- Check the file is non-empty and a supported type (PDF/Office/images) before parsing
- Reproduce with curl -F 'files=@doc.pdf' and inspect the results map
- Check MinerU server logs for skipped/failed file registration
- Re-save or re-export a possibly corrupt source document and retry
Example fix
// before
loader = MinerULoader(file_path=p, api_mode='local')
// after
import os
if os.path.getsize(p) == 0:
raise ValueError(f'{p} is empty')
loader = MinerULoader(file_path=p, api_mode='local') Defensive patterns
Strategy: validation
Validate before calling
import os
assert os.path.exists(path) and os.path.getsize(path) > 0, 'empty or missing file'
assert os.path.splitext(path)[1].lower() in {'.pdf', '.docx', '.pptx', '.png', '.jpg'}, 'unsupported type' Try / catch
try:
docs = loader.load()
except HTTPException as e:
if e.status_code == 400 and 'empty results' in e.detail:
log.warning('MinerU produced no result entries for %s', path)
raise Prevention
- Reject zero-byte uploads at the API boundary before parsing
- Maintain a whitelist of supported extensions matching the MinerU build
- Curl-reproduce suspect files to distinguish server skips from loader bugs
When it happens
Trigger: The 'files' multipart part name/filename mismatch so MinerU indexes nothing under that name; a corrupt or zero-byte uploaded file that MinerU skips; server-side filtering (e.g. unsupported extension) returning an empty map.
Common situations: Zero-byte or truncated file at file_path (interrupted upload to the server); a file type the MinerU build does not register; disk issues making the read return nothing.
Related errors
- MinerU Local API request timed out
- MinerU Local API request failed: {e}
- MinerU returned empty markdown content
- Invalid API mode: {self.api_mode}. Must be 'local' or 'cloud
- API key is required for Cloud API mode
AI-assisted analysis of open-webui/open-webui@01f4282f1f (2026-08-14).
Data as JSON: /api/errors/212a3e68c23823c4.
Report an issue: GitHub.