BerriAI/litellm · error · ValueError
Rubrik webhook URL not configured. Set RUBRIK_WEBHOOK_URL…
Error message
Rubrik webhook URL not configured. Set RUBRIK_WEBHOOK_URL or pass api_base.
What it means
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.
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
Example fix
# before (config.yaml)
guardrails:
- guardrail_name: rubrik
litellm_params:
guardrail: rubrik
mode: pre_call
# -> ValueError: Rubrik webhook URL not configured
# after (config.yaml)
guardrails:
- guardrail_name: rubrik
litellm_params:
guardrail: rubrik
mode: pre_call
api_base: https://rubrik.example.com/api/v1 Defensive patterns
Strategy: validation
Validate before calling
import os
if not (os.getenv('RUBRIK_WEBHOOK_URL') or config_api_base):
raise RuntimeError('Rubrik guardrail requires RUBRIK_WEBHOOK_URL or api_base') Try / catch
try:
guardrail = RubrikGuardrail(api_base=config_api_base)
except ValueError as e:
logger.error('rubrik guardrail misconfigured: %s', e)
raise SystemExit(1) Prevention
- 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
When it happens
Trigger: 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.
Common situations: 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.
Related errors
- returned non-dict JSON ( ); expected OpenAI chat completion…
- AZURE_SENTINEL_CLIENT_ID or AZURE_CLIENT_ID is required…
- AZURE_SENTINEL_CLIENT_SECRET or AZURE_CLIENT_SECRET is…
- AZURE_SENTINEL_DCR_IMMUTABLE_ID is required. Set it as an…
- AZURE_SENTINEL_ENDPOINT is required. Set it as an…
AI-assisted analysis of BerriAI/litellm@77b7c6c40c (2026-08-18).
Data as JSON: /api/errors/f7973c6052a7cafe.
Report an issue: GitHub.
Appendix: 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 theView on GitHub (pinned to 77b7c6c40c)