{"record":{"id":"60b1dda6ba99c063","repo":"HKUDS/DeepTutor","slug":"failed-to-download-mineru-result-archive-exc","errorCode":null,"errorMessage":"Failed to download MinerU result archive: {exc}","messagePattern":"Failed to download MinerU result archive: (.+?)","errorType":"exception","errorClass":"MinerUError","httpStatus":null,"severity":"error","filePath":"deeptutor/services/parsing/engines/mineru/cloud.py","lineNumber":236,"sourceCode":"    body: dict[str, object] = {\n        \"files\": [{\"name\": \"connectivity-check.pdf\", \"is_ocr\": False}],\n        \"model_version\": config.model_version,\n        \"enable_formula\": config.enable_formula,\n        \"enable_table\": config.enable_table,\n    }\n    if config.api_language:\n        body[\"language\"] = config.api_language\n    with httpx.Client(base_url=base_url, headers={\"Accept\": \"application/json\"}) as client:\n        _post_json(client, \"/api/v4/file-urls/batch\", body, key_pool)\n\n\ndef _download(zip_url: str) -> bytes:\n    try:\n        response = httpx.get(zip_url, timeout=_DOWNLOAD_TIMEOUT_SECONDS, follow_redirects=True)\n        response.raise_for_status()\n        return response.content\n    except httpx.HTTPError as exc:\n        raise MinerUError(f\"Failed to download MinerU result archive: {exc}\") from exc\n\n\n# ---------------------------------------------------------------------------\n# Helpers\n# ---------------------------------------------------------------------------\n\n\ndef _match_entry(results: list, file_name: str) -> dict | None:\n    \"\"\"Pick our file's result row. Single-file batch → first row is ours, but\n    match on ``file_name`` when present to be safe.\"\"\"\n    rows = [r for r in results if isinstance(r, dict)]\n    if not rows:\n        return None\n    for row in rows:\n        if str(row.get(\"file_name\") or \"\") == file_name:\n            return row\n    return rows[0]\n","sourceCodeStart":218,"sourceCodeEnd":254,"githubUrl":"https://github.com/HKUDS/DeepTutor/blob/3e82f130422a813cdd73c10b21a44e9325f5821a/deeptutor/services/parsing/engines/mineru/cloud.py#L218-L254","documentation":"Downloading the finished result archive from the signed full_zip_url failed at the HTTP layer (status error, timeout, or connection issue).","triggerScenarios":"httpx.get(zip_url, follow_redirects=True) raising — expired link, storage outage, network drop, oversized archive hitting _DOWNLOAD_TIMEOUT_SECONDS.","commonSituations":"Result downloaded long after completion (expired URL), slow links for large artifact zips, proxy interference.","solutions":["Retry the parse promptly so the zip URL is fresh.","Check network/proxy access to the result host.","Increase the download timeout constant for large results."],"exampleFix":null,"handlingStrategy":"retry","validationCode":null,"typeGuard":null,"tryCatchPattern":"try:\n    parse_cloud(...)\nexcept MinerUError as e:\n    if \"download\" in str(e).lower():\n        time.sleep(5); parse_cloud(...)  # fresh zip URL","preventionTips":["Process results promptly after completion.","Tune download timeout for large archives."],"tags":["mineru","cloud","download","network"],"backgroundTag":"file-download-failed","analyzedSha":"3e82f130422a813cdd73c10b21a44e9325f5821a","analyzedAt":"2026-08-27T06:57:25.364Z","schemaVersion":2},"datasetVersion":"2026-08-27T08:17:20.692Z"}