odysseus-dev/odysseus · error · HTTPException

Inline image not found

Error message

Inline image not found

What it means

Error "Inline image not found" thrown in odysseus-dev/odysseus.

Source

Thrown at routes/email_routes.py:3418

            idx = 0
            for part in msg.walk():
                cd = str(part.get("Content-Disposition", ""))
                ct = part.get_content_type()
                is_attached_email = ct == "message/rfc822" and ("attachment" in cd.lower() or part.get_filename())
                if part.is_multipart() and not is_attached_email:
                    continue
                if ct in ("text/plain", "text/html") and "attachment" not in cd:
                    continue
                content_id = (part.get("Content-ID") or "").strip().strip("<>")
                if content_id != want:
                    idx += 1
                    continue
                if not ct.lower().startswith("image/"):
                    raise HTTPException(status_code=415, detail="Content-ID is not an image")
                target_dir = attachment_extract_dir(folder, uid)
                filepath = _extract_attachment_to_disk(msg, idx, target_dir)
                if not filepath:
                    raise HTTPException(status_code=404, detail="Inline image not found")
                return FileResponse(
                    path=str(filepath),
                    media_type=ct,
                    headers={"Content-Disposition": f'inline; filename="{filepath.name}"'},
                )
            raise HTTPException(status_code=404, detail="Inline image not found")
        except HTTPException:
            raise
        except Exception as e:
            logger.error(f"Failed to load inline image {uid}/{want}: {e}")
            return {"error": "Mail operation failed"}

    @router.post("/attachment-as-doc/{uid}/{index}")
    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)):
        """Extract an email attachment and open it in the document editor.

        Supported extensions:
          - .pdf   → rendered as PDF Document (existing flow)

View on GitHub (pinned to f9235ebbf1)

Solutions

  1. Verify the Content-ID exists among the message's inline parts.
  2. The message may have been altered; re-fetch it and retry.

When it happens

Trigger: 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.

Common situations: See trigger scenarios.


AI-assisted analysis of odysseus-dev/odysseus@f9235ebbf1 (2026-08-14). Data as JSON: /api/errors/579027b7ea57793a. Report an issue: GitHub.