{"record":{"id":"c47348aa4c6fa58a","repo":"docling-project/docling","slug":"no-pipeline-could-be-initialized-for-format-forma","errorCode":null,"errorMessage":"No pipeline could be initialized for format {format}","messagePattern":"No pipeline could be initialized for format (.+?)","errorType":"exception","errorClass":"ConversionError","httpStatus":null,"severity":"error","filePath":"docling/document_converter.py","lineNumber":438,"sourceCode":"        ).hexdigest()\n\n    def initialize_pipeline(self, format: InputFormat):\n        \"\"\"Initialize the conversion pipeline for the selected format.\n\n        Args:\n            format: The input format for which to initialize the pipeline.\n\n        Raises:\n            ConversionError: If no pipeline could be initialized for the\n                given format.\n            RuntimeError: If `artifacts_path` is set in\n                `docling.datamodel.settings.settings` when required by\n                the pipeline, but points to a non-directory file.\n            FileNotFoundError: If local model files are not found.\n        \"\"\"\n        pipeline = self._get_pipeline(doc_format=format)\n        if pipeline is None:\n            raise ConversionError(\n                f\"No pipeline could be initialized for format {format}\"\n            )\n\n    @validate_call(config=ConfigDict(strict=True))\n    def convert(\n        self,\n        source: Union[Path, str, DocumentStream, HttpSource],  # TODO review naming\n        headers: Optional[dict[str, str]] = None,\n        raises_on_error: bool = True,\n        max_num_pages: int = sys.maxsize,\n        max_file_size: int = sys.maxsize,\n        page_range: PageRange = DEFAULT_PAGE_RANGE,\n    ) -> ConversionResult:\n        \"\"\"Convert one document fetched from a file path, URL, or DocumentStream.\n\n        Note: If the document content is given as a string (Markdown or HTML\n        content), use the `convert_string` method.\n","sourceCodeStart":420,"sourceCodeEnd":456,"githubUrl":"https://github.com/docling-project/docling/blob/61d76f1ff3f8428065465889f7b4577da7df704c/docling/document_converter.py#L420-L456","documentation":"_initialize_pipeline calls _get_pipeline(format) and raises ConversionError when it returns None — i.e. no registered pipeline accepts the given input format. Pipelines come from the format_options map (defaults or user-provided); a format with no matching FormatOption, or one whose pipeline class rejects the format, yields None. The docstring also notes related failures for bad artifacts_path and missing local model files.","triggerScenarios":"DocumentConverter.initialize_pipeline(InputFormat.X) where no FormatOption/pipeline covers X; restricting format_options so the requested format has no entry; passing a format the selected pipeline's accepts_format does not include.","commonSituations":"Custom converters built with only some format_options and then fed a document of another type; slim installs lacking default pipelines; formats filtered out via allowed_formats but converted anyway.","solutions":["Add a FormatOption for the format (or use full defaults) when constructing DocumentConverter.","Check InputFormat detection before converting and route unsupported types elsewhere.","Catch ConversionError and surface a clear 'unsupported format' message to your users."],"exampleFix":"# before\nconverter = DocumentConverter(format_options={InputFormat.PDF: PdfFormatOption()})\nconverter.initialize_pipeline(InputFormat.HTML)  # raises\n\n# after\nconverter = DocumentConverter(  # defaults cover HTML\n    format_options={InputFormat.PDF: PdfFormatOption()},\n)","handlingStrategy":"validation","validationCode":"supported = set(converter.format_to_options.keys()) if hasattr(converter, \"format_to_options\") else None\nif supported is not None and fmt not in supported:\n    raise ValueError(f\"No pipeline for {fmt}; known: {sorted(supported)}\")","typeGuard":null,"tryCatchPattern":"try:\n    converter.initialize_pipeline(fmt)\nexcept ConversionError as e:\n    if \"No pipeline\" in str(e):\n        raise ValueError(f\"Unsupported input format: {fmt}\") from e\n    raise","preventionTips":["Initialize pipelines only for formats present in your format_options map.","Use default DocumentConverter construction unless you deliberately restrict formats."],"tags":["pipeline","input-format","document-converter","conversion","configuration"],"backgroundTag":null,"analyzedSha":"61d76f1ff3f8428065465889f7b4577da7df704c","analyzedAt":"2026-08-14T23:53:18.727Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}