{"record":{"id":"200ef02f0d01bb04","repo":"docling-project/docling","slug":"the-following-rapidocr-paths-do-not-exist-listed","errorCode":null,"errorMessage":"The following RapidOCR paths do not exist:\n{listed}","messagePattern":"The following RapidOCR paths do not exist:\n(.+?)","errorType":"exception","errorClass":"FileNotFoundError","httpStatus":null,"severity":"error","filePath":"docling/models/stages/ocr/rapid_ocr_model.py","lineNumber":334,"sourceCode":"            rec_model_path = self.options.rec_model_path\n            rec_keys_path = self.options.rec_keys_path\n            font_path = self.options.font_path\n\n            # A pinned path that does not exist is a configuration error\n            missing_pinned = [\n                model_path\n                for model_path in (\n                    det_model_path,\n                    cls_model_path,\n                    rec_model_path,\n                    rec_keys_path,\n                    font_path,\n                )\n                if model_path is not None and not Path(model_path).exists()\n            ]\n            if missing_pinned:\n                listed = \"\\n\".join(f\"  - {path}\" for path in missing_pinned)\n                raise FileNotFoundError(\n                    f\"The following RapidOCR paths do not exist:\\n{listed}\"\n                )\n\n            # Params forwarded to RapidOCR only in the library-managed flow (no artifacts_path)\n            lang_params: dict[str, object] = {}\n\n            if artifacts_path is not None:\n                # artifacts_path means fully-offline operation\n                target_dir = artifacts_path / self._model_repo_folder\n                artifacts: dict[str, _RapidOcrArtifact] = _rapidocr_artifacts(\n                    target_dir,\n                    backend_enum,\n                    ppocr_version,\n                    rec_lang,\n                    need_det=det_model_path is None,\n                    need_cls=cls_model_path is None,\n                    need_rec=rec_model_path is None,\n                )","sourceCodeStart":316,"sourceCodeEnd":352,"githubUrl":"https://github.com/docling-project/docling/blob/61d76f1ff3f8428065465889f7b4577da7df704c/docling/models/stages/ocr/rapid_ocr_model.py#L316-L352","documentation":"RapidOcrOptions lets you pin individual model artifact paths (det/cls/rec model files, rec keys, font). Before initializing the engine, Docling checks every non-None pinned path exists on disk; any missing file is collected into a FileNotFoundError listing all of them at once.","triggerScenarios":"Setting det_model_path / cls_model_path / rec_model_path / rec_keys_path / font_path on RapidOcrOptions to paths that do not exist — wrong absolute path, moved artifacts directory, or a relative path interpreted from a different working directory.","commonSituations":"Hardcoded paths from another machine; artifacts downloaded into a different location than the config points to; relative paths breaking when the process cwd changes (container, service, notebook).","solutions":["Correct each listed path so it points at an existing file (the error lists every offender).","Prefer absolute pathlib.Path values for pinned artifacts to avoid cwd-dependent resolution.","If you want RapidOCR to manage downloads itself, unset the pinned path(s) (leave them None)."],"exampleFix":"# before\nRapidOcrOptions(det_model_path=\"models/det.onnx\")  # cwd-dependent, missing\n\n# after\nfrom pathlib import Path\nRapidOcrOptions(det_model_path=str(Path(\"/opt/models\").resolve() / \"det.onnx\"))","handlingStrategy":"validation","validationCode":"from pathlib import Path\n\npinned = {\n    \"det_model_path\": det, \"cls_model_path\": cls, \"rec_model_path\": rec,\n    \"rec_keys_path\": keys, \"font_path\": font,\n}\nmissing = [k for k, v in pinned.items() if v is not None and not Path(v).is_file()]\nif missing:\n    raise ConfigError(f\"RapidOCR pinned paths missing: {missing}\")","typeGuard":null,"tryCatchPattern":"try:\n    RapidOcrModel(options=RapidOcrOptions(det_model_path=..., ...))\nexcept FileNotFoundError as e:\n    log.error(\"pinned RapidOCR artifacts unavailable: %s\", e)\n    raise  # do not silently fall back to different models","preventionTips":["Store pinned model paths in one config section and validate all of them at startup.","Use absolute paths from a single ARTIFACTS_DIR constant.","Checksum or existence-check artifacts as part of deployment verification."],"tags":["ocr","rapidocr","file-path","configuration"],"backgroundTag":null,"analyzedSha":"61d76f1ff3f8428065465889f7b4577da7df704c","analyzedAt":"2026-08-14T23:53:18.727Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}