{"record":{"id":"af4219abb6686ee6","repo":"docling-project/docling","slug":"fetching-local-or-remote-resources-is-only-allowed","errorCode":null,"errorMessage":"Fetching local or remote resources is only allowed when set explicitly. Set 'options.enable_local_fetch=True' or 'options.enable_remote_fetch=True'. Either one or the other needs to be enabled to load taxonomies.","messagePattern":"Fetching local or remote resources is only allowed when set explicitly\\. Set 'options\\.enable_local_fetch=True' or 'options\\.enable_remote_fetch=True'\\. Either one or the other needs to be enabled to load taxonomies\\.","errorType":"exception","errorClass":"OperationNotAllowed","httpStatus":null,"severity":"error","filePath":"docling/backend/xml/xbrl_backend.py","lineNumber":113,"sourceCode":"                \"Please install it using `pip install 'docling-slim[format-xml-xbrl]'`\"\n            ) from _XBRL_IMPORT_ERROR\n\n        super().__init__(in_doc, path_or_stream)\n        self.options: XBRLBackendOptions = options\n        self.model_xbrl: ModelXbrl | None = None\n        self._kv_idx: int = 0\n        self._cells: list[GraphCell] = []\n        self._links: list[GraphLink] = []\n        self._hierarchy_cell_ids: dict[str, int] = {}\n        self._fact_cell_ids: dict[str, list[int]] = defaultdict(list)\n        self._created_links: set[tuple[int, int]] = set()\n\n        try:\n            if (\n                not self.options.enable_local_fetch\n                and not self.options.enable_remote_fetch\n            ):\n                raise OperationNotAllowed(\n                    \"Fetching local or remote resources is only allowed when set\"\n                    \" explicitly. Set 'options.enable_local_fetch=True' or\"\n                    \" 'options.enable_remote_fetch=True'. Either one or the other\"\n                    \" needs to be enabled to load taxonomies.\"\n                )\n            with TemporaryDirectory() as tmpdir:\n                tmp_path: Path = Path(tmpdir)\n                zip_paths: list[str] = []\n                if self.options.taxonomy:\n                    taxonomy: Path = self.options.taxonomy.resolve()\n                    if not taxonomy.is_dir():\n                        raise ValueError(\n                            \"The 'taxonomy' backend option must be a directory\"\n                        )\n                    taxonomy_path = shutil.copytree(\n                        taxonomy, tmp_path, dirs_exist_ok=True\n                    )\n                    zip_paths = [","sourceCodeStart":95,"sourceCodeEnd":131,"githubUrl":"https://github.com/docling-project/docling/blob/61d76f1ff3f8428065465889f7b4577da7df704c/docling/backend/xml/xbrl_backend.py#L95-L131","documentation":"The XBRL backend must load taxonomies to interpret an instance document, and Arelle will fetch them locally or remotely; both fetch modes default to False, so out of the box the backend raises OperationNotAllowed telling you to enable one. This is deliberate: taxonomy resolution touches the filesystem/network, which needs explicit opt-in.","triggerScenarios":"Constructing XBRLBackend (or converting an XBRL file) with default XBRLBackendOptions where enable_local_fetch and enable_remote_fetch are both False — the check fires before any parsing, inside the try block in __init__.","commonSituations":"First XBRL conversion after installing the extra; security-hardened configs that disable fetch globally; air-gapped environments where remote fetch must not be attempted.","solutions":["Set options.enable_local_fetch=True if your taxonomy files are on disk (pass their directory via options.taxonomy).","Set options.enable_remote_fetch=True if taxonomies should be downloaded (e.g. standard SEC/EBA taxonomies); the backend then enables Arelle's web cache with a timeout.","For offline use, mirror the taxonomy locally and combine local fetch with options.taxonomy.","Configure via pipeline options: XBRLFormatOptions/XBRLBackendOptions passed in DocumentConverter format_options."],"exampleFix":"# before\nresult = DocumentConverter().convert(Path(\"report.xbrl\"))  # OperationNotAllowed\n\n# after\nfrom docling.datamodel.pipeline_options import XBRLBackendOptions\nopts = XBRLBackendOptions(enable_remote_fetch=True)\nresult = DocumentConverter(\n    format_options={InputFormat.XML_XBRL: opts}\n).convert(Path(\"report.xbrl\"))","handlingStrategy":"validation","validationCode":"def xbrl_fetch_configured(opts) -> bool:\n    return opts.enable_local_fetch or opts.enable_remote_fetch  # False -> error [97] imminent","typeGuard":null,"tryCatchPattern":"from docling.datamodel.settings import OperationNotAllowed\n\ntry:\n    result = converter.convert(xbrl_path)\nexcept OperationNotAllowed as e:\n    if \"enable_local_fetch\" in str(e):\n        raise ValueError(\"Configure XBRLBackendOptions enable_local_fetch or enable_remote_fetch\") from e\n    raise","preventionTips":["Always construct XBRLBackendOptions with at least one fetch flag set.","Air-gapped: mirror taxonomies locally and use enable_local_fetch + options.taxonomy.","Networked: enable_remote_fetch and rely on Arelle's cache for repeat conversions."],"tags":["xbrl","security","configuration","taxonomy","network","local-files"],"backgroundTag":null,"analyzedSha":"61d76f1ff3f8428065465889f7b4577da7df704c","analyzedAt":"2026-08-14T23:53:18.727Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}