invoke-ai/InvokeAI · error · HTTPException
Failed to remove video from board
Error message
Failed to remove video from board
What it means
HTTP 500 raised by remove_video_from_board when the board_video_records service fails to remove a video's board association. Any exception in ApiDependencies.invoker.services.board_video_records.remove_video_from_board is converted to HTTPException(500, detail='Failed to remove video from board').
Source
Thrown at invokeai/app/api/routers/videos.py:930
# board is Public). This mirrors remove_image_from_board and prevents a video from being
# stranded when a non-owner uploads into a Public board that is later made Shared/Private:
# without the board-write fallback, neither the uploader nor the board owner could
# detach the video. See PR #9163 review.
old_board_id = ApiDependencies.invoker.services.board_video_records.get_board_for_video(video_name)
try:
_assert_video_direct_owner(video_name, current_user)
except HTTPException:
if old_board_id is None:
raise
_assert_board_write_access(old_board_id, current_user)
try:
ApiDependencies.invoker.services.board_video_records.remove_video_from_board(video_name=video_name)
return RemoveVideosFromBoardResult(
removed_videos=[video_name],
affected_boards=list({old_board_id or "none", "none"}),
)
except Exception:
raise HTTPException(status_code=500, detail="Failed to remove video from board")
View on GitHub (pinned to 0b6a024f2f)
Solutions
- Retry — if the association is already gone the operation may be idempotent after the underlying fix
- Verify the video exists and check its current board membership first
- Check server logs for the wrapped exception to see the DB-level cause
- If the video record is orphaned, clean up board associations directly in the DB or via re-adding/removing
Example fix
// before
client.remove_video_from_board(video_name=v) # may 500 if already removed
// after
info = get_video_info(v)
if info.get('board_id'):
client.remove_video_from_board(video_name=v) Defensive patterns
Strategy: try-catch
Validate before calling
// check current board membership before removing
const info = await fetch(`${base}/api/v1/videos/${encodeURIComponent(videoName)}/urls`);
if (info.status === 404) throw new Error('video no longer exists; nothing to remove'); Try / catch
try {
const r = await fetch(`${base}/api/v1/videos/board`, { method: 'DELETE', body });
if (r.status === 500 && alreadyRemoved) return; // treat as idempotent success
if (!r.ok) throw new Error(await r.text());
} catch (e) { log(e); } Prevention
- Treat repeated removals as idempotent; guard against double-delete retries
- Verify the video exists before issuing the DELETE
- Check DB health if 500s cluster together
When it happens
Trigger: DELETE /api/v1/videos/board with a video_name that doesn't exist or whose board-record row cannot be deleted (DB error, constraint, missing row).
Common situations: Video already removed (double-delete from UI retry); video record deleted elsewhere so the association row is gone; database connectivity issues.
Related errors
- Failed to add video to board
- Failed to get video names
- Failed to get virtual boards by date
- Failed to get image names for date
- Failed to get gallery item names for date
AI-assisted analysis of invoke-ai/InvokeAI@0b6a024f2f (2026-08-29).
Data as JSON: /api/errors/155c9a1f74115c9f.
Report an issue: GitHub.