{"record":{"id":"82e34683d8a2db10","repo":"BerriAI/litellm","slug":"mavvrik-api-endpoint-must-be-an-https-url","errorCode":null,"errorMessage":"MAVVRIK_API_ENDPOINT must be an HTTPS URL","messagePattern":"MAVVRIK_API_ENDPOINT must be an HTTPS URL","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"litellm/integrations/focus/destinations/mavvrik_destination.py","lineNumber":33,"sourceCode":"from litellm._logging import verbose_logger\nfrom litellm.llms.custom_httpx.http_handler import (\n    AsyncHTTPHandler,\n    get_async_httpx_client,\n    httpxSpecialProvider,\n)\n\nfrom .base import FocusDestination, FocusTimeWindow\n\n_MAVVRIK_ALLOWED_SUFFIXES: Final = (\".mavvrik.dev\", \".mavvrik.ai\", \".mavvrik.app\")\n\n# GCS requires intermediate chunks to be a multiple of 256 KB.\n# 8 MB gives a good balance between round-trips and memory pressure.\n_GCS_CHUNK_SIZE: Final = 8 * 1024 * 1024  # 8 MB\n\n\ndef _validate_api_endpoint(api_endpoint: str) -> None:\n    if not api_endpoint.startswith(\"https://\"):\n        raise ValueError(\"MAVVRIK_API_ENDPOINT must be an HTTPS URL\")\n    hostname: Final = (urlparse(api_endpoint).hostname or \"\").lower()\n    if not any(hostname.endswith(suffix) for suffix in _MAVVRIK_ALLOWED_SUFFIXES):\n        raise ValueError(\n            \"MAVVRIK_API_ENDPOINT host must be a Mavvrik domain (e.g. https://api.mavvrik.dev/<tenant_id>)\"\n        )\n\n\ndef _validate_gcs_url(url: str, label: str) -> None:\n    parsed: Final = urlparse(url)\n    if parsed.scheme != \"https\":\n        raise ValueError(f\"Mavvrik FOCUS destination: {label} must be HTTPS, got scheme '{parsed.scheme}'\")\n    hostname: Final = (parsed.hostname or \"\").lower()\n    if not (hostname == \"storage.googleapis.com\" or hostname.endswith(\".storage.googleapis.com\")):\n        raise ValueError(\n            f\"Mavvrik FOCUS destination: {label} must be a GCS endpoint (storage.googleapis.com), got '{hostname}'\"\n        )\n\n","sourceCodeStart":15,"sourceCodeEnd":51,"githubUrl":"https://github.com/BerriAI/litellm/blob/77b7c6c40c0c5aa5fbcb1d6a1825ac39ca8829b8/litellm/integrations/focus/destinations/mavvrik_destination.py#L15-L51","documentation":"ValueError from _validate_api_endpoint when MAVVRIK_API_ENDPOINT (config key 'api_endpoint') does not start with https://. Every Mavvrik call sends the credential in the x-api-key header, so the destination refuses to authenticate over plaintext. Raised at construction time, before any network traffic.","triggerScenarios":"Constructing FocusMavvrikDestination (directly or via FocusDestinationFactory.create(provider='mavvrik', ...)) with api_endpoint='http://api.mavvrik.dev/tenant' or 'api.mavvrik.dev/tenant' (no scheme), typically from the MAVVRIK_API_ENDPOINT env var or destination_config.","commonSituations":"Endpoint copied without the scheme, local testing against http://localhost, quotes or trailing whitespace baked into the env var by docker-compose/Kubernetes secret wrappers.","solutions":["Set the full HTTPS endpoint: export MAVVRIK_API_ENDPOINT=https://api.mavvrik.dev/<tenant_id>","Or pass it in config: FocusMavvrikDestination(prefix='focus', config={'api_endpoint': 'https://api.mavvrik.dev/<tenant_id>', ...})","Strip surrounding quotes/whitespace from the env var in container definitions"],"exampleFix":"# before\nMAVVRIK_API_ENDPOINT=http://api.mavvrik.dev/acme\n\n# after\nMAVVRIK_API_ENDPOINT=https://api.mavvrik.dev/acme","handlingStrategy":"validation","validationCode":"import os\n\nendpoint = os.getenv(\"MAVVRIK_API_ENDPOINT\") or (config or {}).get(\"api_endpoint\") or \"\"\nif not endpoint.startswith(\"https://\"):\n    raise SystemExit(f\"MAVVRIK_API_ENDPOINT must start with https://, got: {endpoint!r}\")","typeGuard":"def is_https_mavvrik_endpoint(endpoint: str) -> bool:\n    \"\"\"True when the endpoint passes litellm's scheme + host checks.\"\"\"\n    from urllib.parse import urlparse\n    if not endpoint.startswith(\"https://\"):\n        return False\n    host = (urlparse(endpoint).hostname or \"\").lower()\n    return any(host.endswith(s) for s in (\".mavvrik.dev\", \".mavvrik.ai\", \".mavvrik.app\"))","tryCatchPattern":"try:\n    destination = FocusMavvrikDestination(prefix=\"focus\", config=cfg)\nexcept ValueError as e:\n    raise SystemExit(f\"Mavvrik destination misconfigured: {e}\") from e","preventionTips":["Always copy the endpoint from the Mavvrik connector setup page including the https:// scheme and tenant path","Validate the env var in a startup config check or CI lint before deploying","Never point the destination at http:// hosts; credentials travel in the x-api-key header"],"tags":["mavvrik","https","config","env-var","validation"],"backgroundTag":"insecure-url-scheme","analyzedSha":"77b7c6c40c0c5aa5fbcb1d6a1825ac39ca8829b8","analyzedAt":"2026-08-18T11:44:31.656Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}