From 73a8e8cf07535cbd5ab648ed0939219a70543591 Mon Sep 17 00:00:00 2001 From: Ryan Crabbe Date: Thu, 5 Mar 2026 17:40:51 -0800 Subject: [PATCH] fix(vault): resolve merge conflict, use async auth, include error details - Remove duplicate description kwarg in supported_db_objects Field() that caused SyntaxError preventing proxy startup - Wrap sync _get_request_headers() in asyncio.to_thread to avoid blocking the event loop during AppRole/TLS cert auth - Include exception messages in error responses for admin-only endpoints to aid debugging --- litellm/proxy/_types.py | 1 - .../management_endpoints/config_override_endpoints.py | 9 +++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/litellm/proxy/_types.py b/litellm/proxy/_types.py index 12f6cdf600d..da7e1f5a049 100644 --- a/litellm/proxy/_types.py +++ b/litellm/proxy/_types.py @@ -2169,7 +2169,6 @@ class ConfigGeneralSettings(LiteLLMPydanticObjectBase): supported_db_objects: Optional[List[SupportedDBObjectType]] = Field( None, description="Fine-grained control over which object types to load from the database when store_model_in_db is True. Available types: 'models', 'mcp', 'guardrails', 'vector_stores', 'pass_through_endpoints', 'prompts', 'model_cost_map', 'tools', 'config_overrides'. If not set, all objects are loaded (default behavior).", - description="Fine-grained control over which object types to load from the database when store_model_in_db is True. Available types: 'models', 'mcp', 'guardrails', 'vector_stores', 'pass_through_endpoints', 'prompts', 'model_cost_map', 'tools'. If not set, all objects are loaded (default behavior).", ) user_mcp_management_mode: Optional[UserMCPManagementMode] = Field( None, diff --git a/litellm/proxy/management_endpoints/config_override_endpoints.py b/litellm/proxy/management_endpoints/config_override_endpoints.py index 78cb91b3483..f1d6cacf1e7 100644 --- a/litellm/proxy/management_endpoints/config_override_endpoints.py +++ b/litellm/proxy/management_endpoints/config_override_endpoints.py @@ -1,3 +1,4 @@ +import asyncio import json import os from typing import Any, Dict, Set @@ -216,7 +217,7 @@ async def update_hashicorp_vault_config( ) raise HTTPException( status_code=500, - detail="Failed to initialize secret manager", + detail=f"Failed to initialize secret manager: {e}", ) # Only persist to DB after successful init @@ -378,11 +379,11 @@ async def test_hashicorp_vault_connection( # Step 1: Authenticate (exercises AppRole login, TLS cert login, or direct token) try: - headers = client._get_request_headers() + headers = await asyncio.to_thread(client._get_request_headers) except Exception as e: raise HTTPException( status_code=502, - detail="Vault authentication failed", + detail=f"Vault authentication failed: {e}", ) # Step 2: Verify the token is valid via token/lookup-self @@ -396,7 +397,7 @@ async def test_hashicorp_vault_connection( except Exception as e: raise HTTPException( status_code=502, - detail="Vault token validation failed", + detail=f"Vault token validation failed: {e}", ) return {