{"record":{"id":"83cc47770e43e9d9","repo":"odysseus-dev/odysseus","slug":"pdf-render-failed-e","errorCode":null,"errorMessage":"PDF render failed: {e}","messagePattern":"PDF render failed: (.+?)","errorType":"http","errorClass":"HTTPException","httpStatus":500,"severity":"error","filePath":"routes/document/document_routes.py","lineNumber":1435,"sourceCode":"            pdf_path = _locate_current_user_upload(request, upload_id, user)\n            if not pdf_path:\n                raise HTTPException(404, f\"Source PDF {upload_id} not found\")\n\n            # Fail fast with a clear 503 if the optional PyMuPDF dependency\n            # is missing — fill_fields/stamp_annotations will otherwise\n            # raise RuntimeError deep inside and bubble out as a 500.\n            # Mirrors the convention in _load_pdf_viewer_fitz above.\n            _load_pdf_viewer_fitz()\n\n            values = parse_markdown_to_values(doc.current_content or \"\")\n            out_path = tempfile.NamedTemporaryFile(suffix=\".pdf\", delete=False).name\n            _to_unlink.append(out_path)\n            try:\n                fill_fields(pdf_path, out_path, values)\n            except Exception as e:\n                logger.error(f\"render_pdf fill_fields failed for {doc_id}: {e}\")\n                _cleanup_temps()\n                raise HTTPException(500, f\"PDF render failed: {e}\")\n\n            annotations = parse_markdown_annotations(doc.current_content or \"\")\n            if annotations:\n                ann_sig_ids = [\n                    a[\"value\"][len(\"signature:\"):].strip()\n                    for a in annotations\n                    if a.get(\"kind\") == \"signature\"\n                    and isinstance(a.get(\"value\"), str)\n                    and a[\"value\"].startswith(\"signature:\")\n                ]\n                ann_signature_pngs: dict[str, bytes] = {}\n                if ann_sig_ids:\n                    # SECURITY: filter by owner so a caller can't reference\n                    # someone else's signature ID from doc markdown and have\n                    # it stamped/exported.\n                    _sig_q = db.query(Signature).filter(Signature.id.in_(ann_sig_ids))\n                    if user:\n                        _sig_q = _sig_q.filter(Signature.owner == user)","sourceCodeStart":1417,"sourceCodeEnd":1453,"githubUrl":"https://github.com/odysseus-dev/odysseus/blob/f9235ebbf13f693a6fd29ce70b097f6ec83705bf/routes/document/document_routes.py#L1417-L1453","documentation":"Error \"PDF render failed: {e}\" thrown in odysseus-dev/odysseus.","triggerScenarios":"Triggered when the corresponding server-side validation or runtime check at the recorded location rejects the request or operation and returns this error message to the caller.","commonSituations":"See trigger scenarios.","solutions":["Check the server logs for the underlying PDF rendering error.","Verify the PDF file is valid and not corrupted, then retry the render."],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"f9235ebbf13f693a6fd29ce70b097f6ec83705bf","analyzedAt":"2026-08-14T21:47:48.359Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}