{"record":{"id":"f7973c6052a7cafe","repo":"BerriAI/litellm","slug":"rubrik-webhook-url-not-configured-set-rubrik-webh","errorCode":null,"errorMessage":"Rubrik webhook URL not configured. Set RUBRIK_WEBHOOK_URL or pass api_base.","messagePattern":"Rubrik webhook URL not configured\\. Set RUBRIK_WEBHOOK_URL or pass api_base\\.","errorType":"exception","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"litellm/integrations/rubrik.py","lineNumber":149,"sourceCode":"        self._parse_sampling_rate()\n\n        self.key = api_key or os.getenv(\"RUBRIK_API_KEY\")\n        if not self.key:\n            verbose_logger.warning(\"Rubrik: No API key configured. Requests will be unauthenticated.\")\n\n        self._parse_batch_size()\n\n        # Cap the in-memory retry queue so a Rubrik webhook outage cannot let\n        # authenticated traffic accumulate prompt/response payloads until the\n        # proxy runs out of memory. Once the cap is reached, oldest events are\n        # dropped to make room for fresh ones (drop-oldest backpressure).\n        self.max_queue_size = _MAX_QUEUE_SIZE\n        self._dropped_since_warning = 0\n        self._last_drop_warning_time = 0.0\n\n        _webhook_url = api_base or os.getenv(\"RUBRIK_WEBHOOK_URL\")\n        if not _webhook_url:\n            raise ValueError(\"Rubrik webhook URL not configured. Set RUBRIK_WEBHOOK_URL or pass api_base.\")\n\n        _webhook_url = _webhook_url.rstrip(\"/\").removesuffix(\"/v1\")\n        self._setup_clients(_webhook_url)\n\n        self._headers: Mapping[str, str] = MappingProxyType(\n            {\"Content-Type\": \"application/json\", \"Authorization\": f\"Bearer {self.key}\"}\n            if self.key\n            else {\"Content-Type\": \"application/json\"}\n        )\n\n        self._periodic_flush_task: asyncio.Task[None] | None = self._start_periodic_flush_task()\n\n    @classmethod\n    def get_supported_event_hooks(cls) -> list[GuardrailEventHooks]:\n        \"\"\"Return the guardrail event hooks this integration supports.\n\n        Prompt moderation (``pre_call``) evaluates the user's message before\n        the LLM is called. Response moderation (``post_call``) evaluates the","sourceCodeStart":131,"sourceCodeEnd":167,"githubUrl":"https://github.com/BerriAI/litellm/blob/77b7c6c40c0c5aa5fbcb1d6a1825ac39ca8829b8/litellm/integrations/rubrik.py#L131-L167","documentation":"The Rubrik guardrail needs a moderation webhook URL, resolved as the constructor's api_base or the RUBRIK_WEBHOOK_URL environment variable; when both are empty it raises this ValueError during __init__ (after batch-size parsing, before clients and the periodic flush task start). Any trailing slash and a literal /v1 suffix are stripped before the URL is used, so the raw value may include them.","triggerScenarios":"Adding a rubrik guardrail entry to proxy config (guardrails: - guardrail_name: rubrik with litellm_params) without an api_base/litellm_params.api_base while RUBRIK_WEBHOOK_URL is not exported in the proxy's environment; the env var exists only on your laptop, not the container.","commonSituations":"Secrets not mounted into the proxy container; config migrated from another guardrail (e.g. bedrock) that needed no URL; env var name typo'd as RUBRIK_WEBHOOK or RUBRIK_URL.","solutions":["Set RUBRIK_WEBHOOK_URL to your Rubrik event-moderation endpoint in the proxy process environment","Or pass it per-guardrail via litellm_params: api_base: <url> in the guardrails config","Restart the proxy after setting it and confirm with a print of os.getenv('RUBRIK_WEBHOOK_URL') inside the same environment","Check spelling: it must be exactly RUBRIK_WEBHOOK_URL"],"exampleFix":"# before (config.yaml)\nguardrails:\n  - guardrail_name: rubrik\n    litellm_params:\n      guardrail: rubrik\n      mode: pre_call\n# -> ValueError: Rubrik webhook URL not configured\n\n# after (config.yaml)\nguardrails:\n  - guardrail_name: rubrik\n    litellm_params:\n      guardrail: rubrik\n      mode: pre_call\n      api_base: https://rubrik.example.com/api/v1","handlingStrategy":"validation","validationCode":"import os\n\nif not (os.getenv('RUBRIK_WEBHOOK_URL') or config_api_base):\n    raise RuntimeError('Rubrik guardrail requires RUBRIK_WEBHOOK_URL or api_base')","typeGuard":null,"tryCatchPattern":"try:\n    guardrail = RubrikGuardrail(api_base=config_api_base)\nexcept ValueError as e:\n    logger.error('rubrik guardrail misconfigured: %s', e)\n    raise SystemExit(1)","preventionTips":["Declare RUBRIK_WEBHOOK_URL (or api_base in the guardrail's litellm_params) in every environment using rubrik","Add a boot-time env assertion for all guardrail secrets in the same process as the proxy","Verify variable spelling — exactly RUBRIK_WEBHOOK_URL"],"tags":["rubrik","guardrail","missing-env-var","webhook","configuration"],"backgroundTag":"guardrail-not-configured","analyzedSha":"77b7c6c40c0c5aa5fbcb1d6a1825ac39ca8829b8","analyzedAt":"2026-08-18T11:44:31.656Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}