calesthio/OpenMontage · error · RuntimeError
Doubao task failed: {query_data.get('message', 'unknown erro
Error message
Doubao task failed: {query_data.get('message', 'unknown error')} What it means
Raised inside _poll_query when the Doubao task query returns data.task_status == 3, the API's failure status. The message embeds the top-level message field from the query payload (falling back to 'unknown error'), so the actual failure reason comes from the service: invalid voice, quota, content moderation, etc.
Source
Thrown at tools/audio/doubao_tts.py:360
timeout_seconds: int,
) -> dict[str, Any]:
deadline = time.time() + timeout_seconds
while time.time() < deadline:
time.sleep(poll_interval)
headers = self._headers(
api_key=api_key,
resource_id=resource_id,
request_id=str(uuid.uuid4()),
return_usage=return_usage,
)
response = requests_module.post(self.QUERY_URL, headers=headers, json={"task_id": task_id}, timeout=(10, 60))
query_data = self._json_or_raise(response)
self._raise_for_doubao_error(response.status_code, query_data)
status = query_data.get("data", {}).get("task_status")
if status == 2:
return query_data
if status == 3:
raise RuntimeError(f"Doubao task failed: {query_data.get('message', 'unknown error')}")
raise TimeoutError(f"Doubao task did not finish within {timeout_seconds} seconds")
@staticmethod
def _json_or_raise(response: Any) -> dict[str, Any]:
try:
return response.json()
except ValueError as exc:
raise RuntimeError(f"Non-JSON response from Doubao API: HTTP {response.status_code}") from exc
def _raise_for_doubao_error(self, http_status: int, payload: dict[str, Any]) -> None:
code = payload.get("code")
if http_status < 400 and code == 20000000:
return
message = payload.get("message", "unknown error")
hint = self._diagnostic_hint(message)
raise RuntimeError(f"HTTP {http_status}, code {code}: {message}{hint}")
@staticmethodView on GitHub (pinned to 95e1c3d0ab)
Solutions
- Read the message text — it is the upstream failure reason (e.g. speaker permission denied, quota exceeded)
- Match it against _diagnostic_hint categories: key flow, voice authorization, quota, or additions.explicit_language misuse
- Fix the underlying cause (authorize the voice, top up quota, remove unsupported fields) and resubmit
- If message is 'unknown error', log the full query_data for support escalation
Defensive patterns
Strategy: try-catch
Try / catch
try:
result = doubao_tool.execute(inputs)
except RuntimeError as e:
msg = str(e)
if "quota" in msg.lower():
alert_billing()
elif "permission denied" in msg.lower():
alert_voice_config()
else:
raise Prevention
- Pre-authorize voice_id for the account before batch runs
- Monitor remaining character package quota before long jobs
- Keep text within moderation-safe content to avoid status-3 failures
When it happens
Trigger: Any submit accepted but processing failed server-side: unauthorized voice_id, text failing content moderation, malformed encoding parameters, exhausted character package, or resource misconfiguration.
Common situations: voice_type not authorized for the API key; Chinese text sent with mismatched language parameters; free quota used up; account not activated for the speech resource.
Related errors
- Doubao task completed but did not return data.audio_url
- Doubao submit succeeded but did not return data.task_id
- Kling TTS task failed
- Kling Classic result path data.task_result.{result_key} is n
- Kling Classic task failed
AI-assisted analysis of calesthio/OpenMontage@95e1c3d0ab (2026-08-15).
Data as JSON: /api/errors/530e14f895895f83.
Report an issue: GitHub.