{"record":{"id":"df43e39dcd3f7605","repo":"langchain-ai/langchain","slug":"reference-path-not-found","errorCode":null,"errorMessage":"Reference '{path}' not found.","messagePattern":"Reference '(.+?)' not found\\.","errorType":"exception","errorClass":"KeyError","httpStatus":null,"severity":"error","filePath":"libs/core/langchain_core/utils/json_schema.py","lineNumber":41,"sourceCode":"        A deep copy of the referenced object (dict or list).\n\n    Raises:\n        ValueError: If the path does not start with `'#'`.\n        KeyError: If the reference path is not found in the schema.\n    \"\"\"\n    components = path.split(\"/\")\n    if components[0] != \"#\":\n        msg = (\n            \"ref paths are expected to be URI fragments, meaning they should start \"\n            \"with #.\"\n        )\n        raise ValueError(msg)\n    out: list[Any] | dict[Any, Any] = schema\n    for component in components[1:]:\n        if component in out:\n            if isinstance(out, list):\n                msg = f\"Reference '{path}' not found.\"\n                raise KeyError(msg)\n            out = out[component]\n        elif component.isdigit():\n            index = int(component)\n            if (isinstance(out, list) and 0 <= index < len(out)) or (\n                isinstance(out, dict) and index in out\n            ):\n                out = out[index]\n            else:\n                msg = f\"Reference '{path}' not found.\"\n                raise KeyError(msg)\n        else:\n            msg = f\"Reference '{path}' not found.\"\n            raise KeyError(msg)\n    return deepcopy(out)\n\n\ndef _process_dict_properties(\n    properties: dict[str, Any],","sourceCodeStart":23,"sourceCodeEnd":59,"githubUrl":"https://github.com/langchain-ai/langchain/blob/e32fa9a52eab3b61ad7a45399bfde59b3e580fc4/libs/core/langchain_core/utils/json_schema.py#L23-L59","documentation":"Error \"Reference '{path}' not found.\" thrown in langchain-ai/langchain.","triggerScenarios":"Raised when a JSON Schema $ref fragment path points to a location that does not exist in the schema being dereferenced.","commonSituations":"See trigger scenarios.","solutions":["Verify the '$ref' path points to an existing node in the schema (e.g. '#/definitions/X' requires a 'definitions' object containing 'X').","Inline the referenced subschema, or fix the schema so the referenced key exists."],"exampleFix":"schema['definitions'] = {'MyModel': {...}}  # then '#/definitions/MyModel' resolves","handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"e32fa9a52eab3b61ad7a45399bfde59b3e580fc4","analyzedAt":"2026-08-14T18:42:09.092Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}