{"record":{"id":"62e0e08f14ed6aeb","repo":"docling-project/docling","slug":"pipeline-self-class-name-failed","errorCode":null,"errorMessage":"Pipeline {self.__class__.__name__} failed","messagePattern":"Pipeline (.+?) failed","errorType":"exception","errorClass":"RuntimeError","httpStatus":null,"severity":"error","filePath":"docling/pipeline/base_pipeline.py","lineNumber":94,"sourceCode":"                conv_res = self._assemble_document(conv_res)\n                # From this stage, all operations should rely only on conv_res.output\n                conv_res = self._enrich_document(conv_res)\n                conv_res.status = self._determine_status(conv_res)\n                # A document that completed but recorded errors is not a clean\n                # success: never report SUCCESS while conv_res.errors is non-empty.\n                if conv_res.status == ConversionStatus.SUCCESS and conv_res.errors:\n                    conv_res.status = ConversionStatus.PARTIAL_SUCCESS\n        except Exception as e:\n            conv_res.status = ConversionStatus.FAILURE\n            if not raises_on_error:\n                error_item = ErrorItem(\n                    component_type=DoclingComponentType.PIPELINE,\n                    module_name=self.__class__.__name__,\n                    error_message=str(e),\n                )\n                conv_res.errors.append(error_item)\n            else:\n                raise RuntimeError(f\"Pipeline {self.__class__.__name__} failed\") from e\n        finally:\n            self._unload(conv_res)\n\n        return conv_res\n\n    @abstractmethod\n    def _build_document(self, conv_res: ConversionResult) -> ConversionResult:\n        pass\n\n    def _assemble_document(self, conv_res: ConversionResult) -> ConversionResult:\n        return conv_res\n\n    def _enrich_document(self, conv_res: ConversionResult) -> ConversionResult:\n        def _prepare_elements(\n            conv_res: ConversionResult, model: GenericEnrichmentModel[Any]\n        ) -> Iterable[NodeItem]:\n            for doc_element, _level in conv_res.document.iterate_items():\n                prepared_element = model.prepare_element(","sourceCodeStart":76,"sourceCodeEnd":112,"githubUrl":"https://github.com/docling-project/docling/blob/61d76f1ff3f8428065465889f7b4577da7df704c/docling/pipeline/base_pipeline.py#L76-L112","documentation":"BasePipeline.execute wraps the whole build/enrich flow; if any stage raises and raises_on_error is True, the pipeline marks the result FAILURE and re-raises the original exception chained to RuntimeError('Pipeline <Name> failed'). With raises_on_error=False the error is instead recorded in conv_res.errors and the exception is swallowed. This error is therefore a wrapper — the real cause is always in __cause__.","triggerScenarios":"DocumentConverter(..., raises_on_error=True).convert(doc) when any model in build_pipe/enrichment_pipe raises (model load failure, OCR crash, bad page data). The class name in the message tells you which pipeline (e.g. StandardPdfPipeline) but not which stage.","commonSituations":"Default CLI behaviour (raises_on_error=True); debugging a batch job that stops on the first bad document; users reading only the wrapper message and missing the 'The above exception was the direct cause' traceback section.","solutions":["Read the chained cause: except RuntimeError as e: inspect e.__cause__ — fix that underlying exception","For batch robustness, convert with raises_on_error=False and check conv_res.status / conv_res.errors per document","Reproduce with logging enabled (DOCLING_LOG_LEVEL=DEBUG) to identify the failing stage before the wrap"],"exampleFix":"# before\nconv_res = converter.convert(doc)  # raises RuntimeError('Pipeline StandardPdfPipeline failed')\n\n# after\nfrom docling.datamodel.base_models import ConversionStatus\nconv_res = converter.convert(doc)\nif conv_res.status != ConversionStatus.SUCCESS:\n    for err in conv_res.errors:\n        print(err.module_name, err.error_message)","handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"try:\n    conv_res = converter.convert(doc)\nexcept RuntimeError as e:\n    if e.__cause__ is not None:\n        log.error('underlying failure: %r', e.__cause__)\n    # record and continue the batch\n    results.append((doc, e.__cause__ or e))","preventionTips":["Use raises_on_error=False for batch workloads and branch on conv_res.status/errors instead","Always inspect __cause__ / full traceback — the wrapper message alone identifies no root cause","Log conv_res.errors entries when status is PARTIAL_SUCCESS to catch near-failures"],"tags":["pipeline","error-wrapping","raises-on-error","batch"],"backgroundTag":null,"analyzedSha":"61d76f1ff3f8428065465889f7b4577da7df704c","analyzedAt":"2026-08-14T23:53:18.727Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}