{"record":{"id":"b0786241a08fe4a7","repo":"zylon-ai/private-gpt","slug":"no-valid-document-content-found-after-conversion","errorCode":null,"errorMessage":"No valid document content found after conversion","messagePattern":"No valid document content found after conversion","errorType":"exception","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"private_gpt/components/readers/docling/docling_api_reader.py","lineNumber":181,"sourceCode":"        pages = file_info.config.get(\"pages\", None)\n\n        try:\n            conversion_result = await self.client.convert_from_bytes(\n                file_name, file_bytes, to_formats=[\"md\"], pages=pages, **load_kwargs\n            )\n        except Exception as e:\n            raise ValueError(f\"Document conversion failed: {e}\") from e\n\n        if conversion_result.status not in [\"success\", \"partial_success\"]:\n            raise ValueError(\n                f\"Document conversion failed with status: {conversion_result.status}. \"\n                f\"Errors: {conversion_result.errors}\"\n            )\n\n        contents = self._get_content(conversion_result)\n        valid_contents = [content for content in contents if content]\n        if not valid_contents:\n            raise ValueError(\"No valid document content found after conversion\")\n        if self._is_extraction_unsuccessful(valid_contents):\n            raise ExtractionUnsuccessfulError(\n                f\"Document extraction unsuccessful for '{file_name}': unmapped-glyph \"\n                f\"ratio exceeded threshold ({self.config.failure_threshold}).\"\n            )\n\n        docs = [\n            self._page_to_doc(\n                content=content,\n                index=idx,\n                include_page_metadata=len(valid_contents) > 1,\n                extra_info=extra_info,\n            )\n            for idx, content in enumerate(valid_contents)\n        ]\n\n        if debug_mode:\n            logger.info(f\"Loaded document from {file_name}\")","sourceCodeStart":163,"sourceCodeEnd":199,"githubUrl":"https://github.com/zylon-ai/private-gpt/blob/4a030776a31a901ad80b1bf4d7faa2c1a367efbb/private_gpt/components/readers/docling/docling_api_reader.py#L163-L199","documentation":"Raised by DoclingApiReader.lazy_load_data after a successful conversion when every page-content string produced by _get_content is empty (valid_contents filters out falsy entries and the list ends up empty). The server returned content-bearing fields, but after page splitting on the PAGE_PLACEHOLDER marker each fragment is blank/whitespace — so there is genuinely nothing to embed.","triggerScenarios":"Conversion returns a single empty page or all pages split to empty strings: page-range selections pointing at blank pages (pages config), documents whose text is entirely images with OCR off, placeholder-only content that the post-processing strips.","commonSituations":"Ingesting with a 'pages' filter that selects trailing blank pages; scanned documents with OCR disabled; test/placeholder PDFs generated with no text; trimmed exports where text lives in annotations not body content.","solutions":["Remove or widen the pages filter in the file config so real content pages are included.","Verify with an external tool (pdftotext) that the selected pages actually contain text; if not, enable OCR (docling.use_ocr + langs).","Skip files that legitimately have no text at the pipeline level (a separate emptiness check) instead of sending them to Docling."],"exampleFix":null,"handlingStrategy":"validation","validationCode":"# validate a requested page range actually has text before ingesting\nimport pypdf\n\ndef page_range_has_text(path: str, pages) -> bool:\n    reader = pypdf.PdfReader(path)\n    idx = pages if pages else range(len(reader.pages))\n    return any(reader.pages[i].extract_text().strip() for i in idx)","typeGuard":null,"tryCatchPattern":"try:\n    nodes = [n async for n in reader.lazy_load_data(file_info)]\nexcept ValueError as e:\n    if \"No valid document content\" in str(e):\n        logger.warning(\"skipping empty document %s\", file_info.file_name)\n        return []\n    raise","preventionTips":["Double-check the pages config points at content-bearing pages.","Treat empty-output files as skip candidates, not crashes: catch and continue the batch."],"tags":["docling","empty-result","ingestion","page-range"],"backgroundTag":null,"analyzedSha":"4a030776a31a901ad80b1bf4d7faa2c1a367efbb","analyzedAt":"2026-08-15T03:51:26.951Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}