{"record":{"id":"4574272b66d0968a","repo":"calesthio/OpenMontage","slug":"gemini-omni-video-generation-failed-during-process","errorCode":null,"errorMessage":"Gemini Omni video generation failed during processing","messagePattern":"Gemini Omni video generation failed during processing","errorType":"exception","errorClass":"RuntimeError","httpStatus":null,"severity":"error","filePath":"tools/video/gemini_omni_video.py","lineNumber":328,"sourceCode":"        idx = path.rfind(marker)\n        tail = path[idx + len(marker):] if idx != -1 else path.split(\"/\")[-1]\n        return tail.split(\":\", 1)[0]\n\n    def _download_via_uri(self, requests_mod: Any, api_key: str, uri: str) -> bytes:\n        \"\"\"Poll a Files API entry until ACTIVE, then download its bytes.\"\"\"\n        file_id = self._file_id_from_uri(uri)\n        headers = {\"x-goog-api-key\": api_key}\n        deadline = time.time() + _MAX_POLL_SECONDS\n        while True:\n            status_resp = requests_mod.get(\n                f\"{_BASE_URL}/files/{file_id}\", headers=headers, timeout=15\n            )\n            status_resp.raise_for_status()\n            state = str(status_resp.json().get(\"state\", \"\")).upper()\n            if state == \"ACTIVE\":\n                break\n            if state == \"FAILED\":\n                raise RuntimeError(\"Gemini Omni video generation failed during processing\")\n            if time.time() > deadline:\n                raise TimeoutError(\"Timed out waiting for Gemini Omni video to become ACTIVE\")\n            time.sleep(_POLL_INTERVAL_SECONDS)\n\n        download_resp = requests_mod.get(\n            f\"{_BASE_URL}/files/{file_id}:download\",\n            params={\"alt\": \"media\"},\n            headers=headers,\n            timeout=300,\n        )\n        download_resp.raise_for_status()\n        return download_resp.content\n\n    def execute(self, inputs: dict[str, Any]) -> ToolResult:\n        api_key = self._get_api_key()\n        if not api_key:\n            return ToolResult(\n                success=False,","sourceCodeStart":310,"sourceCodeEnd":346,"githubUrl":"https://github.com/calesthio/OpenMontage/blob/95e1c3d0ab93482159818560f6a8c8e866b9139f/tools/video/gemini_omni_video.py#L310-L346","documentation":"Raised when the generated output file on the Google Files API transitions to state=FAILED. After submitting a Gemini Omni generation, the tool polls GET {BASE_URL}/files/{file_id} until the output becomes ACTIVE; FAILED means the generation job itself crashed or was rejected server-side after submission succeeded.","triggerScenarios":"Polling the output file's state returns 'FAILED'. Happens when the generation request is accepted but rendering fails: policy-violating prompt or reference content, internal model errors, or corrupted input references (e.g. a video that finished Files processing but is unusable for generation).","commonSituations":"Prompts with policy-triggering content (real-person likeness, violence, etc.); reference images/videos flagged by safety filters; Google-side capacity or internal errors; malformed multi-reference bindings the model cannot compose.","solutions":["Rewrite the prompt to remove potentially policy-violating content (likenesses, explicit or violent descriptions) and retry.","Swap out the reference image/video with a neutral one to test whether the reference triggers the failure.","Retry once — internal generation failures are sometimes transient.","Submit a simpler request (text-only, shorter duration) to confirm the account/key itself is healthy.","Check Google Cloud service status for Gemini API incidents."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"try:\n    result = gemini_omni_video(inputs)\nexcept RuntimeError as e:\n    if \"failed during processing\" in str(e).lower():\n        # provider-side render failure: adjust content or refs, do not blind-retry\n        log_safety_review(prompt=inputs.get(\"prompt\"), refs=inputs)\n        raise GenerationRejected(\"rewrite prompt or swap references\") from e\n    raise","preventionTips":["Keep prompts free of real-person likeness requests and explicit/violent terms.","Test new reference media with a minimal 3s generation before the full job.","Treat repeated FAILED across different prompts as an account/region issue and check Google status."],"tags":["gemini","video-generation","safety-filter","polling","provider-error"],"backgroundTag":null,"analyzedSha":"95e1c3d0ab93482159818560f6a8c8e866b9139f","analyzedAt":"2026-08-15T06:31:20.014Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}