calesthio/OpenMontage · error · RuntimeError

DashScope ASR task succeeded but result.transcription_url mi

Error message

DashScope ASR task succeeded but result.transcription_url missing

What it means

Raised when the DashScope ASR polling loop reports SUCCEEDED but output.result.transcription_url is missing. The code deliberately reads the singular 'result' object (qwen3-asr-flash-filetrans shape) rather than the 'results' array used by paraformer-v2, so a missing URL means the success payload does not match the expected schema.

Source

Thrown at tools/analysis/dashscope_asr.py:242

                "DashScope ASR submit succeeded but did not return "
                "output.task_id"
            )

        # Poll
        poll_data = self._poll_task(
            requests_module=requests,
            api_key=api_key,
            task_id=task_id,
            poll_interval=float(inputs.get("poll_interval_seconds", 5.0)),
            timeout_seconds=int(inputs.get("timeout_seconds", 300)),
        )

        # qwen3-asr-flash-filetrans returns output.result.transcription_url
        # (singular "result", NOT "results" array like paraformer-v2)
        result = poll_data.get("output", {}).get("result", {})
        transcription_url = result.get("transcription_url")
        if not transcription_url:
            raise RuntimeError(
                "DashScope ASR task succeeded but "
                "result.transcription_url missing"
            )

        # Download transcription JSON
        trans_resp = requests.get(transcription_url, timeout=120)
        trans_resp.raise_for_status()
        transcription = trans_resp.json()

        # Save full transcription
        output_path = Path(
            inputs.get("output_path", "dashscope_asr.json")
        )
        output_path.parent.mkdir(parents=True, exist_ok=True)
        output_path.write_text(
            json.dumps(transcription, ensure_ascii=False, indent=2) + "\n",
            encoding="utf-8",
        )

View on GitHub (pinned to 95e1c3d0ab)

Solutions

  1. Log poll_data['output'] to see the actual success payload structure
  2. Confirm the model is qwen3-asr-flash-filetrans; if using paraformer-v2, read output.results[].transcription_url instead
  3. Retry the download/poll once after a few seconds in case the result materializes late
  4. Update the result extraction to the current documented schema

Example fix

// before
result = poll_data.get('output', {}).get('result', {})
transcription_url = result.get('transcription_url')

// after (handle both envelope shapes)
out = poll_data.get('output', {})
url = (out.get('result') or {}).get('transcription_url')
if not url:
    for item in out.get('results') or []:
        url = url or item.get('transcription_url')
if not url:
    raise RuntimeError(f'no transcription_url in output: {out}')
Defensive patterns

Strategy: try-catch

Validate before calling

def result_has_transcription_url(poll_data: dict) -> bool:
    out = poll_data.get('output') or {}
    if (out.get('result') or {}).get('transcription_url'):
        return True
    return any((r or {}).get('transcription_url') for r in out.get('results') or [])

Try / catch

try:
    result = tool.run(inputs)
except RuntimeError as e:
    if 'transcription_url missing' in str(e):
        time.sleep(5)
        result = tool.run(inputs)  # result may materialize late; one retry
    else:
        raise

Prevention

When it happens

Trigger: Task marked SUCCEEDED before results finished materializing (result object empty); using a paraformer-family model whose output uses output.results[] instead; API shape change moving the URL (e.g. to output.result.file_url or a transcriptionUrls list).

Common situations: Model name drift between qwen3-asr-flash-filetrans and paraformer-v2 file-transcription (different result envelopes); polling immediately after SUCCEEDED on a partially materialized result; DashScope contract update.

Related errors


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