{"record":{"id":"dc89f40a2db1ec48","repo":"BerriAI/litellm","slug":"no-db-connected-dc89f4","errorCode":null,"errorMessage":"No DB Connected","messagePattern":"No DB Connected","errorType":"exception","errorClass":"Exception","httpStatus":null,"severity":"error","filePath":"litellm/proxy/ui_crud_endpoints/proxy_setting_endpoints.py","lineNumber":464,"sourceCode":"@router.post(\n    \"/add/allowed_ip\",\n    tags=[\"Budget & Spend Tracking\"],\n    dependencies=[Depends(user_api_key_auth)],\n)\nasync def add_allowed_ip(\n    ip_address: IPAddress,\n    user_api_key_dict: UserAPIKeyAuth = Depends(user_api_key_auth),\n):\n    from litellm.proxy.proxy_server import (\n        create_config_audit_log,\n        general_settings,\n        prisma_client,\n        proxy_config,\n        store_model_in_db,\n    )\n\n    if prisma_client is None:\n        raise Exception(\"No DB Connected\")\n\n    _allowed_ips: Final[list] = general_settings.get(\"allowed_ips\", [])\n    if ip_address.ip not in _allowed_ips:\n        _allowed_ips.append(ip_address.ip)\n        general_settings[\"allowed_ips\"] = _allowed_ips\n    else:\n        raise HTTPException(status_code=400, detail=\"IP address already exists\")\n\n    if store_model_in_db is not True:\n        raise HTTPException(\n            status_code=500,\n            detail={\"error\": \"Set `'STORE_MODEL_IN_DB='True'` in your env to enable this feature.\"},\n        )\n\n    # Load existing config\n    config: Final = await proxy_config.get_config()\n    verbose_proxy_logger.debug(\"Loaded config: %s\", config)\n    if \"general_settings\" not in config:","sourceCodeStart":446,"sourceCodeEnd":482,"githubUrl":"https://github.com/BerriAI/litellm/blob/77b7c6c40c0c5aa5fbcb1d6a1825ac39ca8829b8/litellm/proxy/ui_crud_endpoints/proxy_setting_endpoints.py#L446-L482","documentation":"Guard in add_allowed_ip: prisma_client is None, so the proxy is running without a database connection. The IP allowlist feature persists config via Prisma, so the request cannot proceed until DATABASE_URL points at a working database.","triggerScenarios":"Thrown at litellm/proxy/ui_crud_endpoints/proxy_setting_endpoints.py:464 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Set DATABASE_URL to a PostgreSQL connection string and restart the proxy."],"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-14T00:17:10.932Z"}