{"record":{"id":"09ffef71744af143","repo":"calesthio/OpenMontage","slug":"suno-generation-failed-with-status-status","errorCode":null,"errorMessage":"Suno generation failed with status: {status}","messagePattern":"Suno generation failed with status: (.+?)","errorType":"exception","errorClass":"RuntimeError","httpStatus":null,"severity":"error","filePath":"tools/audio/suno_music.py","lineNumber":269,"sourceCode":"            response = requests.get(\n                f\"{self._BASE_URL}/generate/record-info\",\n                params={\"taskId\": task_id},\n                headers={\"Authorization\": f\"Bearer {api_key}\"},\n                timeout=30,\n            )\n            response.raise_for_status()\n            result = response.json()\n\n            status = result.get(\"data\", {}).get(\"status\") or result.get(\"status\", \"\")\n\n            if status == \"SUCCESS\":\n                return result.get(\"data\", result)\n            elif status in (\n                \"CREATE_TASK_FAILED\",\n                \"GENERATE_AUDIO_FAILED\",\n                \"SENSITIVE_WORD_ERROR\",\n            ):\n                raise RuntimeError(f\"Suno generation failed with status: {status}\")\n\n            # PENDING, GENERATING, TEXT_SUCCESS, FIRST_SUCCESS — keep polling\n\n        raise TimeoutError(\n            f\"Suno generation timed out after {self._MAX_WAIT}s (taskId: {task_id})\"\n        )\n\n    def _download(self, audio_url: str, inputs: dict[str, Any], api_key: str) -> Path:\n        \"\"\"Download the audio file to the output path.\"\"\"\n        import requests\n\n        output_path = Path(inputs.get(\"output_path\", \"suno_output.mp3\"))\n        output_path.parent.mkdir(parents=True, exist_ok=True)\n\n        response = requests.get(audio_url, timeout=120)\n        response.raise_for_status()\n        output_path.write_bytes(response.content)\n","sourceCodeStart":251,"sourceCodeEnd":287,"githubUrl":"https://github.com/calesthio/OpenMontage/blob/95e1c3d0ab93482159818560f6a8c8e866b9139f/tools/audio/suno_music.py#L251-L287","documentation":"Raised while polling a Suno task when the API reports a terminal failure status: CREATE_TASK_FAILED, GENERATE_AUDIO_FAILED, or SENSITIVE_WORD_ERROR. Unlike PENDING/GENERATING states, these statuses never resolve, so the client aborts instead of polling forever. The status string names the failure class: task creation rejected, audio generation failed server-side, or the prompt lyrics tripped content moderation.","triggerScenarios":"Polling GET on a Suno taskId after generation, where the gateway returns status CREATE_TASK_FAILED (bad request/quota), GENERATE_AUDIO_FAILED (model-side failure), or SENSITIVE_WORD_ERROR (prompt or lyrics contained flagged words).","commonSituations":"Lyrics or style prompt containing names of public figures, violence/sexual terms, or trademarked brands triggering moderation; account out of credits causing task creation failure; Suno service outage causing generation failures.","solutions":["If status is SENSITIVE_WORD_ERROR: rewrite the prompt/lyrics removing flagged terms (artist names, explicit language, brand names) and resubmit.","If CREATE_TASK_FAILED: check account quota/credits on the Suno gateway and validate request parameters.","If GENERATE_AUDIO_FAILED: retry once after a short delay — transient model failures are common; if persistent, check the provider status page.","Handle this error in the caller to surface the status to the end user instead of retrying blindly."],"exampleFix":"// before\nresult = tool.run({\"prompt\": \"a song about [artist name]\", ...})\n\n// after (moderation-safe prompt + error handling)\ntry:\n    result = tool.run({\"prompt\": \"an upbeat acoustic song about summer\", ...})\nexcept RuntimeError as e:\n    if \"SENSITIVE_WORD_ERROR\" in str(e):\n        result = tool.run({\"prompt\": sanitize(prompt), ...})\n    else:\n        raise","handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"try:\n    result = tool.run(inputs)\nexcept RuntimeError as e:\n    if \"SENSITIVE_WORD_ERROR\" in str(e):\n        result = tool.run({**inputs, \"prompt\": sanitize(prompt)})\n    else:\n        raise","preventionTips":["Pre-filter prompts/lyrics for artist names, slurs, and brand terms before submission","Map each terminal Suno status to a user-facing message instead of retrying blindly"],"tags":["suno","music","content-moderation","polling","api"],"backgroundTag":null,"analyzedSha":"95e1c3d0ab93482159818560f6a8c8e866b9139f","analyzedAt":"2026-08-15T06:31:20.014Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}