invoke-ai/InvokeAI · error · HTTPException

Failed to delete board

Error message

Failed to delete board

What it means

HTTP 500 raised by delete_board when a non-HTTPException occurs during board deletion with include_images not True, or as the generic failure path after the media-partial branch. It indicates the board service's delete operation threw an unexpected error and the board was not deleted.

Solutions

  1. Check server logs for the underlying exception (the API only returns the generic detail)
  2. Retry the delete; if persistent, inspect the boards table for corrupt rows for that board_id
  3. Verify the database/storage backend is healthy and writable
  4. Delete the board's images first (include_images=true) then the board, to isolate the failing step

Example fix

null
Defensive patterns

Strategy: try-catch

Validate before calling

// verify board exists and backend healthy before delete
const board = await getBoard(boardId); // throws 404 early if already gone

Type guard

const isBoardDeleteFailure = (e) =>
  e?.response?.status === 500 && e?.response?.data?.detail === 'Failed to delete board';

Try / catch

try {
  await api.delete(`/boards/${boardId}`);
} catch (e) {
  if (isBoardDeleteFailure(e)) {
    logServerError(e); // inspect server logs for root cause
    await retryWithBackoff(() => api.delete(`/boards/${boardId}`));
  } else throw e;
}

Prevention

When it happens

Trigger: DELETE /boards/{board_id} where the boards service (ApiDependencies.invoker.services.boards) raises, e.g. DB constraint violation, missing board files, or service misconfiguration, in the default include_images mode.

Common situations: Corrupted board record referencing nonexistent media; database out of space or locked; SQLite disk I/O error; InvokeAI version upgrade leaving schema incompatibilities.

Related errors


AI-assisted analysis of invoke-ai/InvokeAI@0b6a024f2f (2026-08-29). Data as JSON: /api/errors/251397212f016bd8. Report an issue: GitHub.

Appendix: source

Thrown at invokeai/app/api/routers/boards.py:204

                deleted_board_images=deleted_board_images,
                deleted_images=[],
                deleted_board_videos=deleted_board_videos,
                deleted_videos=[],
            )
    except HTTPException:
        raise
    except Exception:
        if include_images is True:
            raise HTTPException(
                status_code=500,
                detail={
                    "message": "Failed to delete board after partially deleting media",
                    "deleted_images": deleted_images,
                    "deleted_videos": deleted_videos,
                    "board_deleted": False,
                },
            )
        raise HTTPException(status_code=500, detail="Failed to delete board")


@boards_router.get(
    "/",
    operation_id="list_boards",
    response_model=Union[OffsetPaginatedResults[BoardDTO], list[BoardDTO]],
)
def list_boards(
    current_user: CurrentUserOrDefault,
    order_by: BoardRecordOrderBy = Query(default=BoardRecordOrderBy.CreatedAt, description="The attribute to order by"),
    direction: SQLiteDirection = Query(default=SQLiteDirection.Descending, description="The direction to order by"),
    all: Optional[bool] = Query(default=None, description="Whether to list all boards"),
    offset: Optional[int] = Query(default=None, description="The page offset"),
    limit: Optional[int] = Query(default=None, description="The number of boards per page"),
    include_archived: bool = Query(default=False, description="Whether or not to include archived boards in list"),
) -> Union[OffsetPaginatedResults[BoardDTO], list[BoardDTO]]:
    """Gets a list of boards for the current user, including shared boards. Admin users see all boards."""
    if all:

View on GitHub (pinned to 0b6a024f2f)