{"record":{"id":"a8379eb100abcdac","repo":"docling-project/docling","slug":"no-pages-to-process","errorCode":null,"errorMessage":"No pages to process.","messagePattern":"No pages to process\\.","errorType":"exception","errorClass":"RuntimeError","httpStatus":null,"severity":"error","filePath":"docling/pipeline/vlm_pipeline.py","lineNumber":442,"sourceCode":"                        component_type=DoclingComponentType.PIPELINE,\n                        module_name=self.__class__.__name__,\n                        error_message=f\"DoclangDeserializer failed: {exc}\",\n                        category=FailureCategory.BACKEND_FAILURE,\n                        page_no=idx + 1,\n                    )\n                )\n                conv_res.status = ConversionStatus.PARTIAL_SUCCESS\n                # Create empty document for failed pages\n                empty_doc = DoclingDocument(name=f\"page_{idx}\")\n                empty_doc.add_page(\n                    page_no=idx + 1,\n                    size=Size(width=img.width, height=img.height),\n                    image=ImageRef.from_pil(image=img, dpi=72),\n                )\n                page_docs.append(empty_doc)\n\n        if not page_docs:\n            raise RuntimeError(\"No pages to process.\")\n\n        if len(page_docs) == 1:\n            return page_docs[0]\n\n        return DoclingDocument.concatenate(docs=page_docs)\n\n    def _turn_dt_into_doc(self, conv_res) -> DoclingDocument:\n        doctags_list = []\n        image_list = []\n        for page in conv_res.pages:\n            predicted_doctags = \"\"\n            img = PILImage.new(\"RGB\", (1, 1), \"rgb(255,255,255)\")\n            if page.predictions.vlm_response:\n                predicted_doctags = page.predictions.vlm_response.text\n            if page.image:\n                img = page.image\n            image_list.append(img)\n            doctags_list.append(predicted_doctags)","sourceCodeStart":424,"sourceCodeEnd":460,"githubUrl":"https://github.com/docling-project/docling/blob/61d76f1ff3f8428065465889f7b4577da7df704c/docling/pipeline/vlm_pipeline.py#L424-L460","documentation":"After iterating the pages of a conversion result, VlmPipeline collects one DoclingDocument per page (real or empty fallback documents for failed pages). If that list ends up empty, there were no pages to merge, and _add_page_metadata_and_concatenate raises 'No pages to process.' before calling DoclingDocument.concatenate. This means the input produced zero initialized pages, e.g. an empty or unreadable document.","triggerScenarios":"Converting a zero-page or corrupt PDF/image whose backend loaded no pages; every page failing before any page document (including fallback empty docs) is appended; a document stream with no page content fed to the VLM pipeline.","commonSituations":"Empty PDF (0 pages) generated by a failed print job; truncated downloads that parse to no pages; test fixtures with blank files; feeding a document whose pages all failed so early that no per-page document was created.","solutions":["Open the input in a viewer or with pypdf to confirm it actually has pages and is not corrupt.","Re-download or regenerate the source document if it is truncated.","Skip such files early in batch processing by checking page count before conversion.","If pages exist but all fail, inspect earlier log messages for the underlying per-page failure (OCR/model errors) and fix that."],"exampleFix":"# before\nresult = converter.convert(Path('empty.pdf'))  # RuntimeError: No pages to process.\n\n# after\nfrom pypdf import PdfReader\nif len(PdfReader('doc.pdf').pages) == 0:\n    skip('doc.pdf')\nelse:\n    result = converter.convert(Path('doc.pdf'))","handlingStrategy":"validation","validationCode":"def has_pages(path) -> bool:\n    from pypdf import PdfReader\n    return len(PdfReader(path).pages) > 0\n\nassert has_pages(p) before convert","typeGuard":null,"tryCatchPattern":"try:\n    result = converter.convert(path)\nexcept RuntimeError as e:\n    if 'No pages to process' in str(e):\n        skip_or_quarantine(path)","preventionTips":["Validate page count / file integrity before batch conversion.","Quarantine zero-page documents in ingestion pipelines instead of letting them abort jobs."],"tags":["vlm","empty-input","pages","validation"],"backgroundTag":null,"analyzedSha":"61d76f1ff3f8428065465889f7b4577da7df704c","analyzedAt":"2026-08-14T23:53:18.727Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}