{"record":{"id":"cbe3bb12f437d812","repo":"BerriAI/litellm","slug":"unsupported-frequency-self-frequency","errorCode":null,"errorMessage":"Unsupported frequency: {self.frequency}","messagePattern":"Unsupported frequency: (.+?)","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"litellm/integrations/focus/focus_logger.py","lineNumber":172,"sourceCode":"        )\n\n    def _build_scheduler_trigger(self) -> dict[str, Any]:\n        \"\"\"Return scheduler configuration for the selected frequency.\"\"\"\n        if self.frequency == \"interval\":\n            seconds: Final = self.interval_seconds or 60\n            return {\"trigger\": \"interval\", \"seconds\": seconds}\n\n        if self.frequency == \"hourly\":\n            minute = max(0, min(59, self.cron_offset_minute))\n            return {\"trigger\": \"cron\", \"minute\": minute, \"second\": 0}\n\n        if self.frequency == \"daily\":\n            total_minutes: Final = max(0, self.cron_offset_minute)\n            hour: Final = min(23, total_minutes // 60)\n            minute = min(59, total_minutes % 60)\n            return {\"trigger\": \"cron\", \"hour\": hour, \"minute\": minute, \"second\": 0}\n\n        raise ValueError(f\"Unsupported frequency: {self.frequency}\")\n\n    async def _run_scheduled_export(self) -> None:\n        \"\"\"Execute the scheduled export for the configured window.\"\"\"\n        window: Final = self._compute_time_window(datetime.now(timezone.utc))\n        await self._export_window(window=window, limit=None)\n\n    async def _export_all(\n        self,\n        *,\n        limit: int | None,\n    ) -> None:\n        \"\"\"Export all available data without a time window filter.\"\"\"\n        engine: Final = self._ensure_engine()\n        await engine.export_all(limit=limit)\n\n    async def _export_window(\n        self,\n        *,","sourceCodeStart":154,"sourceCodeEnd":190,"githubUrl":"https://github.com/BerriAI/litellm/blob/77b7c6c40c0c5aa5fbcb1d6a1825ac39ca8829b8/litellm/integrations/focus/focus_logger.py#L154-L190","documentation":"FocusLogger raises ValueError('Unsupported frequency') in its scheduler-config method when self.frequency is not one of 'interval', 'hourly', or 'daily'. Frequency defaults to 'hourly' and is normally set via the constructor or the FOCUS_FREQUENCY env var (it is lowercased on assignment). This code path builds the APScheduler trigger for the automatic export runs.","triggerScenarios":"Setting FOCUS_FREQUENCY=weekly, monthly, or 'Hourly ' (whitespace) in the environment; passing frequency='minutes' to the FocusLogger constructor; a value that lowercases to something outside the three supported strings.","commonSituations":"Wanting weekly/monthly FOCUS exports, which are not implemented; typo in the env var value; assuming cron-style expressions are accepted as frequency.","solutions":["Use one of the supported values: 'hourly', 'daily', or 'interval' (interval also needs interval_seconds).","Check FOCUS_FREQUENCY in the deployment environment and fix the value.","For custom schedules, run an external cron that calls export_usage_data(start_time_utc=..., end_time_utc=...) instead.","Validate the value at startup and fail fast with your own error message."],"exampleFix":"# before\nexport FOCUS_FREQUENCY=weekly\n\n# after\nexport FOCUS_FREQUENCY=daily","handlingStrategy":"type-guard","validationCode":"freq = (os.getenv('FOCUS_FREQUENCY') or 'hourly').strip().lower()\nif freq not in {'interval', 'hourly', 'daily'}:\n    raise SystemExit(f'FOCUS_FREQUENCY must be interval|hourly|daily, got {freq!r}')","typeGuard":"def is_valid_focus_frequency(freq: str | None) -> bool:\n    return (freq or '').strip().lower() in {'interval', 'hourly', 'daily'}","tryCatchPattern":null,"preventionTips":["Validate FOCUS_FREQUENCY at startup so the failure is immediate, not on the first scheduled tick.","Remember 'interval' also requires interval_seconds to be meaningful."],"tags":["focus-export","scheduler","frequency","enum-validation"],"backgroundTag":"invalid-enum-value","analyzedSha":"77b7c6c40c0c5aa5fbcb1d6a1825ac39ca8829b8","analyzedAt":"2026-08-18T11:44:31.656Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}