binary-husky/gpt_academic · error · RuntimeError
Reached the limit of Doc2x: Trace ID: {trace_id} {uid} {code
Error message
Reached the limit of Doc2x:
Trace ID: {trace_id} {uid}
{code} - {meg} What it means
Doc2x returned HTTP 200 but the response body's code field is one of parse_page_limit_exceeded or parse_concurrency_limit — the account hit its page quota for this parse or has too many concurrent parse jobs. The message carries trace-id, uid, the code, and the server's message field.
Source
Thrown at crazy_functions/pdf_fns/parse_pdf_via_doc2x.py:65
def doc2x_api_response_status(response, uid=""):
"""
Check the status of Doc2x API response
Args:
response_data: Response object from Doc2x API
"""
response_json = response.json()
response_data = response_json.get("data", {})
code = response_json.get("code", "Unknown")
meg = response_data.get("message", response_json)
trace_id = response.headers.get("trace-id", "Failed to get trace-id")
if response.status_code != 200:
raise RuntimeError(
f"Doc2x return an error:\nTrace ID: {trace_id} {uid}\n{response.status_code} - {response_json}"
)
if code in ["parse_page_limit_exceeded", "parse_concurrency_limit"]:
raise RuntimeError(
f"Reached the limit of Doc2x:\nTrace ID: {trace_id} {uid}\n{code} - {meg}"
)
if code not in ["ok", "success"]:
raise RuntimeError(
f"Doc2x return an error:\nTrace ID: {trace_id} {uid}\n{code} - {meg}"
)
return response_data
def 解析PDF_DOC2X_转Latex(pdf_file_path):
zip_file_path, unzipped_folder = 解析PDF_DOC2X(pdf_file_path, format="tex")
return unzipped_folder
def 解析PDF_DOC2X(pdf_file_path, format="tex"):
"""
format: 'tex', 'md', 'docx'
"""View on GitHub (pinned to d6bde0fa54)
Solutions
- Wait for in-flight parses to finish and retry sequentially (concurrency limit)
- Check the Doc2x console for remaining page quota; upgrade the plan or top up pages
- Split large PDFs into smaller chunks and process them over time
- Note the trace-id for disputing miscounted pages with support
Defensive patterns
Strategy: retry
Validate before calling
def can_parse_now(pages: int) -> bool:
return concurrent_parses == 0 and pages <= remaining_page_quota() Try / catch
try:
upload_and_parse(pdf)
except RuntimeError as e:
if 'parse_concurrency_limit' in str(e):
time.sleep(30); upload_and_parse(pdf) # serialize and retry
elif 'parse_page_limit_exceeded' in str(e):
raise RuntimeError('Doc2x page quota exhausted — top up or split the PDF') from e
raise Prevention
- Process Doc2x parses sequentially, never in parallel threads
- Track page counts against the account quota before large jobs
- Split huge PDFs (e.g. >200 pages) into parts
When it happens
Trigger: Uploading PDFs whose page count exceeds the account's remaining page quota; running several Doc2x parses simultaneously beyond the concurrency allowance.
Common situations: Batch-processing many PDFs in one go; shared team key hitting limits; large documents (hundreds of pages) on a free/trial tier.
Related errors
- Doc2x return an error: Trace ID: {trace_id} {uid} {response.
- Doc2x return an error: Trace ID: {trace_id} {uid} {code} - {
- Doc2x return an error: {res_data}
- Searxng(在线搜索服务)当前使用人数太多,请稍后。
- GROBID服务不可用,请修改config中的GROBID_URL,可修改成本地GROBID服务。
AI-assisted analysis of binary-husky/gpt_academic@d6bde0fa54 (2026-08-14).
Data as JSON: /api/errors/b1aa0be5b6c79f82.
Report an issue: GitHub.