{"record":{"id":"20f027d8a85cd209","repo":"BerriAI/litellm","slug":"ip-address-not-found","errorCode":null,"errorMessage":"IP address not found","messagePattern":"IP address not found","errorType":"http","errorClass":"HTTPException","httpStatus":404,"severity":"error","filePath":"litellm/proxy/ui_crud_endpoints/proxy_setting_endpoints.py","lineNumber":530,"sourceCode":"    tags=[\"Budget & Spend Tracking\"],\n    dependencies=[Depends(user_api_key_auth)],\n)\nasync def delete_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        proxy_config,\n    )\n\n    _allowed_ips: Final[list] = general_settings.get(\"allowed_ips\", [])\n    if ip_address.ip in _allowed_ips:\n        _allowed_ips.remove(ip_address.ip)\n        general_settings[\"allowed_ips\"] = _allowed_ips\n    else:\n        raise HTTPException(status_code=404, detail=\"IP address not found\")\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:\n        config[\"general_settings\"] = {}\n\n    if \"allowed_ips\" not in config[\"general_settings\"]:\n        config[\"general_settings\"][\"allowed_ips\"] = []\n\n    before_allowed_ips: Final = list(config[\"general_settings\"][\"allowed_ips\"])\n    if ip_address.ip in config[\"general_settings\"][\"allowed_ips\"]:\n        config[\"general_settings\"][\"allowed_ips\"].remove(ip_address.ip)\n\n    await proxy_config.save_config(new_config=config)\n\n    asyncio.create_task(\n        create_config_audit_log(","sourceCodeStart":512,"sourceCodeEnd":548,"githubUrl":"https://github.com/BerriAI/litellm/blob/77b7c6c40c0c5aa5fbcb1d6a1825ac39ca8829b8/litellm/proxy/ui_crud_endpoints/proxy_setting_endpoints.py#L512-L548","documentation":"Guard in delete_allowed_ip: the submitted IP is not in general_settings['allowed_ips'], so there is nothing to remove. Usually a stale UI list or the IP was already deleted; the delete is treated as an error rather than a no-op.","triggerScenarios":"Thrown at litellm/proxy/ui_crud_endpoints/proxy_setting_endpoints.py:530 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Verify the IP address exists in the list before updating or deleting it; list current entries first."],"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"}