{"record":{"id":"a3fb9d9f904167ae","repo":"BerriAI/litellm","slug":"video-generation-failed-failure-reason","errorCode":null,"errorMessage":"Video generation failed: {failure_reason}","messagePattern":"Video generation failed: (.+?)","errorType":"exception","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"litellm/llms/runwayml/videos/transformation.py","lineNumber":376,"sourceCode":"    def _extract_video_url_from_response(self, response_data: dict[str, Any]) -> str:\n        \"\"\"\n        Helper method to extract video URL from RunwayML response.\n        Shared between sync and async transforms.\n        \"\"\"\n        # Extract video URL from the output field\n        video_url = None\n        if \"output\" in response_data and response_data[\"output\"]:\n            output: Final = response_data[\"output\"]\n            video_url = output[0] if isinstance(output, list) else output\n\n        if not video_url:\n            # Check if the video generation failed or is still processing\n            status: Final = response_data.get(\"status\", \"UNKNOWN\")\n            if status in [\"PENDING\", \"RUNNING\", \"THROTTLED\"]:\n                raise ValueError(f\"Video is still processing (status: {status}). Please wait and try again.\")\n            elif status == \"FAILED\":\n                failure_reason: Final = response_data.get(\"failure\", \"Unknown error\")\n                raise ValueError(f\"Video generation failed: {failure_reason}\")\n            else:\n                raise ValueError(\"Video URL not found in response. Video may not be ready yet.\")\n\n        return video_url\n\n    def transform_video_content_response(\n        self,\n        raw_response: httpx.Response,\n        logging_obj: LiteLLMLoggingObj,\n    ) -> bytes:\n        \"\"\"\n        Transform the RunwayML video content download response (synchronous).\n\n        RunwayML's task endpoint returns JSON with a video URL in the output field.\n        We need to extract the URL and download the video.\n\n        Example response:\n        {","sourceCodeStart":358,"sourceCodeEnd":394,"githubUrl":"https://github.com/BerriAI/litellm/blob/77b7c6c40c0c5aa5fbcb1d6a1825ac39ca8829b8/litellm/llms/runwayml/videos/transformation.py#L358-L394","documentation":"Terminal-state guard while extracting a video URL: the output field is empty and the task status is FAILED, so the failure reason from the task payload is raised instead of a misleading 'no URL' error.","triggerScenarios":"Triggered when a RunwayML video generation task finishes with a failed status.","commonSituations":"See trigger scenarios.","solutions":["Read failure_reason to identify the cause.","Adjust prompt or parameters to comply with RunwayML constraints."],"exampleFix":"# check the failed task in the RunwayML dashboard.","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"}