{"record":{"id":"09eee39bdc64d121","repo":"BerriAI/litellm","slug":"managed-resource-not-found","errorCode":null,"errorMessage":"Managed resource not found.","messagePattern":"Managed resource not found\\.","errorType":"http","errorClass":"HTTPException","httpStatus":404,"severity":"error","filePath":"litellm/proxy/pass_through_endpoints/managed_id_rewriter.py","lineNumber":386,"sourceCode":"                )\n    else:\n        # Object table (batches, responses)\n        if prisma_client is not None:\n            try:\n                obj_row: Final = await _object_table(prisma_client).find_first(where={\"unified_object_id\": managed_id})\n                if obj_row is not None:\n                    row_created_by = obj_row.created_by\n                    row_team_id = obj_row.team_id\n                    found = True\n            except Exception:\n                verbose_proxy_logger.debug(\n                    \"managed_id_rewriter._resolve_one: object DB lookup failed\",\n                    exc_info=True,\n                )\n\n    # 3. Hard 404 for unknown / forged IDs — NEVER forward to upstream\n    if not found:\n        raise HTTPException(\n            status_code=404,\n            detail=\"Managed resource not found.\",\n        )\n\n    # 4. Access check\n    if not can_access_resource(user_api_key_dict, row_created_by, row_team_id):\n        raise HTTPException(\n            status_code=403,\n            detail=\"Access denied to managed resource.\",\n        )\n\n    return payload.raw_provider_id\n\n\nasync def _guard_raw_provider_id(\n    raw_id: str,\n    provider: str,\n    user_api_key_dict: UserAPIKeyAuth,","sourceCodeStart":368,"sourceCodeEnd":404,"githubUrl":"https://github.com/BerriAI/litellm/blob/77b7c6c40c0c5aa5fbcb1d6a1825ac39ca8829b8/litellm/proxy/pass_through_endpoints/managed_id_rewriter.py#L368-L404","documentation":"Hard 404 raised in _resolve_one when a decoded managed ID matches no row in either the stream table or the object table (batches/responses); unknown or forged IDs are never forwarded upstream as literal strings.","triggerScenarios":"Thrown at litellm/proxy/pass_through_endpoints/managed_id_rewriter.py:386 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Verify the managed ID exists (list managed resources via the management API); it may have been deleted or expired.","Mint a new managed ID if the resource was removed."],"exampleFix":null,"handlingStrategy":"type-guard","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"}