{"record":{"id":"52a7854454224f4c","repo":"BerriAI/litellm","slug":"master-key-not-set-for-proxy-set-litellm-master","errorCode":null,"errorMessage":"Master Key not set for Proxy. Set `LITELLM_MASTER_KEY` in .env or general_settings:master_key in config.yaml.","messagePattern":"Master Key not set for Proxy\\. Set `LITELLM_MASTER_KEY` in \\.env or general_settings:master_key in config\\.yaml\\.","errorType":"http","errorClass":"ProxyException","httpStatus":500,"severity":"error","filePath":"litellm/proxy/management_endpoints/ui_sso.py","lineNumber":2136,"sourceCode":"async def saml_callback(request: Request):\n    \"\"\"Assertion Consumer Service. Validates the IdP assertion and issues a UI session.\"\"\"\n    from litellm.proxy.proxy_server import (\n        general_settings,\n        jwt_handler,\n        master_key,\n        premium_user,\n        prisma_client,\n        user_api_key_cache,\n    )\n\n    _disable_ui_flag: Final = os.getenv(\"DISABLE_ADMIN_UI\")\n    if _disable_ui_flag is not None and str_to_bool(value=_disable_ui_flag):\n        return admin_ui_disabled()\n\n    if prisma_client is None:\n        raise HTTPException(status_code=500, detail=CommonProxyErrors.db_not_connected_error.value)\n    if master_key is None:\n        raise ProxyException(\n            message=\"Master Key not set for Proxy. Set `LITELLM_MASTER_KEY` in .env or general_settings:master_key in config.yaml.\",\n            type=ProxyErrorTypes.auth_error,\n            param=\"master_key\",\n            code=status.HTTP_500_INTERNAL_SERVER_ERROR,\n        )\n\n    post_data: Final = await SAMLAuthHandler.read_acs_post_data(request)\n    if \"SAMLResponse\" not in post_data:\n        raise HTTPException(status_code=400, detail=\"Missing SAMLResponse in callback request.\")\n\n    result: Final = await SAMLAuthHandler.handle_acs(request=request, cache=user_api_key_cache, post_data=post_data)\n\n    await _raise_if_sso_exceeds_free_user_limit(premium_user, prisma_client)\n\n    ui_access_mode: Final = general_settings.get(\"ui_access_mode\", None)\n    relay_state: Final = post_data.get(\"RelayState\")\n    cp_return_to: Final[str | None] = (\n        relay_state","sourceCodeStart":2118,"sourceCodeEnd":2154,"githubUrl":"https://github.com/BerriAI/litellm/blob/77b7c6c40c0c5aa5fbcb1d6a1825ac39ca8829b8/litellm/proxy/management_endpoints/ui_sso.py#L2118-L2154","documentation":"Error \"Master Key not set for Proxy. Set `LITELLM_MASTER_KEY` in .env or general_settings:master_key in config.yaml.\" thrown in BerriAI/litellm.","triggerScenarios":"Thrown at litellm/proxy/management_endpoints/ui_sso.py:2136 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Set LITELLM_MASTER_KEY in .env or general_settings:master_key in config.yaml, then restart."],"exampleFix":null,"handlingStrategy":null,"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"}