BerriAI/litellm · error · ValueError

Rubrik webhook URL not configured. Set RUBRIK_WEBHOOK_URL or

Error message

Rubrik webhook URL not configured. Set RUBRIK_WEBHOOK_URL or pass api_base.

What it means

RubrikSecurityLogger.__init__ resolves its webhook target as api_base argument or the RUBRIK_WEBHOOK_URL env var; if both are empty it raises ValueError, because every moderation post would have nowhere to go. This is a hard constructor failure — the callback cannot start.

Source

Thrown at litellm/integrations/rubrik.py:149

        self._parse_sampling_rate()

        self.key = api_key or os.getenv("RUBRIK_API_KEY")
        if not self.key:
            verbose_logger.warning("Rubrik: No API key configured. Requests will be unauthenticated.")

        self._parse_batch_size()

        # Cap the in-memory retry queue so a Rubrik webhook outage cannot let
        # authenticated traffic accumulate prompt/response payloads until the
        # proxy runs out of memory. Once the cap is reached, oldest events are
        # dropped to make room for fresh ones (drop-oldest backpressure).
        self.max_queue_size = _MAX_QUEUE_SIZE
        self._dropped_since_warning = 0
        self._last_drop_warning_time = 0.0

        _webhook_url = api_base or os.getenv("RUBRIK_WEBHOOK_URL")
        if not _webhook_url:
            raise ValueError("Rubrik webhook URL not configured. Set RUBRIK_WEBHOOK_URL or pass api_base.")

        _webhook_url = _webhook_url.rstrip("/").removesuffix("/v1")
        self._setup_clients(_webhook_url)

        self._headers: Mapping[str, str] = MappingProxyType(
            {"Content-Type": "application/json", "Authorization": f"Bearer {self.key}"}
            if self.key
            else {"Content-Type": "application/json"}
        )

        self._periodic_flush_task: asyncio.Task[None] | None = self._start_periodic_flush_task()

    @classmethod
    def get_supported_event_hooks(cls) -> list[GuardrailEventHooks]:
        """Return the guardrail event hooks this integration supports.

        Prompt moderation (``pre_call``) evaluates the user's message before
        the LLM is called. Response moderation (``post_call``) evaluates the

View on GitHub (pinned to 6c2dcb801b)

Solutions

  1. Set RUBRIK_WEBHOOK_URL (e.g. https://rubrik.example.com/api/v1) in the proxy environment and restart
  2. Or pass the URL programmatically: RubrikSecurityLogger(api_base="https://rubrik.example.com") and add it via litellm.callbacks = [logger_instance]
  3. In containers, verify with printenv RUBRIK_WEBHOOK_URL inside the same process context

Example fix

# before
litellm.callbacks = ["rubrik"]  # ValueError: Rubrik webhook URL not configured

# after
import os
os.environ["RUBRIK_WEBHOOK_URL"] = "https://rubrik.example.com"
litellm.callbacks = ["rubrik"]

# or explicitly
from litellm.integrations.rubrik import RubrikSecurityLogger
litellm.callbacks = [RubrikSecurityLogger(api_base="https://rubrik.example.com")]
Defensive patterns

Strategy: validation

Validate before calling

import os

RUBRIK_URL = os.getenv("RUBRIK_WEBHOOK_URL") or explicit_api_base
if not RUBRIK_URL:
    raise RuntimeError("Configure RUBRIK_WEBHOOK_URL before enabling the rubrik callback")
litellm.callbacks = ["rubrik"]

Try / catch

try:
    from litellm.integrations.rubrik import RubrikSecurityLogger
    rubrik = RubrikSecurityLogger()
except ValueError as e:
    if "webhook URL not configured" in str(e):
        rubrik = None
        logger.warning("Rubrik DLP disabled: RUBRIK_WEBHOOK_URL not set")
    else:
        raise

Prevention

When it happens

Trigger: Adding litellm.callbacks = ["rubrik"] (or instantiating RubrikSecurityLogger) without RUBRIK_WEBHOOK_URL exported; passing api_base=None/'' while the env var is also unset; env var defined only in a shell that is not the proxy process's environment.

Common situations: Deploying the proxy with Rubrik DLP integration before copying the env template; Docker/K8s deployments where the secret was not mounted; local runs where .env loading happens after callback construction.

Related errors


AI-assisted analysis of BerriAI/litellm@6c2dcb801b (2026-08-15). Data as JSON: /api/errors/f7973c6052a7cafe. Report an issue: GitHub.