{"record":{"id":"35b90f2a3e855d61","repo":"BerriAI/litellm","slug":"runwayml-tts-failed-failure-reason-code-fail","errorCode":null,"errorMessage":"RunwayML TTS failed: {failure_reason} (code: {failure_code})","messagePattern":"RunwayML TTS failed: (.+?) \\(code: (.+?)\\)","errorType":"exception","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"litellm/llms/runwayml/text_to_speech/transformation.py","lineNumber":269,"sourceCode":"        Args:\n            response_data: JSON response from RunwayML task endpoint\n\n        Returns:\n            Normalized status string: \"running\", \"succeeded\", or raises on failure\n\n        Raises:\n            ValueError: If task failed or status is unknown\n        \"\"\"\n        status: Final = response_data.get(\"status\", \"\").upper()\n\n        verbose_logger.debug(\"RunwayML TTS task status: %s\", status)\n\n        if status == \"SUCCEEDED\":\n            return \"succeeded\"\n        elif status == \"FAILED\":\n            failure_reason: Final = response_data.get(\"failure\", \"Unknown error\")\n            failure_code: Final = response_data.get(\"failureCode\", \"unknown\")\n            raise ValueError(f\"RunwayML TTS failed: {failure_reason} (code: {failure_code})\")\n        elif status == \"CANCELLED\":\n            raise ValueError(\"RunwayML TTS was cancelled\")\n        elif status in [\"PENDING\", \"RUNNING\", \"THROTTLED\"]:\n            return \"running\"\n        else:\n            raise ValueError(f\"Unknown RunwayML task status: {status}\")\n\n    def _poll_task_sync(\n        self,\n        task_id: str,\n        api_base: str,\n        headers: dict[str, str],\n        timeout_secs: float = 600,\n    ) -> httpx.Response:\n        \"\"\"\n        Poll RunwayML task until completion (sync).\n\n        RunwayML POST returns immediately with a task that has status PENDING/RUNNING.","sourceCodeStart":251,"sourceCodeEnd":287,"githubUrl":"https://github.com/BerriAI/litellm/blob/77b7c6c40c0c5aa5fbcb1d6a1825ac39ca8829b8/litellm/llms/runwayml/text_to_speech/transformation.py#L251-L287","documentation":"Terminal-state mapping in the RunwayML TTS status normalization: the task FAILED, and the failure reason and failureCode from the task payload are surfaced so the caller can distinguish TTS failures from timeouts or cancellation.","triggerScenarios":"Triggered when a RunwayML TTS task finishes with a failed status.","commonSituations":"See trigger scenarios.","solutions":["Read failure_reason/failure_code to identify the cause.","Adjust TTS input text or voice parameters to valid values."],"exampleFix":"# verify voice id and text length limits in RunwayML docs.","handlingStrategy":"type-guard","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"77b7c6c40c0c5aa5fbcb1d6a1825ac39ca8829b8","analyzedAt":"2026-08-18T11:44:31.656Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}