calesthio/OpenMontage · error · TimeoutError
Suno generation timed out after {self._MAX_WAIT}s (taskId: {
Error message
Suno generation timed out after {self._MAX_WAIT}s (taskId: {task_id}) What it means
TimeoutError raised by SunoTool._poll when the task does not reach SUCCESS within _MAX_WAIT seconds. The loop polls every _POLL_INTERVAL and accumulates elapsed time; non-terminal statuses (PENDING, GENERATING, TEXT_SUCCESS, FIRST_SUCCESS) keep it waiting until the budget is exhausted. The task may still complete later on the server — only the client gave up.
Source
Thrown at tools/audio/suno_music.py:273
timeout=30,
)
response.raise_for_status()
result = response.json()
status = result.get("data", {}).get("status") or result.get("status", "")
if status == "SUCCESS":
return result.get("data", result)
elif status in (
"CREATE_TASK_FAILED",
"GENERATE_AUDIO_FAILED",
"SENSITIVE_WORD_ERROR",
):
raise RuntimeError(f"Suno generation failed with status: {status}")
# PENDING, GENERATING, TEXT_SUCCESS, FIRST_SUCCESS — keep polling
raise TimeoutError(
f"Suno generation timed out after {self._MAX_WAIT}s (taskId: {task_id})"
)
def _download(self, audio_url: str, inputs: dict[str, Any], api_key: str) -> Path:
"""Download the audio file to the output path."""
import requests
output_path = Path(inputs.get("output_path", "suno_output.mp3"))
output_path.parent.mkdir(parents=True, exist_ok=True)
response = requests.get(audio_url, timeout=120)
response.raise_for_status()
output_path.write_bytes(response.content)
return output_path
View on GitHub (pinned to 95e1c3d0ab)
Solutions
- Increase the tool's max-wait configuration (or pass a longer timeout input) — full-song generation routinely takes several minutes.
- Extract the taskId from the error message and re-poll it later instead of submitting a new (billable) generation.
- Check the Suno gateway status/queue; if congested, retry at an off-peak time.
- Distinguish this TimeoutError from RuntimeError in callers so a timeout triggers resume/poll-again logic rather than a full resubmit.
Example fix
// before
result = tool.run({"prompt": lyrics, "output_path": "song.mp3"}) # TimeoutError after MAX_WAIT
// after (catch and resume polling by taskId)
try:
result = tool.run(inputs)
except TimeoutError as e:
task_id = extract_task_id(str(e))
result = tool.resume_task(task_id, inputs) # poll existing task again Defensive patterns
Strategy: retry
Try / catch
try:
result = tool.run(inputs)
except TimeoutError as e:
task_id = str(e).split("taskId: ")[-1].rstrip(")")
result = poll_existing_task(task_id, inputs) # resume, do not resubmit Prevention
- Set the wait budget above the worst-case full-song generation time
- Persist the taskId on submission so a timeout can be resumed instead of re-billed
When it happens
Trigger: Long music generations (full songs with lyrics) exceeding the fixed wait budget; Suno queue congestion during peak hours; a task stuck in GENERATING due to a server-side hang.
Common situations: Default timeout too short for custom-mode full-song generation; slow Suno proxy adding latency per poll; retrying immediately after a timeout creating duplicate tasks.
Understand the failure class
- Timeouts: ETIMEDOUT, deadlines, and hung requests — what actually expires when a request times out.
Related errors
- Suno generation failed with status: {status}
- Kling Classic task {task_id} timed out after {timeout_second
- Kling Turbo task {task_id} timed out after {timeout_seconds}
- DashScope ASR task {task_id} did not finish within {timeout_
- Prediction {prediction_id} did not finish within {timeout:.0
AI-assisted analysis of calesthio/OpenMontage@95e1c3d0ab (2026-08-15).
Data as JSON: /api/errors/ee6258465bc36568.
Report an issue: GitHub.