{"record":{"id":"5a237d527fffec25","repo":"BerriAI/litellm","slug":"max-depth-of-default-max-recurse-depth-exceeded-5a237d","errorCode":null,"errorMessage":"Max depth of {DEFAULT_MAX_RECURSE_DEPTH} exceeded while scanning vector_store_id values","messagePattern":"Max depth of (.+?) exceeded while scanning vector_store_id values","errorType":"http","errorClass":"HTTPException","httpStatus":400,"severity":"error","filePath":"litellm/proxy/rag_endpoints/endpoints.py","lineNumber":42,"sourceCode":"from litellm.proxy.common_request_processing import ProxyBaseLLMRequestProcessing\nfrom litellm.proxy.common_utils.http_parsing_utils import (\n    _read_request_body,\n    _safe_get_request_headers,\n    get_form_data,\n)\nfrom litellm.proxy.vector_store_endpoints.utils import (\n    assert_user_can_access_vector_store_id,\n)\nfrom litellm.repositories.table_repositories import ManagedVectorStoresRepository\n\nif TYPE_CHECKING:\n    from litellm.proxy.utils import PrismaClient\n\nrouter: Final = APIRouter()\n\n\ndef _raise_vector_store_scan_depth_exceeded() -> None:\n    raise HTTPException(\n        status_code=400,\n        detail={\"error\": f\"Max depth of {DEFAULT_MAX_RECURSE_DEPTH} exceeded while scanning vector_store_id values\"},\n    )\n\n\ndef _append_payload_to_scan_stack(\n    payload_stack: list[tuple[Any, int]],\n    value: Any,\n    next_depth: int,\n) -> None:\n    if isinstance(value, dict):\n        if next_depth > DEFAULT_MAX_RECURSE_DEPTH:\n            _raise_vector_store_scan_depth_exceeded()\n        payload_stack.append((value, next_depth))\n    elif isinstance(value, list):\n        if next_depth > DEFAULT_MAX_RECURSE_DEPTH:\n            if any(isinstance(item, (dict, list)) for item in value):\n                _raise_vector_store_scan_depth_exceeded()","sourceCodeStart":24,"sourceCodeEnd":60,"githubUrl":"https://github.com/BerriAI/litellm/blob/77b7c6c40c0c5aa5fbcb1d6a1825ac39ca8829b8/litellm/proxy/rag_endpoints/endpoints.py#L24-L60","documentation":"Depth guard in the RAG vector_store_id scanner: while recursively walking the ingest payload collecting 'vector_store_id' values, nesting exceeded DEFAULT_MAX_RECURSE_DEPTH. This is a sentinel guard (via _raise_vector_store_scan_depth_exceeded) against pathological or cyclic payload structures.","triggerScenarios":"Thrown at litellm/proxy/rag_endpoints/endpoints.py:42 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Flatten the request payload so vector_store_id values are not nested deeper than the max recurse depth.","Remove circular/deeply nested structures from the request body."],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"77b7c6c40c0c5aa5fbcb1d6a1825ac39ca8829b8","analyzedAt":"2026-08-18T11:44:31.656Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}