{"record":{"id":"3f3f30e37548c883","repo":"opendatalab/MinerU","slug":"exc-detail","errorCode":null,"errorMessage":"{exc.detail}","messagePattern":"\\{exc\\.detail\\}","errorType":"http","errorClass":"HTTPException","httpStatus":null,"severity":"error","filePath":"mineru/cli/router.py","lineNumber":1223,"sourceCode":"                list(file_names)\n                if isinstance(file_names, list) and all(isinstance(item, str) for item in file_names)\n                else []\n            )\n            return await registry.register(\n                upstream_server_id=server.server_id,\n                upstream_base_url=server.base_url,\n                upstream_task_id=upstream_payload[\"task_id\"],\n                backend=upstream_payload[\"backend\"],\n                file_names=normalized_file_names,\n                created_at=upstream_payload[\"created_at\"],\n                status=upstream_payload[\"status\"],\n                started_at=upstream_payload[\"started_at\"] if isinstance(upstream_payload[\"started_at\"], str) else None,\n                completed_at=upstream_payload[\"completed_at\"] if isinstance(upstream_payload[\"completed_at\"], str) else None,\n                error=upstream_payload[\"error\"] if isinstance(upstream_payload[\"error\"], str) else None,\n                queued_ahead=upstream_payload[\"queued_ahead\"],\n            )\n        except UpstreamSubmissionRejected as exc:\n            raise HTTPException(status_code=exc.status_code, detail=exc.detail) from exc\n        except UpstreamSubmissionUnavailable as exc:\n            attempted_servers.add(server.server_id)\n            last_error = f\"Failed to submit task via {server.server_id}: {exc}\"\n            await worker_pool.mark_submission_failure(server.server_id, str(exc))\n        finally:\n            await worker_pool.release_submission_server(server.server_id)\n\n\nasync def fetch_router_task_status(\n    request: Request,\n    task: RouterTaskRecord,\n) -> RouterTaskRecord:\n    if is_task_terminal(task.status):\n        return task\n\n    registry: RouterTaskRegistry = request.app.state.router_task_registry\n    client: httpx.AsyncClient = request.app.state.http_client\n    url = f\"{task.upstream_base_url}{TASKS_ENDPOINT}/{task.upstream_task_id}\"","sourceCodeStart":1205,"sourceCodeEnd":1241,"githubUrl":"https://github.com/opendatalab/MinerU/blob/4fe4bde114a23ee5dd637eae99b767f4669bf58c/mineru/cli/router.py#L1205-L1241","documentation":"HTTPException that propagates an UpstreamSubmissionRejected: the upstream answered POST /tasks with a definitive non-retryable, non-202 status (anything outside 202 and HTTP_RETRYABLE_STATUS_CODES). The upstream's status code and body detail are passed through to the client.","triggerScenarios":"Upstream returns e.g. 400/413/422 to the submit request (invalid params, file too large) — router re-raises HTTPException(exc.status_code, exc.detail) instead of failing over.","commonSituations":"Client submits an unsupported file type or oversized multipart body; upstream rejects authentication; version mismatch changes the submit contract. Because rejection is definitive, the router does not try other servers.","solutions":["Read the returned status code and detail — it mirrors the upstream rejection reason (e.g. 413 payload too large)","Fix the client-side request: file type, size limits, or parameters per the upstream API","If the rejection seems wrong, inspect the upstream server logs for the same request"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":"# client-side preflight: reject unsupported/oversized files before submitting\nALLOWED = {'.pdf', '.doc', '.docx', '.ppt', '.pptx'}\nMAX_BYTES = 200 * 1024 * 1024\n\ndef file_ok(path) -> bool:\n    return path.suffix.lower() in ALLOWED and path.stat().st_size <= MAX_BYTES","typeGuard":null,"tryCatchPattern":"resp = client.post(f\"{router}/tasks\", files=files)\nif resp.status_code >= 400:\n    detail = resp.json().get('detail', '')\n    if resp.status_code == 413:\n        compress_or_split(files)\n    else:\n        raise SubmissionRejected(resp.status_code, detail)  # do not retry 4xx","preventionTips":["Do not retry 4xx rejections — they are deterministic; fix the request instead","Validate file type and size against the upstream's limits before submitting","Propagate the upstream detail to your logs; it names the exact rejection reason"],"tags":["mineru","router","upstream","http","pass-through"],"backgroundTag":null,"analyzedSha":"4fe4bde114a23ee5dd637eae99b767f4669bf58c","analyzedAt":"2026-08-14T21:29:18.456Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}