{"record":{"id":"cb4f8ed4bd19a292","repo":"odysseus-dev/odysseus","slug":"no-image-files-found-on-disk","errorCode":null,"errorMessage":"No image files found on disk","messagePattern":"No image files found on disk","errorType":"http","errorClass":"HTTPException","httpStatus":404,"severity":"error","filePath":"routes/gallery/gallery_routes.py","lineNumber":1034,"sourceCode":"            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\n                    used.add(name)\n                    zf.write(src, arcname=name)\n            if not used:\n                raise HTTPException(404, \"No image files found on disk\")\n            from fastapi import Response\n            return Response(\n                content=buf.getvalue(),\n                media_type=\"application/zip\",\n                headers={\"Content-Disposition\": 'attachment; filename=\"gallery-photos.zip\"'},\n            )\n        finally:\n            db.close()\n\n    # ---- POST /api/gallery/clear-user-tags ----\n    # Wipe the `tags` field on every image owned by the current user.\n    # Leaves `ai_tags` intact. Use after a bug populated user-tags with\n    # AI-suggested values you never added.\n    @router.post(\"/api/gallery/clear-user-tags\")\n    async def clear_gallery_user_tags(request: Request) -> Dict[str, Any]:\n        user = get_current_user(request)\n        db = SessionLocal()\n        try:","sourceCodeStart":1016,"sourceCodeEnd":1052,"githubUrl":"https://github.com/odysseus-dev/odysseus/blob/f9235ebbf13f693a6fd29ce70b097f6ec83705bf/routes/gallery/gallery_routes.py#L1016-L1052","documentation":"Error \"No image files found on disk\" 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":["Restore the missing image files from backup or re-upload them.","Check the gallery storage directory path and permissions."],"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"}