{"record":{"id":"b67f2cb4ffd78722","repo":"invoke-ai/InvokeAI","slug":"failed-to-update-board","errorCode":null,"errorMessage":"Failed to update board","messagePattern":"Failed to update board","errorType":"http","errorClass":"HTTPException","httpStatus":500,"severity":"error","filePath":"invokeai/app/api/routers/boards.py","lineNumber":118,"sourceCode":"def update_board(\n    current_user: CurrentUserOrDefault,\n    board_id: str = Path(description=\"The id of board to update\"),\n    changes: BoardChanges = Body(description=\"The changes to apply to the board\"),\n) -> BoardDTO:\n    \"\"\"Updates a board (user must have access to it)\"\"\"\n    try:\n        board = ApiDependencies.invoker.services.boards.get_dto(board_id=board_id)\n    except Exception:\n        raise HTTPException(status_code=404, detail=\"Board not found\")\n\n    if not current_user.is_admin and board.user_id != current_user.user_id:\n        raise HTTPException(status_code=403, detail=\"Not authorized to update this board\")\n\n    try:\n        result = ApiDependencies.invoker.services.boards.update(board_id=board_id, changes=changes)\n        return result\n    except Exception:\n        raise HTTPException(status_code=500, detail=\"Failed to update board\")\n\n\n@boards_router.delete(\"/{board_id}\", operation_id=\"delete_board\", response_model=DeleteBoardResult)\ndef delete_board(\n    current_user: CurrentUserOrDefault,\n    board_id: str = Path(description=\"The id of board to delete\"),\n    include_images: Optional[bool] = Query(\n        description=\"Permanently delete all images and videos on the board\", default=False\n    ),\n) -> DeleteBoardResult:\n    \"\"\"Deletes a board (user must have access to it)\"\"\"\n    try:\n        board = ApiDependencies.invoker.services.boards.get_dto(board_id=board_id)\n    except Exception:\n        raise HTTPException(status_code=404, detail=\"Board not found\")\n\n    if not current_user.is_admin and board.user_id != current_user.user_id:\n        raise HTTPException(status_code=403, detail=\"Not authorized to delete this board\")","sourceCodeStart":100,"sourceCodeEnd":136,"githubUrl":"https://github.com/invoke-ai/InvokeAI/blob/0b6a024f2ff6a86bfb953dcdb9cc504ef7397a06/invokeai/app/api/routers/boards.py#L100-L136","documentation":"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.","triggerScenarios":"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.","commonSituations":"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).","solutions":["Check server logs for the update exception","Validate the changes payload: reasonable board_name length, existing cover_image_name","Retry with a minimal payload (e.g. only board_name) to isolate the offending field","Confirm DB is writable (disk space, locks, migrations)"],"exampleFix":"// before\nawait api.patch(`/boards/${id}`, { board_name: name, cover_image_name: img });\n// after\nconst trimmed = { board_name: name.slice(0, 100) };\nif (img) trimmed.cover_image_name = img; // ensure image exists first\nawait api.patch(`/boards/${id}`, trimmed);","handlingStrategy":"try-catch","validationCode":"if (changes.board_name && changes.board_name.length > 100) throw new Error('board_name too long');\nif (changes.cover_image_name) await api.get(`/images/${changes.cover_image_name}/metadata`); // 404 if invalid","typeGuard":"const isServerError = (e) => e?.response?.status >= 500;","tryCatchPattern":"try {\n  return await api.patch(`/boards/${boardId}`, changes);\n} catch (e) {\n  if (isServerError(e)) {\n    console.error('board update failed; inspect server logs', changes);\n    // retry with minimal payload to isolate the bad field\n    return api.patch(`/boards/${boardId}`, { board_name: changes.board_name });\n  }\n  throw e;\n}","preventionTips":["Sanitize board_name (length, characters) before sending","Ensure cover_image_name refers to an existing image","Apply one field per PATCH when debugging","Keep the DB writable: monitor disk space and SQLite locks"],"tags":["http-500","api","boards","validation"],"backgroundTag":"unexpected-internal-server-error","analyzedSha":"0b6a024f2ff6a86bfb953dcdb9cc504ef7397a06","analyzedAt":"2026-08-29T04:46:49.967Z","schemaVersion":2},"datasetVersion":"2026-08-29T07:17:48.351Z"}