{"record":{"id":"66060594bed961c4","repo":"invoke-ai/InvokeAI","slug":"failed-to-get-gallery-item-names-for-date","errorCode":null,"errorMessage":"Failed to get gallery item names for date","messagePattern":"Failed to get gallery item names for date","errorType":"http","errorClass":"HTTPException","httpStatus":500,"severity":"error","filePath":"invokeai/app/api/routers/virtual_boards.py","lineNumber":96,"sourceCode":") -> GalleryItemNamesResult:\n    \"\"\"Gets ordered polymorphic (image + video) item refs for a specific date.\n\n    Deprecated: use `GET /v1/gallery/item_names?created_date=<date>`, which returns the same\n    order as a flat name list instead of one model per item.\n    \"\"\"\n    try:\n        return ApiDependencies.invoker.services.gallery.list_item_names(\n            starred_first=starred_first,\n            order_dir=order_dir,\n            categories=categories,\n            is_intermediate=False,\n            search_term=search_term,\n            user_id=current_user.user_id,\n            is_admin=current_user.is_admin,\n            created_date=date,\n        )\n    except Exception:\n        raise HTTPException(status_code=500, detail=\"Failed to get gallery item names for date\")\n","sourceCodeStart":78,"sourceCodeEnd":97,"githubUrl":"https://github.com/invoke-ai/InvokeAI/blob/0b6a024f2ff6a86bfb953dcdb9cc504ef7397a06/invokeai/app/api/routers/virtual_boards.py#L78-L97","documentation":"HTTP 500 raised by list_virtual_board_item_names_by_date when the gallery item query for a given created_date fails. Like its sibling routes, any exception becomes HTTPException(500, detail='Failed to get gallery item names for date'), hiding the root cause.","triggerScenarios":"GET /api/v1/virtual_boards/by_date/{date}/item_names when the gallery service query with search_term/user_id/created_date filters raises (DB error, invalid date, bad filter).","commonSituations":"Invalid or unusual date formats; overly broad search_term causing slow queries/timeouts; multiuser permission columns missing from schema; DB lock or connection failure.","solutions":["Validate the date path segment is a parseable ISO date","Retry without search_term to check whether the search filter is the trigger","Inspect server logs for the pre-HTTPException traceback","Confirm DB health and that gallery item tables are migrated"],"exampleFix":"// before\nreq(base + '/api/v1/virtual_boards/by_date/' + user_date + '/item_names')\n// after\nif re.fullmatch(r'\\d{4}-\\d{2}-\\d{2}', user_date):\n    req(base + f'/api/v1/virtual_boards/by_date/{user_date}/item_names')","handlingStrategy":"validation","validationCode":"const dateOk = /^\\d{4}-\\d{2}-\\d{2}$/.test(date);\nconst searchOk = !searchTerm || searchTerm.length <= 100;\nif (!dateOk || !searchOk) throw new Error('invalid date or search_term');","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Sanitize date inputs before constructing URLs","Keep search terms modest to avoid slow/timeout queries","Verify multiuser schema columns exist after upgrades"],"tags":["http-500","rest-api","gallery","invokeai"],"backgroundTag":"internal-server-error-500","analyzedSha":"0b6a024f2ff6a86bfb953dcdb9cc504ef7397a06","analyzedAt":"2026-08-29T04:46:49.967Z","schemaVersion":2},"datasetVersion":"2026-08-29T07:17:48.351Z"}