{"record":{"id":"24294fc19a9c2a99","repo":"run-llama/llama_index","slug":"there-is-no-root-nodes-in-given-nodes","errorCode":null,"errorMessage":"There is no root nodes in given nodes!","messagePattern":"There is no root nodes in given nodes!","errorType":"exception","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"llama-index-core/llama_index/core/node_parser/relational/hierarchical.py","lineNumber":67,"sourceCode":"\n        children_ids.extend([r.node_id for r in (node.child_nodes or [])])\n\n    child_nodes = []\n    for candidate_node in all_nodes:\n        if candidate_node.node_id not in children_ids:\n            continue\n        child_nodes.append(candidate_node)\n\n    return child_nodes\n\n\ndef get_deeper_nodes(nodes: List[BaseNode], depth: int = 1) -> List[BaseNode]:\n    \"\"\"Get children of root nodes in given nodes that have given depth.\"\"\"\n    if depth < 0:\n        raise ValueError(\"Depth cannot be a negative number!\")\n    root_nodes = get_root_nodes(nodes)\n    if not root_nodes:\n        raise ValueError(\"There is no root nodes in given nodes!\")\n\n    deeper_nodes = root_nodes\n    for _ in range(depth):\n        deeper_nodes = get_child_nodes(deeper_nodes, nodes)\n\n    return deeper_nodes\n\n\nclass HierarchicalNodeParser(NodeParser):\n    \"\"\"\n    Hierarchical node parser.\n\n    Splits a document into a recursive hierarchy Nodes using a NodeParser.\n\n    NOTE: this will return a hierarchy of nodes in a flat list, where there will be\n    overlap between parent nodes (e.g. with a bigger chunk size), and child nodes\n    per parent (e.g. with a smaller chunk size).\n","sourceCodeStart":49,"sourceCodeEnd":85,"githubUrl":"https://github.com/run-llama/llama_index/blob/afd0fef371831f9bda13e5af7167cf4e981278ab/llama-index-core/llama_index/core/node_parser/relational/hierarchical.py#L49-L85","documentation":"Error \"There is no root nodes in given nodes!\" thrown in run-llama/llama_index.","triggerScenarios":"Thrown at llama-index-core/llama_index/core/node_parser/relational/hierarchical.py:67 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Include at least one root-level node in the input nodes.","Verify the nodes were produced by the hierarchical parser and contain root nodes."],"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-15T22:17:37.221Z"}