{"record":{"id":"7ebd5a6a08b08cd1","repo":"run-llama/llama_index","slug":"unknown-doc-type-doc-type","errorCode":null,"errorMessage":"Unknown doc type: {doc_type}","messagePattern":"Unknown doc type: (.+?)","errorType":"exception","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"llama-index-core/llama_index/core/storage/docstore/utils.py","lineNumber":46,"sourceCode":"        return legacy_json_to_doc(doc_dict)\n    else:\n        if doc_type == Document.get_type():\n            if data_dict[\"class_name\"] == ImageDocument.class_name():\n                doc = ImageDocument.from_dict(data_dict)\n            else:\n                doc = Document.from_dict(data_dict)\n        elif doc_type == Node.get_type():\n            doc = Node.from_dict(data_dict)\n        elif doc_type == TextNode.get_type():\n            doc = TextNode.from_dict(data_dict)\n        elif doc_type == ImageNode.get_type():\n            doc = ImageNode.from_dict(data_dict)\n        elif doc_type == IndexNode.get_type():\n            doc = IndexNode.from_dict(data_dict)\n        elif doc_type == Node.get_type():\n            doc = Node.from_dict(data_dict)\n        else:\n            raise ValueError(f\"Unknown doc type: {doc_type}\")\n\n        return doc\n\n\ndef legacy_json_to_doc(doc_dict: dict) -> BaseNode:\n    \"\"\"Todo: Deprecated legacy support for old node versions.\"\"\"\n    doc_type = doc_dict[TYPE_KEY]\n    data_dict = doc_dict[DATA_KEY]\n    doc: BaseNode\n\n    text = data_dict.get(\"text\", \"\")\n    metadata = data_dict.get(\"extra_info\", {}) or {}\n    id_ = data_dict.get(\"doc_id\", None)\n\n    relationships = data_dict.get(\"relationships\", {})\n    relationships = {\n        NodeRelationship(k): RelatedNodeInfo(node_id=str(v))\n        for k, v in relationships.items()","sourceCodeStart":28,"sourceCodeEnd":64,"githubUrl":"https://github.com/run-llama/llama_index/blob/afd0fef371831f9bda13e5af7167cf4e981278ab/llama-index-core/llama_index/core/storage/docstore/utils.py#L28-L64","documentation":"Error \"Unknown doc type: {doc_type}\" thrown in run-llama/llama_index.","triggerScenarios":"Thrown at llama-index-core/llama_index/core/storage/docstore/utils.py:46 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Use a known doc_type such as the one produced by the node's class_name.","Register or map the custom doc type before converting docstore JSON to a node."],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"afd0fef371831f9bda13e5af7167cf4e981278ab","analyzedAt":"2026-08-15T05:42:58.429Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}