invoke-ai/InvokeAI · error · HTTPException
Failed to get image names for date
Error message
Failed to get image names for date
What it means
HTTP 500 raised by list_virtual_board_image_names_by_date when fetching image names for a specific date fails in the gallery service. Any underlying exception is masked as HTTPException(500, detail='Failed to get image names for date').
Source
Thrown at invokeai/app/api/routers/virtual_boards.py:62
search_term: str | None = Query(default=None, description="Search term to filter images"),
) -> ImageNamesResult:
"""Gets ordered image names for a specific date. Image-only.
Deprecated: use `GET /v1/gallery/item_names?created_date=<date>`, which covers images and
videos in one ordered list.
"""
try:
return ApiDependencies.invoker.services.image_records.get_image_names_by_date(
date=date,
starred_first=starred_first,
order_dir=order_dir,
categories=categories,
search_term=search_term,
user_id=current_user.user_id,
is_admin=current_user.is_admin,
)
except Exception:
raise HTTPException(status_code=500, detail="Failed to get image names for date")
@virtual_boards_router.get(
"/by_date/{date}/item_names",
operation_id="list_virtual_board_item_names_by_date",
response_model=GalleryItemNamesResult,
deprecated=True,
)
def list_virtual_board_item_names_by_date(
current_user: CurrentUserOrDefault,
date: str = Path(description="The ISO date string, e.g. '2026-03-18'"),
starred_first: bool = Query(default=True, description="Whether to sort starred items first"),
order_dir: SQLiteDirection = Query(default=SQLiteDirection.Descending, description="The sort direction"),
categories: list[ImageCategory] | None = Query(default=None, description="The categories of items to include"),
search_term: str | None = Query(default=None, description="Search term to filter items"),
) -> GalleryItemNamesResult:
"""Gets ordered polymorphic (image + video) item refs for a specific date.
View on GitHub (pinned to 0b6a024f2f)
Solutions
- Ensure the date path segment is a valid date string (e.g. 2024-01-15) the server can parse
- Drop the categories/search_term query params to isolate the failing filter
- Check server logs for the original exception to see the service-level cause
- Verify gallery DB tables exist and are migrated
Example fix
// before
requests.get(base + '/api/v1/virtual_boards/by_date/2024-13-45/image_names') # invalid date
// after
d = datetime.date(2024, 1, 15).isoformat()
requests.get(base + f'/api/v1/virtual_boards/by_date/{d}/image_names') Defensive patterns
Strategy: validation
Validate before calling
// validate the date path segment is ISO YYYY-MM-DD before calling
function isValidDate(s) {
if (!/^\d{4}-\d{2}-\d{2}$/.test(s)) return false;
const d = new Date(s + 'T00:00:00Z');
return !isNaN(d.getTime()) && d.toISOString().slice(0, 10) === s;
}
if (!isValidDate(date)) throw new Error(`bad date: ${date}`); Prevention
- Always send normalized ISO dates in the path
- Avoid exotic category/search filters until basic queries work
- Check server logs for the exception masked by the 500 detail
When it happens
Trigger: GET /api/v1/virtual_boards/by_date/{date}/image_names with an unparseable or out-of-range date, or when the underlying gallery query (categories/search_term filters) raises.
Common situations: Malformed date string in the path; filtering by categories that map to no valid column; DB errors on large galleries; timezone-parsing differences causing invalid date objects.
Related errors
- Failed to get virtual boards by date
- Failed to get gallery item names for date
- Failed to get video names
- Failed to add video to board
- Failed to remove video from board
AI-assisted analysis of invoke-ai/InvokeAI@0b6a024f2f (2026-08-29).
Data as JSON: /api/errors/67fe5d2a68703166.
Report an issue: GitHub.