{"record":{"id":"dcb7ece7cce23c7c","repo":"invoke-ai/InvokeAI","slug":"board-not-found","errorCode":null,"errorMessage":"Board not found","messagePattern":"Board not found","errorType":"http","errorClass":"HTTPException","httpStatus":404,"severity":"error","filePath":"invokeai/app/api/routers/_access.py","lineNumber":129,"sourceCode":"    _assert_image_record_exists(image_name)\n    raise HTTPException(status_code=403, detail=\"Not authorized to access this image\")\n\n\ndef assert_board_read_access(board_id: str, current_user: CurrentUserOrDefault) -> None:\n    \"\"\"Raise 403 if the current user may not read images from this board.\n\n    Access is granted when ANY of these hold:\n    - The user is an admin.\n    - The user owns the board.\n    - The board visibility is Shared or Public.\n    \"\"\"\n    if current_user.is_admin:\n        return\n\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 board.user_id == current_user.user_id:\n        return\n\n    if board.board_visibility in (BoardVisibility.Shared, BoardVisibility.Public):\n        return\n\n    raise HTTPException(status_code=403, detail=\"Not authorized to access this board\")\n","sourceCodeStart":111,"sourceCodeEnd":138,"githubUrl":"https://github.com/invoke-ai/InvokeAI/blob/0b6a024f2ff6a86bfb953dcdb9cc504ef7397a06/invokeai/app/api/routers/_access.py#L111-L138","documentation":"`assert_board_read_access` raises this 404 when the board DTO cannot be fetched from the boards service. Any exception during lookup — most commonly a nonexistent board_id — is translated into 'Board not found', so callers get a 404 rather than a 500 or a misleading 403.","triggerScenarios":"GET on board or board-images endpoints (/v1/boards/{board_id}, /v1/board_images/{board_id}) with a board_id absent from the database; also fires on storage errors during lookup because all exceptions are caught.","commonSituations":"A UI tab still open after the board was deleted; a hard-coded or copied board ID from another instance; a corrupted/transient database failure being masked as not-found.","solutions":["Verify the board_id is correct — list boards via GET /v1/boards/ and use an existing ID","Recreate the board if it was deleted; references to it cannot be restored automatically","Refresh the UI so it re-fetches the board list and drops stale references","If the board should exist and you suspect a storage error, check server logs/DB health — the blanket except can mask real failures"],"exampleFix":"// before\nawait fetch(`/v1/boards/${hardcodedBoardId}`); // 404\n// after\nconst boards = await fetch('/v1/boards/').then(r => r.json());\nconst id = boards.items.find(b => b.board_name === 'My Board').board_id;\nawait fetch(`/v1/boards/${id}`);","handlingStrategy":"try-catch","validationCode":"// Resolve board_id from the live board list instead of caching it\nconst boards = await fetch('/v1/boards/', {headers: authHeaders}).then(r => r.json());\nif (!boards.items.some(b => b.board_id === boardId)) throw new Error(`Board ${boardId} no longer exists`);","typeGuard":null,"tryCatchPattern":"try {\n  const board = await fetch(`/v1/boards/${boardId}`, {headers: authHeaders});\n  if (board.status === 404) throw new NotFoundError(boardId);\n  return await board.json();\n} catch (e) {\n  if (e instanceof NotFoundError) refreshBoardList(); // drop stale ID, re-select\n  else throw e;\n}","preventionTips":["Never hard-code board IDs; look them up by name at runtime","Refresh board lists after deletes and on app start","Handle 404 by re-selecting a board rather than retrying the same ID","If a valid board returns 404 unexpectedly, check server logs — the route maps all lookup exceptions to 404"],"tags":["http-404","board","not-found","deleted-resource"],"backgroundTag":"resource-not-found-404","analyzedSha":"0b6a024f2ff6a86bfb953dcdb9cc504ef7397a06","analyzedAt":"2026-08-29T04:46:49.967Z","schemaVersion":2},"datasetVersion":"2026-08-29T07:17:48.351Z"}