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}")

    @staticmethod

View on GitHub (pinned to 95e1c3d0ab)

Solutions

  1. Read the message text — it is the upstream failure reason (e.g. speaker permission denied, quota exceeded)
  2. Match it against _diagnostic_hint categories: key flow, voice authorization, quota, or additions.explicit_language misuse
  3. Fix the underlying cause (authorize the voice, top up quota, remove unsupported fields) and resubmit
  4. 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

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


AI-assisted analysis of calesthio/OpenMontage@95e1c3d0ab (2026-08-15). Data as JSON: /api/errors/530e14f895895f83. Report an issue: GitHub.