{"record":{"id":"c21fb2b26a61b863","repo":"odysseus-dev/odysseus","slug":"no-file-provided","errorCode":null,"errorMessage":"No file provided","messagePattern":"No file provided","errorType":"http","errorClass":"HTTPException","httpStatus":400,"severity":"error","filePath":"routes/gallery/gallery_routes.py","lineNumber":361,"sourceCode":"        if ir.status_code == 200:\n            return base64.b64encode(ir.content).decode()\n    return None\n\n\ndef setup_gallery_routes() -> APIRouter:\n    router = APIRouter(tags=[\"gallery\"])\n\n    # ---- POST /api/gallery/upload ----\n    @router.post(\"/api/gallery/upload\")\n    async def gallery_upload(request: Request):\n        \"\"\"Upload an image file to the gallery with EXIF extraction and dedup.\"\"\"\n        import uuid\n        from pathlib import Path\n\n        form = await request.form()\n        file = form.get(\"file\")\n        if not file or not hasattr(file, 'filename'):\n            raise HTTPException(400, \"No file provided\")\n\n        user = get_current_user(request)\n        album_id = form.get(\"album_id\") or None\n        content = await read_upload_limited(file, GALLERY_UPLOAD_MAX_BYTES, \"Gallery upload\")\n\n        # Duplicate detection via SHA-256\n        file_hash = hashlib.sha256(content).hexdigest()\n        db = SessionLocal()\n        try:\n            if album_id and user is not None:\n                _get_or_404_album(db, album_id, user)\n\n            # SECURITY: scope the dup-detect to THIS user — otherwise a\n            # caller can probe whether someone else uploaded the same\n            # file (the response leaks the existing row's id+filename).\n            _dup_q = db.query(GalleryImage).filter(\n                GalleryImage.file_hash == file_hash,\n                GalleryImage.is_active == True,","sourceCodeStart":343,"sourceCodeEnd":379,"githubUrl":"https://github.com/odysseus-dev/odysseus/blob/f9235ebbf13f693a6fd29ce70b097f6ec83705bf/routes/gallery/gallery_routes.py#L343-L379","documentation":"Error \"No file provided\" 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":["Attach a file to the upload request.","Select a file in the picker before submitting."],"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-15T17:31:12.345Z"}