{"record":{"id":"0f0a8c6c430731f3","repo":"BerriAI/litellm","slug":"mavvrik-focus-destination-response-missing-url","errorCode":null,"errorMessage":"Mavvrik FOCUS destination: response missing 'url' field: {resp.json()}","messagePattern":"Mavvrik FOCUS destination: response missing 'url' field: (.+?)","errorType":"exception","errorClass":"RuntimeError","httpStatus":null,"severity":"error","filePath":"litellm/integrations/focus/destinations/mavvrik_destination.py","lineNumber":153,"sourceCode":"        return metrics_marker\n\n    async def _get_signed_url(self, date_str: str) -> str:\n        \"\"\"GET upload-url endpoint → GCS signed URL for the given date.\"\"\"\n        params: Final = {\"name\": date_str, \"type\": \"metrics\", \"datetime\": date_str}\n        resp: Final = await self._http.client.request(\n            method=\"GET\",\n            url=self._upload_url_endpoint,\n            headers=self._auth_headers,\n            params=params,\n            timeout=30.0,\n        )\n        if resp.status_code >= 400:\n            raise RuntimeError(\n                f\"Mavvrik FOCUS destination: failed to get signed URL ({resp.status_code}): {resp.text[:200]}\"\n            )\n        signed_url: Final = resp.json().get(\"url\")\n        if not signed_url:\n            raise RuntimeError(f\"Mavvrik FOCUS destination: response missing 'url' field: {resp.json()}\")\n        _validate_gcs_url(signed_url, \"signed URL\")\n        verbose_logger.debug(\"Mavvrik FOCUS destination: got signed URL for date %s\", date_str)\n        return signed_url\n\n    async def _upload_to_gcs(self, signed_url: str, content: bytes) -> None:\n        \"\"\"Upload gzip-compressed CSV to GCS via chunked resumable upload.\n\n        The full CSV is gzip-compressed first, then uploaded in _GCS_CHUNK_SIZE\n        chunks using the GCS resumable upload protocol. GCS assembles the chunks\n        server-side into a single complete object — the bucket receives one file\n        regardless of how many chunks were sent.\n\n        Intermediate chunks: Content-Range: bytes X-Y/*   → expect 308\n        Final chunk:         Content-Range: bytes X-Y/T   → expect 200/201\n\n        This handles exports larger than available memory for a single PUT while\n        keeping the destination code self-contained (no changes to the FOCUS\n        pipeline upstream).","sourceCodeStart":135,"sourceCodeEnd":171,"githubUrl":"https://github.com/BerriAI/litellm/blob/77b7c6c40c0c5aa5fbcb1d6a1825ac39ca8829b8/litellm/integrations/focus/destinations/mavvrik_destination.py#L135-L171","documentation":"RuntimeError raised when the upload-url endpoint answers 2xx but its JSON body has no 'url' field. The destination expects {'url': '<GCS signed URL>'}; any other shape means the API contract changed or an unexpected payload (e.g. an error object or proxy page) came back with a success status. The full response JSON is embedded in the message.","triggerScenarios":"Mavvrik ships an API version that renames the field or returns {'error': ...} alongside HTTP 200; a corporate proxy returns its own JSON with 200; a stub server in tests returns an incomplete body.","commonSituations":"litellm version out of sync with a changed Mavvrik API, middleware injecting responses, partial service degradation returning soft errors.","solutions":["Upgrade litellm to the latest release in case the Mavvrik contract change was already adapted to","Log the embedded response body to see exactly what replaced the url field","Reproduce with curl against the upload-url endpoint to confirm the payload shape and report to Mavvrik if the field is genuinely missing"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"try:\n    await destination.deliver(content=content, time_window=tw, filename=fn)\nexcept RuntimeError as e:\n    if \"missing 'url' field\" in str(e):\n        # Contract drift or proxy interference — surface for triage, do not blind-retry\n        logger.error(\"Mavvrik upload-url response shape changed: %s\", e)\n        open_ticket(\"mavvrik-api-contract\", str(e))\n        raise\n    raise","preventionTips":["Pin litellm versions proven against the current Mavvrik API and test the full deliver() path in staging","Log the embedded response body — it tells you exactly what replaced the expected field","Watch Mavvrik release notes for upload-url API changes"],"tags":["mavvrik","api-contract","json","response-parsing"],"backgroundTag":"missing-response-field","analyzedSha":"77b7c6c40c0c5aa5fbcb1d6a1825ac39ca8829b8","analyzedAt":"2026-08-18T11:44:31.656Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}