{"record":{"id":"34cb3709899b0d84","repo":"BerriAI/litellm","slug":"mavvrik-connection-id-must-be-provided-for-mavvrik","errorCode":null,"errorMessage":"MAVVRIK_CONNECTION_ID must be provided for Mavvrik FOCUS destination (set MAVVRIK_CONNECTION_ID env var or pass in destination_config)","messagePattern":"MAVVRIK_CONNECTION_ID must be provided for Mavvrik FOCUS destination \\(set MAVVRIK_CONNECTION_ID env var or pass in destination_config\\)","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"litellm/integrations/focus/destinations/mavvrik_destination.py","lineNumber":77,"sourceCode":"        config: dict[str, Any] | None = None,\n    ) -> None:\n        config = config or {}\n        api_key: Final = config.get(\"api_key\")\n        api_endpoint: Final = config.get(\"api_endpoint\")\n        connection_id: Final = config.get(\"connection_id\")\n\n        if not api_key:\n            raise ValueError(\n                \"MAVVRIK_API_KEY must be provided for Mavvrik FOCUS destination \"\n                \"(set MAVVRIK_API_KEY env var or pass in destination_config)\"\n            )\n        if not api_endpoint:\n            raise ValueError(\n                \"MAVVRIK_API_ENDPOINT must be provided for Mavvrik FOCUS destination \"\n                \"(set MAVVRIK_API_ENDPOINT env var or pass in destination_config)\"\n            )\n        if not connection_id:\n            raise ValueError(\n                \"MAVVRIK_CONNECTION_ID must be provided for Mavvrik FOCUS destination \"\n                \"(set MAVVRIK_CONNECTION_ID env var or pass in destination_config)\"\n            )\n\n        _validate_api_endpoint(api_endpoint)\n\n        self.api_key = api_key\n        self.api_endpoint = api_endpoint.rstrip(\"/\")\n        self.connection_id = connection_id\n        self.prefix = prefix\n        self._http: AsyncHTTPHandler = get_async_httpx_client(llm_provider=httpxSpecialProvider.LoggingCallback)\n        self._registered = False\n\n    @property\n    def _agent_url(self) -> str:\n        return f\"{self.api_endpoint}/metrics/agent/ai/{self.connection_id}\"\n\n    @property","sourceCodeStart":59,"sourceCodeEnd":95,"githubUrl":"https://github.com/BerriAI/litellm/blob/77b7c6c40c0c5aa5fbcb1d6a1825ac39ca8829b8/litellm/integrations/focus/destinations/mavvrik_destination.py#L59-L95","documentation":"ValueError raised in FocusMavvrikDestination.__init__ when the resolved config has no truthy 'connection_id'. The connection_id identifies the specific connector registered in the Mavvrik dashboard and is embedded in the API paths (/metrics/agent/ai/{connection_id}). Resolved from destination_config['connection_id'] or MAVVRIK_CONNECTION_ID; last of the three construction-time checks.","triggerScenarios":"Enabling the Mavvrik FOCUS destination with MAVVRIK_CONNECTION_ID unset and no connection_id in the config dict, while api_key and api_endpoint are present.","commonSituations":"The connection was created in the Mavvrik UI but its ID never copied into the deployment env; the ID was copied with whitespace; a re-created connector got a new ID that was never propagated.","solutions":["Copy the connector ID from the Mavvrik dashboard and set export MAVVRIK_CONNECTION_ID=<id>","Or pass it in config: config={'connection_id': '<id>', ...}","Trim stray whitespace/quotes when pasting into dotfiles or container env blocks"],"exampleFix":"# before\nexport MAVVRIK_API_KEY=mk_live_xxx\nexport MAVVRIK_API_ENDPOINT=https://api.mavvrik.dev/acme\n# MAVVRIK_CONNECTION_ID missing\n\n# after\nexport MAVVRIK_CONNECTION_ID=conn_7f3a2b","handlingStrategy":"validation","validationCode":"import os\n\nconnection_id = (config or {}).get(\"connection_id\") or os.getenv(\"MAVVRIK_CONNECTION_ID\")\nif not connection_id:\n    raise SystemExit(\"MAVVRIK_CONNECTION_ID is required (env var or destination_config['connection_id'])\")","typeGuard":"import os\nfrom typing import Any\n\ndef has_mavvrik_connection_id(config: dict[str, Any] | None) -> bool:\n    \"\"\"True when a Mavvrik connector id is resolvable.\"\"\"\n    return bool((config or {}).get(\"connection_id\") or os.getenv(\"MAVVRIK_CONNECTION_ID\"))","tryCatchPattern":"try:\n    destination = FocusMavvrikDestination(prefix=\"focus\", config=cfg)\nexcept ValueError as e:\n    raise SystemExit(f\"Mavvrik destination misconfigured: {e}\") from e","preventionTips":["Copy the connector id from the Mavvrik dashboard immediately after creating the connection","When a connection is re-created, treat updating MAVVRIK_CONNECTION_ID as part of the runbook"],"tags":["mavvrik","env-var","config","connection-id","validation"],"backgroundTag":"missing-env-var","analyzedSha":"77b7c6c40c0c5aa5fbcb1d6a1825ac39ca8829b8","analyzedAt":"2026-08-18T11:44:31.656Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}