BerriAI/litellm · error · ValueError

MAVVRIK_CONNECTION_ID must be provided for Mavvrik FOCUS des

Error message

MAVVRIK_CONNECTION_ID must be provided for Mavvrik FOCUS destination (set MAVVRIK_CONNECTION_ID env var or pass in destination_config)

What it means

Third mandatory-field check in FocusMavvrikDestination.__init__: connection_id (the Mavvrik connector name sent in the register POST body as {"name": connection_id}) must be present. It is checked last, after api_key and api_endpoint.

Source

Thrown at litellm/integrations/focus/destinations/mavvrik_destination.py:77

        config: dict[str, Any] | None = None,
    ) -> None:
        config = config or {}
        api_key: Final = config.get("api_key")
        api_endpoint: Final = config.get("api_endpoint")
        connection_id: Final = config.get("connection_id")

        if not api_key:
            raise ValueError(
                "MAVVRIK_API_KEY must be provided for Mavvrik FOCUS destination "
                "(set MAVVRIK_API_KEY env var or pass in destination_config)"
            )
        if not api_endpoint:
            raise ValueError(
                "MAVVRIK_API_ENDPOINT must be provided for Mavvrik FOCUS destination "
                "(set MAVVRIK_API_ENDPOINT env var or pass in destination_config)"
            )
        if not connection_id:
            raise ValueError(
                "MAVVRIK_CONNECTION_ID must be provided for Mavvrik FOCUS destination "
                "(set MAVVRIK_CONNECTION_ID env var or pass in destination_config)"
            )

        _validate_api_endpoint(api_endpoint)

        self.api_key = api_key
        self.api_endpoint = api_endpoint.rstrip("/")
        self.connection_id = connection_id
        self.prefix = prefix
        self._http: AsyncHTTPHandler = get_async_httpx_client(llm_provider=httpxSpecialProvider.LoggingCallback)
        self._registered = False

    @property
    def _agent_url(self) -> str:
        return f"{self.api_endpoint}/metrics/agent/ai/{self.connection_id}"

    @property

View on GitHub (pinned to 6c2dcb801b)

Solutions

  1. Copy the connection name/ID from the Mavvrik dashboard and set MAVVRIK_CONNECTION_ID.
  2. Or pass connection_id in the destination config overrides.
  3. Confirm the ID matches an enabled connector — a stale ID leads to the 410 'disconnected' error later.

Example fix

# before
config = {"api_key": key, "api_endpoint": ep}

# after
config = {"api_key": key, "api_endpoint": ep, "connection_id": os.environ["MAVVRIK_CONNECTION_ID"]}
Defensive patterns

Strategy: validation

Validate before calling

import os

if not (os.getenv("MAVVRIK_CONNECTION_ID") or config.get("connection_id")):
    raise SystemExit("MAVVRIK_CONNECTION_ID missing: copy the connector name from the Mavvrik dashboard")

Try / catch

try:
    dest = FocusMavvrikDestination(prefix=p, config=cfg)
except ValueError as e:
    if "MAVVRIK_CONNECTION_ID" in str(e):
        log_config_error("mavvrik", missing=["connection_id"])
    raise

Prevention

When it happens

Trigger: Constructing the mavvrik destination with api_key and api_endpoint resolved but connection_id missing from config and MAVVRIK_CONNECTION_ID unset.

Common situations: The connection was created in the Mavvrik dashboard but its ID never copied into deployment env; ID stored under a different variable name; regenerated connection after re-enabling a connector, old ID removed.

Related errors


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