{"record":{"id":"4afda2a3458ef249","repo":"BerriAI/litellm","slug":"ip-address-already-exists","errorCode":null,"errorMessage":"IP address already exists","messagePattern":"IP address already exists","errorType":"http","errorClass":"HTTPException","httpStatus":400,"severity":"error","filePath":"litellm/proxy/ui_crud_endpoints/proxy_setting_endpoints.py","lineNumber":471,"sourceCode":"    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:\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 not in config[\"general_settings\"][\"allowed_ips\"]:","sourceCodeStart":453,"sourceCodeEnd":489,"githubUrl":"https://github.com/BerriAI/litellm/blob/77b7c6c40c0c5aa5fbcb1d6a1825ac39ca8829b8/litellm/proxy/ui_crud_endpoints/proxy_setting_endpoints.py#L453-L489","documentation":"Idempotency guard in add_allowed_ip: the submitted IP is already present in general_settings['allowed_ips'], so adding it again would create a duplicate entry. The client does not need to retry; the desired state already holds.","triggerScenarios":"Thrown at litellm/proxy/ui_crud_endpoints/proxy_setting_endpoints.py:471 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["The IP address is already in the allow/block list; update or delete the existing entry instead."],"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"}