{"record":{"id":"e7205b8d70db97b8","repo":"BerriAI/litellm","slug":"trying-to-use-blocked-user-listthis-uses-the-enter","errorCode":null,"errorMessage":"Trying to use Blocked User ListThis uses the enterprise folder - only available on the Docker image.","messagePattern":"Trying to use Blocked User ListThis uses the enterprise folder - only available on the Docker image\\.","errorType":"exception","errorClass":"Exception","httpStatus":null,"severity":"error","filePath":"litellm/proxy/common_utils/callback_utils.py","lineNumber":285,"sourceCode":"                try:\n                    from litellm_enterprise.enterprise_callbacks.llm_guard import (\n                        _ENTERPRISE_LLMGuard,\n                    )\n                except ImportError:\n                    raise Exception(\"Trying to use Llm Guard\" + CommonProxyErrors.missing_enterprise_package.value)\n\n                if premium_user is not True:\n                    raise Exception(\"Trying to use Llm Guard\" + CommonProxyErrors.not_premium_user.value)\n\n                llm_guard_moderation_obj = _ENTERPRISE_LLMGuard()\n                imported_list.append(llm_guard_moderation_obj)\n            elif isinstance(callback, str) and callback == \"blocked_user_check\":\n                try:\n                    from enterprise.enterprise_hooks.blocked_user_list import (\n                        _ENTERPRISE_BlockedUserList,\n                    )\n                except ImportError:\n                    raise Exception(\n                        \"Trying to use Blocked User List\" + CommonProxyErrors.missing_enterprise_package_docker.value\n                    )\n\n                if premium_user is not True:\n                    raise Exception(\"Trying to use ENTERPRISE BlockedUser\" + CommonProxyErrors.not_premium_user.value)\n\n                blocked_user_list = _ENTERPRISE_BlockedUserList(prisma_client=prisma_client)\n                imported_list.append(blocked_user_list)\n            elif isinstance(callback, str) and callback == \"banned_keywords\":\n                try:\n                    from enterprise.enterprise_hooks.banned_keywords import (\n                        _ENTERPRISE_BannedKeywords,\n                    )\n                except ImportError:\n                    raise Exception(\n                        \"Trying to use Banned Keywords\" + CommonProxyErrors.missing_enterprise_package_docker.value\n                    )\n","sourceCodeStart":267,"sourceCodeEnd":303,"githubUrl":"https://github.com/BerriAI/litellm/blob/77b7c6c40c0c5aa5fbcb1d6a1825ac39ca8829b8/litellm/proxy/common_utils/callback_utils.py#L267-L303","documentation":"The callback 'blocked_user_check' is handled by code that imports from the 'enterprise' folder (enterprise.enterprise_hooks.blocked_user_list). That folder ships only inside the LiteLLM enterprise Docker image; a plain pip install of litellm does not contain it. The ImportError is caught and re-raised with this message that names the Docker requirement.","triggerScenarios":"Run the proxy from a pip install or from a source checkout with callbacks: ['blocked_user_check']. Any environment where the top-level 'enterprise' package does not exist produces this error at config load.","commonSituations":"A config that ran on the official enterprise Docker image is reused on a local pip install or on a custom slim image. Someone builds their own Dockerfile with pip install litellm and loses the enterprise folder.","solutions":["Remove 'blocked_user_check' from litellm_settings.callbacks.","Or run the proxy with the LiteLLM enterprise Docker image, which contains the enterprise folder.","Note: even on Docker, a valid LITELLM_LICENSE is still required next (error 2884)."],"exampleFix":"# before\nlitellm_settings:\n  callbacks: [\"blocked_user_check\"]\n# started with: pip install litellm && litellm --config config.yaml\n\n# after\nlitellm_settings:\n  callbacks: []\n# or run the enterprise docker image with a license","handlingStrategy":"validation","validationCode":"import os\n\ndef blocked_user_check_ok() -> bool:\n    return os.path.isdir(\"enterprise\") and os.path.exists(\"enterprise/enterprise_hooks/blocked_user_list.py\")\n\nif \"blocked_user_check\" in callbacks and not blocked_user_check_ok():\n    raise SystemExit(\"blocked_user_check needs the enterprise Docker image\")","typeGuard":null,"tryCatchPattern":"try:\n    start_proxy(cfg)\nexcept Exception as e:\n    if \"enterprise folder\" in str(e):\n        raise SystemExit(\"switch to the litellm enterprise docker image or remove the callback\")\n    raise","preventionTips":["Mark blocked_user_check in the config with a comment: only-on-enterprise-docker.","Use one base image for all environments so configs do not depend on the host install type.","Smoke-test config load in CI with the same image the deployment uses."],"tags":["litellm","enterprise","docker","import-error","config","blocked-users"],"backgroundTag":"missing-optional-dependency","analyzedSha":"77b7c6c40c0c5aa5fbcb1d6a1825ac39ca8829b8","analyzedAt":"2026-08-18T11:44:31.656Z","schemaVersion":2},"datasetVersion":"2026-08-30T08:17:16.595Z"}