{"record":{"id":"571029728ec43cf7","repo":"BerriAI/litellm","slug":"customsecretmanagerexception-custom-secret-manag","errorCode":null,"errorMessage":"CustomSecretManagerException - custom_secret_manager field is required in key_management_settings","messagePattern":"CustomSecretManagerException - custom_secret_manager field is required in key_management_settings","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"litellm/secret_managers/custom_secret_manager_loader.py","lineNumber":44,"sourceCode":"\n    Raises:\n        ValueError: If required configuration is missing\n        ImportError: If the custom secret manager module cannot be loaded\n    \"\"\"\n\n    if not config_file_path:\n        raise ValueError(\"CustomSecretManagerException - config_file_path is required to load custom secret manager\")\n\n    # Get the custom_secret_manager class path from settings\n    if litellm._key_management_settings is None:\n        raise ValueError(\n            \"CustomSecretManagerException - key_management_settings is required with custom_secret_manager field\"\n        )\n\n    custom_secret_manager_path: Final = getattr(litellm._key_management_settings, \"custom_secret_manager\", None)\n\n    if not custom_secret_manager_path:\n        raise ValueError(\n            \"CustomSecretManagerException - custom_secret_manager field is required in key_management_settings\"\n        )\n\n    # Split into file_name and class_name (e.g., \"my_secret_manager.InMemorySecretManager\")\n    _file_name, _class_name = custom_secret_manager_path.split(\".\")\n    verbose_proxy_logger.debug(\n        \"Initializing custom secret manager: %s, file_name: %s, class_name: %s\",\n        custom_secret_manager_path,\n        _file_name,\n        _class_name,\n    )\n\n    # Load the module from the same directory as config.yaml\n    directory: Final = os.path.dirname(config_file_path)\n    module_file_path: Final = os.path.join(directory, _file_name) + \".py\"\n\n    spec: Final = importlib.util.spec_from_file_location(_class_name, module_file_path)\n    if not spec:","sourceCodeStart":26,"sourceCodeEnd":62,"githubUrl":"https://github.com/BerriAI/litellm/blob/77b7c6c40c0c5aa5fbcb1d6a1825ac39ca8829b8/litellm/secret_managers/custom_secret_manager_loader.py#L26-L62","documentation":"Config guard: key_management_settings exists but its custom_secret_manager field is empty/None, so there is no 'file.ClassName' path to import. Sentinel ValueError naming the missing settings field as the faulty input.","triggerScenarios":"Thrown at litellm/secret_managers/custom_secret_manager_loader.py:44 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Set the custom_secret_manager field inside key_management_settings to the dotted path of your CustomSecretManager subclass.","Confirm the field name is spelled exactly 'custom_secret_manager' in the config."],"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"}