zylon-ai/private-gpt · error · ValueError
Document conversion failed with status: {conversion_result.s
Error message
Document conversion failed with status: {conversion_result.status}. Errors: {conversion_result.errors} What it means
Raised by DoclingApiReader.lazy_load_data when the conversion result's status is neither 'success' nor 'partial_success'. Unlike the async-client failure path (error 181), this is the synchronous response from Docling already carrying a failure status — typically 'failure' — and the message appends the server's own errors list, which is the primary diagnostic.
Source
Thrown at private_gpt/components/readers/docling/docling_api_reader.py:173
**load_kwargs: Any,
) -> AsyncIterator[BaseNode]:
"""Lazy load file data into LlamaIndex Documents."""
logger.debug("Starting Docling API parsing of file: %s", file_info.file_name)
file_name = file_info.file_name or file_info.file_data.name
file_data = file_info.file_data
file_bytes = await asyncio.to_thread(file_data.read_bytes)
pages = file_info.config.get("pages", None)
try:
conversion_result = await self.client.convert_from_bytes(
file_name, file_bytes, to_formats=["md"], pages=pages, **load_kwargs
)
except Exception as e:
raise ValueError(f"Document conversion failed: {e}") from e
if conversion_result.status not in ["success", "partial_success"]:
raise ValueError(
f"Document conversion failed with status: {conversion_result.status}. "
f"Errors: {conversion_result.errors}"
)
contents = self._get_content(conversion_result)
valid_contents = [content for content in contents if content]
if not valid_contents:
raise ValueError("No valid document content found after conversion")
if self._is_extraction_unsuccessful(valid_contents):
raise ExtractionUnsuccessfulError(
f"Document extraction unsuccessful for '{file_name}': unmapped-glyph "
f"ratio exceeded threshold ({self.config.failure_threshold})."
)
docs = [
self._page_to_doc(
content=content,
index=idx,View on GitHub (pinned to 4a030776a3)
Solutions
- Read the Errors: [...] portion of the message — it is the server's own error list and names the failing component directly.
- Retry the file against the server API directly with the same options to reproduce and iterate quickly.
- For page-level errors, ingest a page subset (pages config) to isolate the bad pages, or relax options (disable OCR/table structure enrichment).
- If the file itself is corrupt (common for downloaded/merged PDFs), repair or skip it; no server config will help.
- Move the file to a dead-letter/quarantine path so one bad file does not stop the batch.
Defensive patterns
Strategy: try-catch
Type guard
def is_acceptable_status(status: str) -> bool:
return status in {"success", "partial_success"} Try / catch
try:
nodes = [n async for n in reader.lazy_load_data(file_info)]
except ValueError as e:
msg = str(e)
if "failed with status" in msg:
server_errors = msg.split("Errors:", 1)[-1]
quarantine(file_info, reason=server_errors) # terminal; log server's errors list
return []
raise Prevention
- Reproduce single-file failures by posting to the server API directly — the errors array names the failing component.
- Use the pages config to bisect documents with one poison page.
- Keep abort_on_error semantics in mind: one bad page can fail the whole document.
When it happens
Trigger: POST /convert/source (sync path) returning JSON with status: 'failure' and a populated errors array: unparseable document, invalid pdf_backend for the file type, OCR engine crash on the server, abort_on_error triggered by a page-level error.
Common situations: Corrupt/encrypted PDFs; documents in from_formats not enabled server-side; pdf_backend mismatch (e.g., file needs a different parser); partial failures when abort_on_error defaults to true; Docling server version changes altering error semantics.
Related errors
- Task failed with status: {status.task_status}
- No valid content found in the conversion result
- Document conversion failed: {e}
- No valid document content found after conversion
- Document extraction unsuccessful for '{file_name}': unmapped
AI-assisted analysis of zylon-ai/private-gpt@4a030776a3 (2026-08-15).
Data as JSON: /api/errors/f0f269f83e390c2f.
Report an issue: GitHub.