{"record":{"id":"24e608df68bf496b","repo":"docling-project/docling","slug":"extraction-failed-for-ext-res-input-file-with-s","errorCode":null,"errorMessage":"Extraction failed for: {ext_res.input.file} with status: {ext_res.status.value}.{error_details}","messagePattern":"Extraction failed for: (.+?) with status: (.+?)\\.(.+?)","errorType":"exception","errorClass":"ConversionError","httpStatus":null,"severity":"error","filePath":"docling/document_extractor.py","lineNumber":183,"sourceCode":"            path_or_stream_iterator=source, limits=limits, headers=headers\n        )\n\n        ext_res_iter = self._extract(\n            conv_input, raises_on_error=raises_on_error, template=template\n        )\n\n        had_result = False\n        for ext_res in ext_res_iter:\n            had_result = True\n            if raises_on_error and ext_res.status not in {\n                ConversionStatus.SUCCESS,\n                ConversionStatus.PARTIAL_SUCCESS,\n            }:\n                error_details = \"\"\n                if ext_res.errors:\n                    error_messages = [err.error_message for err in ext_res.errors]\n                    error_details = f\" Errors: {'; '.join(error_messages)}\"\n                raise ConversionError(\n                    f\"Extraction failed for: {ext_res.input.file} with status: {ext_res.status.value}.{error_details}\"\n                )\n            else:\n                yield ext_res\n\n        if not had_result and raises_on_error:\n            raise ConversionError(\n                \"Extraction failed because the provided file has no recognizable format or it wasn't in the list of allowed formats.\"\n            )\n\n    # --------------------------- Internal engine ------------------------------\n\n    def _extract(\n        self,\n        conv_input: _DocumentConversionInput,\n        raises_on_error: bool,\n        template: ExtractionTemplateType,\n    ) -> Iterator[ExtractionResult]:","sourceCodeStart":165,"sourceCodeEnd":201,"githubUrl":"https://github.com/docling-project/docling/blob/61d76f1ff3f8428065465889f7b4577da7df704c/docling/document_extractor.py#L165-L201","documentation":"ConversionError raised by DocumentExtractor.extract() when raises_on_error=True and at least one ExtractionResult came back with a status other than SUCCESS/PARTIAL_SUCCESS. The message aggregates the per-result error_message entries so the underlying cause (model failure, backend error) is visible.","triggerScenarios":"extractor.extract(files, raises_on_error=True) (the default) where the pipeline executes but the result status is FAILURE, with details appended from result.errors.","commonSituations":"VLM extraction model fails to load or times out mid-run; a corrupted or password-protected PDF produces backend errors; OOM or GPU errors during batch extraction with raises_on_error left at default.","solutions":["Read the appended 'Errors: ...' details in the message; they identify the actual failing stage (backend vs model).","Call extract(..., raises_on_error=False) and handle failures per result by checking ext_res.status and ext_res.errors.","Fix the root cause reported in error_details (e.g. free GPU memory, repair the input file, install model artifacts)."],"exampleFix":"# before\nresults = extractor.extract(files)  # raises on first failed doc, aborts batch\n\n# after\nresults = extractor.extract(files, raises_on_error=False)\nfor res in results:\n    if res.status not in (ConversionStatus.SUCCESS, ConversionStatus.PARTIAL_SUCCESS):\n        print('failed:', res.input.file, [e.error_message for e in res.errors])","handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"from docling.datamodel.base_models import ConversionError\ntry:\n    results = list(extractor.extract(files))\nexcept ConversionError as e:\n    log.error('extraction failed: %s', e)  # message includes per-result Errors: details\n    results = list(extractor.extract(files, raises_on_error=False))","preventionTips":["Use raises_on_error=False for batch jobs and check result.status / result.errors per document.","Log ext_res.errors messages to identify the failing backend or model early."],"tags":["extraction","error-handling","pipeline"],"backgroundTag":null,"analyzedSha":"61d76f1ff3f8428065465889f7b4577da7df704c","analyzedAt":"2026-08-14T23:53:18.727Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}