{"record":{"id":"82a1249538e930ef","repo":"odysseus-dev/odysseus","slug":"no-images-found","errorCode":null,"errorMessage":"No images found","messagePattern":"No images found","errorType":"http","errorClass":"HTTPException","httpStatus":404,"severity":"error","filePath":"routes/gallery/gallery_routes.py","lineNumber":1012,"sourceCode":"    async def gallery_download_zip(request: Request):\n        user = get_current_user(request)\n        if not user:\n            raise HTTPException(401, \"Not authenticated\")\n        try:\n            data = await request.json()\n        except Exception:\n            data = {}\n        ids = data.get(\"ids\") or []\n        if not ids:\n            raise HTTPException(400, \"No images specified\")\n        db = SessionLocal()\n        try:\n            imgs = db.query(GalleryImage).filter(\n                GalleryImage.id.in_(ids),\n                GalleryImage.owner == user,\n            ).all()\n            if not imgs:\n                raise HTTPException(404, \"No images found\")\n            import io\n            import re\n            import zipfile\n            buf = io.BytesIO()\n            used = set()\n            with zipfile.ZipFile(buf, \"w\", zipfile.ZIP_DEFLATED) as zf:\n                for img in imgs:\n                    src = _gallery_image_path(img.filename)\n                    if not src.exists():\n                        continue\n                    ext = src.suffix or \".png\"\n                    base = (img.prompt or \"\").strip() or src.stem\n                    base = re.sub(r\"[^\\w\\-. ]+\", \"\", base)[:60].strip() or img.id\n                    name = f\"{base}{ext}\"\n                    i = 1\n                    while name in used:\n                        name = f\"{base}-{i}{ext}\"\n                        i += 1","sourceCodeStart":994,"sourceCodeEnd":1030,"githubUrl":"https://github.com/odysseus-dev/odysseus/blob/f9235ebbf13f693a6fd29ce70b097f6ec83705bf/routes/gallery/gallery_routes.py#L994-L1030","documentation":"404 guard in gallery_download_zip: the ids supplied matched no GalleryImage rows owned by the current user (all nonexistent, deleted, or belonging to someone else). Raised instead of streaming an empty zip so clients get an explicit not-found signal.","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 selection; none of the given image ids exist.","Refresh the gallery and reselect existing images."],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"f9235ebbf13f693a6fd29ce70b097f6ec83705bf","analyzedAt":"2026-08-14T21:47:48.359Z","contentChangedAt":"2026-08-14T21:47:48.359Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}