{"record":{"id":"7b5646b393b2ad9f","repo":"HKUDS/DeepTutor","slug":"dashscope-response-missing-output-request-id-g","errorCode":null,"errorMessage":"DashScope response missing `output` (request_id={getattr(resp, 'request_id', '')})","messagePattern":"DashScope response missing `output` \\(request_id=(.+?)\\)","errorType":"exception","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"deeptutor/services/embedding/adapters/dashscope_native.py","lineNumber":186,"sourceCode":"    def _raise_on_error(self, resp: Any, model_name: str) -> None:\n        status_code = getattr(resp, \"status_code\", None)\n        if status_code is None or status_code == HTTPStatus.OK:\n            return\n        code = getattr(resp, \"code\", \"\") or \"\"\n        message = getattr(resp, \"message\", \"\") or \"\"\n        request_id = getattr(resp, \"request_id\", \"\") or \"\"\n        raise RuntimeError(\n            f\"DashScope MultiModalEmbedding call failed: \"\n            f\"status={status_code}, code={code}, message={message}, \"\n            f\"model={model_name}, request_id={request_id}\"\n        )\n\n    def _parse_response(\n        self, resp: Any, model_name: str, request: EmbeddingRequest\n    ) -> EmbeddingResponse:\n        output = getattr(resp, \"output\", None)\n        if output is None:\n            raise ValueError(\n                f\"DashScope response missing `output` (request_id={getattr(resp, 'request_id', '')})\"\n            )\n\n        # `output` is dict-like in the SDK.\n        if isinstance(output, dict):\n            raw = output.get(\"embeddings\") or []\n        else:\n            raw = getattr(output, \"embeddings\", None) or []\n\n        embeddings: List[List[float]] = []\n        for item in raw:\n            if isinstance(item, dict):\n                vec = item.get(\"embedding\")\n            else:\n                vec = getattr(item, \"embedding\", None)\n            if vec is None:\n                continue\n            embeddings.append(list(vec))","sourceCodeStart":168,"sourceCodeEnd":204,"githubUrl":"https://github.com/HKUDS/DeepTutor/blob/3e82f130422a813cdd73c10b21a44e9325f5821a/deeptutor/services/embedding/adapters/dashscope_native.py#L168-L204","documentation":"After a successful (200) DashScope call, _parse_response requires an output attribute on the response; if output is None it raises ValueError including request_id for correlation. A missing output means the SDK returned an envelope without results — typically SDK/service contract drift or a truncated response.","triggerScenarios":"DashScope returns 200 but the response object lacks output — SDK version drift changing the response shape, gateway interference, or an upstream anomaly; hit inside _embed_multimodal/_embed_text parsing.","commonSituations":"Upgrading the dashscope SDK to a version with a different response layout; proxies or serializing middlewares stripping attributes; intermittent upstream incidents.","solutions":["Pin/upgrade dashscope to the version the adapter was built against (check project extras)","Retry once — transient envelopes occur; keep request_id for tracing","If persistent, capture the raw SDK response and report with request_id to DashScope support"],"exampleFix":"# before\nresp = await adapter.embed(req)  # ValueError: missing `output`\n# after\nfor attempt in range(2):\n    try:\n        resp = await adapter.embed(req)\n        return resp\n    except ValueError as e:\n        if \"missing `output`\" in str(e) and attempt == 0:\n            continue\n        raise","handlingStrategy":"retry","validationCode":null,"typeGuard":null,"tryCatchPattern":"try:\n    return await adapter.embed(req)\nexcept ValueError as e:\n    if \"missing `output`\" in str(e):\n        await asyncio.sleep(1)\n        return await adapter.embed(req)\n    raise","preventionTips":["Pin the dashscope SDK version the adapter targets","Monitor for this error rate after SDK upgrades","Keep request_id logs for incident reports"],"tags":["dashscope","response-parsing","embeddings","sdk"],"backgroundTag":"unexpected-response-shape","analyzedSha":"3e82f130422a813cdd73c10b21a44e9325f5821a","analyzedAt":"2026-08-27T06:57:25.364Z","schemaVersion":2},"datasetVersion":"2026-08-27T08:17:20.692Z"}