{"record":{"id":"668f1d29a388509f","repo":"calesthio/OpenMontage","slug":"dashscope-asr-submit-succeeded-but-did-not-return","errorCode":null,"errorMessage":"DashScope ASR submit succeeded but did not return output.task_id","messagePattern":"DashScope ASR submit succeeded but did not return output\\.task_id","errorType":"exception","errorClass":"RuntimeError","httpStatus":null,"severity":"error","filePath":"tools/analysis/dashscope_asr.py","lineNumber":223,"sourceCode":"        import requests\n\n        payload = self._build_payload(inputs)\n        headers = {\n            \"Authorization\": f\"Bearer {api_key}\",\n            \"Content-Type\": \"application/json\",\n            \"X-DashScope-Async\": \"enable\",\n        }\n\n        # Submit\n        submit_resp = requests.post(\n            self.SUBMIT_URL, headers=headers, json=payload, timeout=(10, 60)\n        )\n        submit_data = self._json_or_raise(submit_resp)\n        self._raise_for_error(submit_resp.status_code, submit_data)\n\n        task_id = submit_data.get(\"output\", {}).get(\"task_id\")\n        if not task_id:\n            raise RuntimeError(\n                \"DashScope ASR submit succeeded but did not return \"\n                \"output.task_id\"\n            )\n\n        # Poll\n        poll_data = self._poll_task(\n            requests_module=requests,\n            api_key=api_key,\n            task_id=task_id,\n            poll_interval=float(inputs.get(\"poll_interval_seconds\", 5.0)),\n            timeout_seconds=int(inputs.get(\"timeout_seconds\", 300)),\n        )\n\n        # qwen3-asr-flash-filetrans returns output.result.transcription_url\n        # (singular \"result\", NOT \"results\" array like paraformer-v2)\n        result = poll_data.get(\"output\", {}).get(\"result\", {})\n        transcription_url = result.get(\"transcription_url\")\n        if not transcription_url:","sourceCodeStart":205,"sourceCodeEnd":241,"githubUrl":"https://github.com/calesthio/OpenMontage/blob/95e1c3d0ab93482159818560f6a8c8e866b9139f/tools/analysis/dashscope_asr.py#L205-L241","documentation":"Raised by the DashScope ASR tool (tools/analysis/dashscope_asr.py) when the async submit POST to the file-transcription endpoint returns HTTP success and passes the error-field check, but output.task_id is absent from the JSON. Without a task_id there is nothing to poll, so the run aborts.","triggerScenarios":"Submitting a transcription job with a wrong/misspelled model name (must be qwen3-asr-flash-filetrans), a payload the service soft-rejects into a non-standard body, or an API response-shape change where the task id moved to another field.","commonSituations":"Typo in the model parameter; using a parameter schema from a different DashScope ASR version; regional endpoint differences; DASHSCOPE_API_KEY valid for another service but transcription not enabled for the account.","solutions":["Print/log submit_data to see what the service actually returned — an error body without matching error fields is the usual cause","Verify the model name is exactly qwen3-asr-flash-filetrans and the payload matches current DashScope docs","Confirm the API key has ASR/file-transcription enabled on the DashScope console","Check the SUBMIT_URL matches the documented region endpoint"],"exampleFix":"// before\ntask_id = submit_data.get('output', {}).get('task_id')\n\n// after (diagnose before failing)\ntask_id = (submit_data.get('output') or {}).get('task_id')\nif not task_id:\n    raise RuntimeError(\n        f'DashScope ASR submit returned no task_id; full body: {submit_data}'\n    )","handlingStrategy":"try-catch","validationCode":"def submit_response_has_task_id(data: dict) -> bool:\n    return bool((data.get('output') or {}).get('task_id'))","typeGuard":null,"tryCatchPattern":"try:\n    result = tool.run(inputs)\nexcept RuntimeError as e:\n    if 'output.task_id' in str(e):\n        logger.error('submit body: %s', getattr(e, 'submit_data', '<not captured>'))\n        # check model name / key permissions, then retry\n    raise","preventionTips":["Use the exact model id qwen3-asr-flash-filetrans","Verify DASHSCOPE_API_KEY has file-transcription enabled before first use","Capture and log the full submit response body whenever task_id is missing"],"tags":["dashscope","asr","api","response-shape","task-creation"],"backgroundTag":null,"analyzedSha":"95e1c3d0ab93482159818560f6a8c8e866b9139f","analyzedAt":"2026-08-15T06:31:20.014Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}