BerriAI/litellm · error · HTTPException

IP address not found

Error message

IP address not found

What it means

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.

Source

Thrown at litellm/proxy/ui_crud_endpoints/proxy_setting_endpoints.py:530

    tags=["Budget & Spend Tracking"],
    dependencies=[Depends(user_api_key_auth)],
)
async def delete_allowed_ip(
    ip_address: IPAddress,
    user_api_key_dict: UserAPIKeyAuth = Depends(user_api_key_auth),
):
    from litellm.proxy.proxy_server import (
        create_config_audit_log,
        general_settings,
        proxy_config,
    )

    _allowed_ips: Final[list] = general_settings.get("allowed_ips", [])
    if ip_address.ip in _allowed_ips:
        _allowed_ips.remove(ip_address.ip)
        general_settings["allowed_ips"] = _allowed_ips
    else:
        raise HTTPException(status_code=404, detail="IP address not found")

    # Load existing config
    config: Final = await proxy_config.get_config()
    verbose_proxy_logger.debug("Loaded config: %s", config)
    if "general_settings" not in config:
        config["general_settings"] = {}

    if "allowed_ips" not in config["general_settings"]:
        config["general_settings"]["allowed_ips"] = []

    before_allowed_ips: Final = list(config["general_settings"]["allowed_ips"])
    if ip_address.ip in config["general_settings"]["allowed_ips"]:
        config["general_settings"]["allowed_ips"].remove(ip_address.ip)

    await proxy_config.save_config(new_config=config)

    asyncio.create_task(
        create_config_audit_log(

View on GitHub (pinned to 77b7c6c40c)

Solutions

  1. Verify the IP address exists in the list before updating or deleting it; list current entries first.
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at litellm/proxy/ui_crud_endpoints/proxy_setting_endpoints.py:530 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of BerriAI/litellm@77b7c6c40c (2026-08-18). Data as JSON: /api/errors/20f027d8a85cd209. Report an issue: GitHub.