{"record":{"id":"f7557e815077c81c","repo":"BerriAI/litellm","slug":"blocked-user-check-was-never-set-this-call-has-no-f7557e","errorCode":null,"errorMessage":"Blocked user check was never set. This call has no effect.","messagePattern":"Blocked user check was never set\\. This call has no effect\\.","errorType":"http","errorClass":"HTTPException","httpStatus":400,"severity":"error","filePath":"litellm/proxy/management_endpoints/customer_endpoints.py","lineNumber":233,"sourceCode":"    \"\"\"\n    try:\n        from enterprise.enterprise_hooks.blocked_user_list import (\n            _ENTERPRISE_BlockedUserList,\n        )\n    except ImportError:\n        raise HTTPException(\n            status_code=400,\n            detail={\n                \"error\": \"Blocked user check was never set. This call has no effect.\"\n                + CommonProxyErrors.missing_enterprise_package_docker.value\n            },\n        )\n\n    if (\n        not any(isinstance(x, _ENTERPRISE_BlockedUserList) for x in litellm.callbacks)\n        or litellm.blocked_user_list is None\n    ):\n        raise HTTPException(\n            status_code=400,\n            detail={\"error\": \"Blocked user check was never set. This call has no effect.\"},\n        )\n\n    if isinstance(litellm.blocked_user_list, list):\n        for id in data.user_ids:\n            litellm.blocked_user_list.remove(id)\n    else:\n        raise HTTPException(\n            status_code=500,\n            detail={\"error\": \"`blocked_user_list` must be set as a list. Filepaths can't be updated.\"},\n        )\n\n    return {\"blocked_users\": litellm.blocked_user_list}\n\n\ndef new_budget_request(data: NewCustomerRequest) -> BudgetNewRequest | None:\n    \"\"\"","sourceCodeStart":215,"sourceCodeEnd":251,"githubUrl":"https://github.com/BerriAI/litellm/blob/77b7c6c40c0c5aa5fbcb1d6a1825ac39ca8829b8/litellm/proxy/management_endpoints/customer_endpoints.py#L215-L251","documentation":"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.'","triggerScenarios":"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).","commonSituations":"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.","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"],"exampleFix":"# before\nlitellm_settings:\n  # no blocked user callback or list configured\n\n# after\nlitellm_settings:\n  callbacks: [\"blocked_user_check\"]\n  blocked_user_list: [\"user-123\"]","handlingStrategy":"validation","validationCode":"def blocked_user_check_active(config: dict) -> bool:\n    ls = config.get(\"litellm_settings\", {})\n    callbacks = ls.get(\"callbacks\", []) or []\n    return \"blocked_user_list\" in ls and any(\"blocked_user\" in str(c) for c in callbacks)","typeGuard":null,"tryCatchPattern":"try:\n    r = httpx.post(f\"{base}/customer/unblock\", json={\"user_ids\": ids}, headers=headers)\n    r.raise_for_status()\nexcept httpx.HTTPStatusError as e:\n    if e.response.status_code == 400 and \"never set\" in e.response.text:\n        # configuration problem on the proxy, not a data problem - fix config.yaml\n        raise RuntimeError(\"enable blocked_user_check callback + blocked_user_list first\") from e\n    raise","preventionTips":["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"],"tags":["litellm","enterprise","blocked-users","callback","configuration"],"backgroundTag":"feature-not-enabled","analyzedSha":"77b7c6c40c0c5aa5fbcb1d6a1825ac39ca8829b8","analyzedAt":"2026-08-18T11:44:31.656Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}