{"record":{"id":"251397212f016bd8","repo":"invoke-ai/InvokeAI","slug":"failed-to-delete-board","errorCode":null,"errorMessage":"Failed to delete board","messagePattern":"Failed to delete board","errorType":"http","errorClass":"HTTPException","httpStatus":500,"severity":"error","filePath":"invokeai/app/api/routers/boards.py","lineNumber":204,"sourceCode":"                deleted_board_images=deleted_board_images,\n                deleted_images=[],\n                deleted_board_videos=deleted_board_videos,\n                deleted_videos=[],\n            )\n    except HTTPException:\n        raise\n    except Exception:\n        if include_images is True:\n            raise HTTPException(\n                status_code=500,\n                detail={\n                    \"message\": \"Failed to delete board after partially deleting media\",\n                    \"deleted_images\": deleted_images,\n                    \"deleted_videos\": deleted_videos,\n                    \"board_deleted\": False,\n                },\n            )\n        raise HTTPException(status_code=500, detail=\"Failed to delete board\")\n\n\n@boards_router.get(\n    \"/\",\n    operation_id=\"list_boards\",\n    response_model=Union[OffsetPaginatedResults[BoardDTO], list[BoardDTO]],\n)\ndef list_boards(\n    current_user: CurrentUserOrDefault,\n    order_by: BoardRecordOrderBy = Query(default=BoardRecordOrderBy.CreatedAt, description=\"The attribute to order by\"),\n    direction: SQLiteDirection = Query(default=SQLiteDirection.Descending, description=\"The direction to order by\"),\n    all: Optional[bool] = Query(default=None, description=\"Whether to list all boards\"),\n    offset: Optional[int] = Query(default=None, description=\"The page offset\"),\n    limit: Optional[int] = Query(default=None, description=\"The number of boards per page\"),\n    include_archived: bool = Query(default=False, description=\"Whether or not to include archived boards in list\"),\n) -> Union[OffsetPaginatedResults[BoardDTO], list[BoardDTO]]:\n    \"\"\"Gets a list of boards for the current user, including shared boards. Admin users see all boards.\"\"\"\n    if all:","sourceCodeStart":186,"sourceCodeEnd":222,"githubUrl":"https://github.com/invoke-ai/InvokeAI/blob/0b6a024f2ff6a86bfb953dcdb9cc504ef7397a06/invokeai/app/api/routers/boards.py#L186-L222","documentation":"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.","triggerScenarios":"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.","commonSituations":"Corrupted board record referencing nonexistent media; database out of space or locked; SQLite disk I/O error; InvokeAI version upgrade leaving schema incompatibilities.","solutions":["Check server logs for the underlying exception (the API only returns the generic detail)","Retry the delete; if persistent, inspect the boards table for corrupt rows for that board_id","Verify the database/storage backend is healthy and writable","Delete the board's images first (include_images=true) then the board, to isolate the failing step"],"exampleFix":"null","handlingStrategy":"try-catch","validationCode":"// verify board exists and backend healthy before delete\nconst board = await getBoard(boardId); // throws 404 early if already gone","typeGuard":"const isBoardDeleteFailure = (e) =>\n  e?.response?.status === 500 && e?.response?.data?.detail === 'Failed to delete board';","tryCatchPattern":"try {\n  await api.delete(`/boards/${boardId}`);\n} catch (e) {\n  if (isBoardDeleteFailure(e)) {\n    logServerError(e); // inspect server logs for root cause\n    await retryWithBackoff(() => api.delete(`/boards/${boardId}`));\n  } else throw e;\n}","preventionTips":["Check server logs; the HTTP detail hides the underlying exception","Keep database migrations current when upgrading InvokeAI","Delete board media first if plain board delete repeatedly fails"],"tags":["http-500","boards","database"],"backgroundTag":"server-internal-error","analyzedSha":"0b6a024f2ff6a86bfb953dcdb9cc504ef7397a06","analyzedAt":"2026-08-29T04:46:49.967Z","schemaVersion":2},"datasetVersion":"2026-08-29T07:17:48.351Z"}