BerriAI/litellm · error · RuntimeError

Mavvrik FOCUS destination: failed to update metricsMarker ({

Error message

Mavvrik FOCUS destination: failed to update metricsMarker ({resp.status_code}): {resp.text[:200]}

What it means

Raised when the PATCH to the Mavvrik agent endpoint that advances metricsMarker returns any HTTP >= 400 other than 410. metricsMarker is Mavvrik's high-water mark for catch-up exports; failing to advance it means the next run will re-export the same window. The response body (first 200 chars) is included to identify the cause.

Source

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

            raise

    async def _update_metrics_marker(self, date_epoch: int) -> None:
        """PATCH agent endpoint to advance metricsMarker after a successful upload."""
        resp: Final = await self._http.client.request(
            method="PATCH",
            url=self._agent_url,
            headers=self._auth_headers,
            json={"metricsMarker": date_epoch},
            timeout=30.0,
        )
        if resp.status_code == 410:
            self._registered = False
            raise RuntimeError(
                "Mavvrik FOCUS destination: connector is disconnected (410). "
                "Re-enable the connection in the Mavvrik dashboard."
            )
        if resp.status_code >= 400:
            raise RuntimeError(
                f"Mavvrik FOCUS destination: failed to update metricsMarker ({resp.status_code}): {resp.text[:200]}"
            )
        verbose_logger.debug("Mavvrik FOCUS destination: metricsMarker advanced to %s", date_epoch)

    async def get_metrics_marker(self) -> int | None:
        """Register with Mavvrik and return the current metricsMarker.

        Always calls the Mavvrik register API — unlike deliver() which skips
        registration once _registered is True, catch-up requires a fresh
        marker value on every run.
        """
        resp: Final = await self._http.client.request(
            method="POST",
            url=self._agent_url,
            headers=self._auth_headers,
            json={"name": self.connection_id},
            timeout=30.0,
        )

View on GitHub (pinned to 6c2dcb801b)

Solutions

  1. Inspect the logged status code and response snippet: 401/403 → fix credentials; 429 → back off and retry; 5xx → retry later.
  2. Re-run the export — since the marker did not advance, the same window is re-exported with no data loss (idempotent by design).
  3. Verify the agent URL and auth headers in the Mavvrik destination config.
Defensive patterns

Strategy: retry

Try / catch

for attempt in range(3):
    try:
        await export_once()
        break
    except RuntimeError as e:
        if "failed to update metricsMarker" in str(e) and attempt < 2:
            await asyncio.sleep(2 ** attempt * 30)
            continue
        raise

Prevention

When it happens

Trigger: PATCH {agent_url} with json={"metricsMarker": date_epoch} returns 400/401/403/404/429/5xx — bad auth headers, expired token, rate limiting, or a Mavvrik-side incident.

Common situations: Expired or rotated Mavvrik API credentials; wrong agent URL in config; Mavvrik API outage; 429 rate limiting when many windows export in quick succession during catch-up.

Related errors


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