BerriAI/litellm · error · HTTPException
Blocked user check was never set. This call has no effect.
Error message
Blocked user check was never set. This call has no effect.
What it means
After the enterprise import succeeds, POST /customer/unblock verifies the blocklist feature is actually live: at least one entry in litellm.callbacks must be a _ENTERPRISE_BlockedUserList and the global litellm.blocked_user_list must not be None. If either check fails, unblocking would be a no-op, so the endpoint returns HTTP 400 'Blocked user check was never set. This call has no effect.'
Source
Thrown at litellm/proxy/management_endpoints/customer_endpoints.py:233
"""
try:
from enterprise.enterprise_hooks.blocked_user_list import (
_ENTERPRISE_BlockedUserList,
)
except ImportError:
raise HTTPException(
status_code=400,
detail={
"error": "Blocked user check was never set. This call has no effect."
+ CommonProxyErrors.missing_enterprise_package_docker.value
},
)
if (
not any(isinstance(x, _ENTERPRISE_BlockedUserList) for x in litellm.callbacks)
or litellm.blocked_user_list is None
):
raise HTTPException(
status_code=400,
detail={"error": "Blocked user check was never set. This call has no effect."},
)
if isinstance(litellm.blocked_user_list, list):
for id in data.user_ids:
litellm.blocked_user_list.remove(id)
else:
raise HTTPException(
status_code=500,
detail={"error": "`blocked_user_list` must be set as a list. Filepaths can't be updated."},
)
return {"blocked_users": litellm.blocked_user_list}
def new_budget_request(data: NewCustomerRequest) -> BudgetNewRequest | None:
"""View on GitHub (pinned to 77b7c6c40c)
Solutions
- Enable the enterprise blocked-user callback in config.yaml (add blocked_user_check to litellm_settings.callbacks) and set blocked_user_list
- Restart the proxy so litellm.callbacks and litellm.blocked_user_list are populated
- Confirm the blocklist is non-None (e.g. successfully block a user via /customer/block first) before calling unblock
Example fix
# before litellm_settings: # no blocked user callback or list configured # after litellm_settings: callbacks: ["blocked_user_check"] blocked_user_list: ["user-123"]
Defensive patterns
Strategy: validation
Validate before calling
def blocked_user_check_active(config: dict) -> bool:
ls = config.get("litellm_settings", {})
callbacks = ls.get("callbacks", []) or []
return "blocked_user_list" in ls and any("blocked_user" in str(c) for c in callbacks) Try / catch
try:
r = httpx.post(f"{base}/customer/unblock", json={"user_ids": ids}, headers=headers)
r.raise_for_status()
except httpx.HTTPStatusError as e:
if e.response.status_code == 400 and "never set" in e.response.text:
# configuration problem on the proxy, not a data problem - fix config.yaml
raise RuntimeError("enable blocked_user_check callback + blocked_user_list first") from e
raise Prevention
- Configure the blocked-user callback together with blocked_user_list in the same config review
- Add a post-deploy smoke test that blocks and unblocks one test user to catch missing-callback setups
- Do not script unblock calls until the block flow has succeeded at least once on that deployment
When it happens
Trigger: Calling POST /customer/unblock when config.yaml never enabled the blocked-user callback (litellm_settings.callbacks lacks blocked_user_check) or when litellm.blocked_user_list was never populated at startup (no blocked_user_list setting).
Common situations: Teams run the enterprise image but forgot the callback entry in config; the blocklist was expected to be injected by another service or env var that never ran; unblock is called before any blocklist was ever configured.
Related errors
- `blocked_user_list` must be set as a list. Filepaths can't b
- custom_ui_sso_sign_in_handler is not configured. Please set
- Trying to use Blocked User ListThis uses the enterprise fold
- Trying to use ENTERPRISE BlockedUserYou must be a LiteLLM En
- Blocked user check was never set. This call has no effect.Th
AI-assisted analysis of BerriAI/litellm@77b7c6c40c (2026-08-18).
Data as JSON: /api/errors/f7557e815077c81c.
Report an issue: GitHub.