{"record":{"id":"579027b7ea57793a","repo":"odysseus-dev/odysseus","slug":"inline-image-not-found","errorCode":null,"errorMessage":"Inline image not found","messagePattern":"Inline image not found","errorType":"http","errorClass":"HTTPException","httpStatus":404,"severity":"error","filePath":"routes/email_routes.py","lineNumber":3418,"sourceCode":"            idx = 0\n            for part in msg.walk():\n                cd = str(part.get(\"Content-Disposition\", \"\"))\n                ct = part.get_content_type()\n                is_attached_email = ct == \"message/rfc822\" and (\"attachment\" in cd.lower() or part.get_filename())\n                if part.is_multipart() and not is_attached_email:\n                    continue\n                if ct in (\"text/plain\", \"text/html\") and \"attachment\" not in cd:\n                    continue\n                content_id = (part.get(\"Content-ID\") or \"\").strip().strip(\"<>\")\n                if content_id != want:\n                    idx += 1\n                    continue\n                if not ct.lower().startswith(\"image/\"):\n                    raise HTTPException(status_code=415, detail=\"Content-ID is not an image\")\n                target_dir = attachment_extract_dir(folder, uid)\n                filepath = _extract_attachment_to_disk(msg, idx, target_dir)\n                if not filepath:\n                    raise HTTPException(status_code=404, detail=\"Inline image not found\")\n                return FileResponse(\n                    path=str(filepath),\n                    media_type=ct,\n                    headers={\"Content-Disposition\": f'inline; filename=\"{filepath.name}\"'},\n                )\n            raise HTTPException(status_code=404, detail=\"Inline image not found\")\n        except HTTPException:\n            raise\n        except Exception as e:\n            logger.error(f\"Failed to load inline image {uid}/{want}: {e}\")\n            return {\"error\": \"Mail operation failed\"}\n\n    @router.post(\"/attachment-as-doc/{uid}/{index}\")\n    def attachment_as_doc(uid: str, index: int, request: Request, folder: str = Query(\"INBOX\"), account_id: str | None = Query(None), owner: str = Depends(require_owner)):\n        \"\"\"Extract an email attachment and open it in the document editor.\n\n        Supported extensions:\n          - .pdf   → rendered as PDF Document (existing flow)","sourceCodeStart":3400,"sourceCodeEnd":3436,"githubUrl":"https://github.com/odysseus-dev/odysseus/blob/f9235ebbf13f693a6fd29ce70b097f6ec83705bf/routes/email_routes.py#L3400-L3436","documentation":"Error \"Inline image not found\" 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":["Verify the Content-ID exists among the message's inline parts.","The message may have been altered; re-fetch it and retry."],"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"}