invoke-ai/InvokeAI · error · HTTPException

Failed to update board

Error message

Failed to update board

What it means

HTTP 500 from PATCH /boards/{board_id} when the boards.update() service call throws after the board was successfully found and authorized. The generic handler hides the underlying storage/service error behind this message.

Source

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

def update_board(
    current_user: CurrentUserOrDefault,
    board_id: str = Path(description="The id of board to update"),
    changes: BoardChanges = Body(description="The changes to apply to the board"),
) -> BoardDTO:
    """Updates a board (user must have access to it)"""
    try:
        board = ApiDependencies.invoker.services.boards.get_dto(board_id=board_id)
    except Exception:
        raise HTTPException(status_code=404, detail="Board not found")

    if not current_user.is_admin and board.user_id != current_user.user_id:
        raise HTTPException(status_code=403, detail="Not authorized to update this board")

    try:
        result = ApiDependencies.invoker.services.boards.update(board_id=board_id, changes=changes)
        return result
    except Exception:
        raise HTTPException(status_code=500, detail="Failed to update board")


@boards_router.delete("/{board_id}", operation_id="delete_board", response_model=DeleteBoardResult)
def delete_board(
    current_user: CurrentUserOrDefault,
    board_id: str = Path(description="The id of board to delete"),
    include_images: Optional[bool] = Query(
        description="Permanently delete all images and videos on the board", default=False
    ),
) -> DeleteBoardResult:
    """Deletes a board (user must have access to it)"""
    try:
        board = ApiDependencies.invoker.services.boards.get_dto(board_id=board_id)
    except Exception:
        raise HTTPException(status_code=404, detail="Board not found")

    if not current_user.is_admin and board.user_id != current_user.user_id:
        raise HTTPException(status_code=403, detail="Not authorized to delete this board")

View on GitHub (pinned to 0b6a024f2f)

Solutions

  1. Check server logs for the update exception
  2. Validate the changes payload: reasonable board_name length, existing cover_image_name
  3. Retry with a minimal payload (e.g. only board_name) to isolate the offending field
  4. Confirm DB is writable (disk space, locks, migrations)

Example fix

// before
await api.patch(`/boards/${id}`, { board_name: name, cover_image_name: img });
// after
const trimmed = { board_name: name.slice(0, 100) };
if (img) trimmed.cover_image_name = img; // ensure image exists first
await api.patch(`/boards/${id}`, trimmed);
Defensive patterns

Strategy: try-catch

Validate before calling

if (changes.board_name && changes.board_name.length > 100) throw new Error('board_name too long');
if (changes.cover_image_name) await api.get(`/images/${changes.cover_image_name}/metadata`); // 404 if invalid

Type guard

const isServerError = (e) => e?.response?.status >= 500;

Try / catch

try {
  return await api.patch(`/boards/${boardId}`, changes);
} catch (e) {
  if (isServerError(e)) {
    console.error('board update failed; inspect server logs', changes);
    // retry with minimal payload to isolate the bad field
    return api.patch(`/boards/${boardId}`, { board_name: changes.board_name });
  }
  throw e;
}

Prevention

When it happens

Trigger: PATCH /boards/{board_id} with a BoardChanges body (e.g. invalid board_name length/content, invalid cover_image_name, or DB constraint violation) causing boards.update to raise.

Common situations: Renaming to a name exceeding DB limits or with characters the backend rejects, setting cover_image_name to a nonexistent image, or DB write failures (locked SQLite, full disk).

Related errors


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