{"record":{"id":"2b940fba935cc0a0","repo":"invoke-ai/InvokeAI","slug":"board-not-found-2b940f","errorCode":null,"errorMessage":"Board not found","messagePattern":"Board not found","errorType":"http","errorClass":"HTTPException","httpStatus":404,"severity":"warning","filePath":"invokeai/app/api/routers/boards.py","lineNumber":74,"sourceCode":"    \"\"\"Creates a board for the current user\"\"\"\n    try:\n        result = ApiDependencies.invoker.services.boards.create(board_name=board_name, user_id=current_user.user_id)\n        return result\n    except Exception:\n        raise HTTPException(status_code=500, detail=\"Failed to create board\")\n\n\n@boards_router.get(\"/{board_id}\", operation_id=\"get_board\", response_model=BoardDTO)\ndef get_board(\n    current_user: CurrentUserOrDefault,\n    board_id: str = Path(description=\"The id of board to get\"),\n) -> BoardDTO:\n    \"\"\"Gets a board (user must have access to it)\"\"\"\n\n    try:\n        result = 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    # Admins can access any board.\n    # Owners can access their own boards.\n    # Shared and public boards are visible to all authenticated users.\n    if (\n        not current_user.is_admin\n        and result.user_id != current_user.user_id\n        and result.board_visibility == BoardVisibility.Private\n    ):\n        raise HTTPException(status_code=403, detail=\"Not authorized to access this board\")\n\n    return result\n\n\n@boards_router.patch(\n    \"/{board_id}\",\n    operation_id=\"update_board\",\n    responses={","sourceCodeStart":56,"sourceCodeEnd":92,"githubUrl":"https://github.com/invoke-ai/InvokeAI/blob/0b6a024f2ff6a86bfb953dcdb9cc504ef7397a06/invokeai/app/api/routers/boards.py#L56-L92","documentation":"HTTP 404 returned by GET /boards/{board_id} when boards.get_dto cannot find the board. Because the router swallows every exception into 404, this also fires for backend DB errors, not just genuinely missing boards.","triggerScenarios":"GET /boards/{board_id} with a board_id that was deleted, never existed, or comes from a stale/cached reference; also raised when the underlying service throws any exception (e.g. DB down).","commonSituations":"Frontend holding a board id after the board was deleted elsewhere, copied URL from another install/database, or id typo in scripts; also hits after switching the data directory.","solutions":["List boards via GET /boards/ and confirm the board_id exists","Refresh the UI/urls — the board was likely deleted concurrently","Check the board_id for typos or cross-install mixing","If server logs show a DB error rather than 'not found', fix connectivity/migrations"],"exampleFix":"// before\nconst board = await api.get(`/boards/${boardId}`);\n// after\ntry {\n  const board = await api.get(`/boards/${boardId}`);\n} catch (e) {\n  if (e.response?.status === 404) return refetchBoardList(); // stale id\n  throw e;\n}","handlingStrategy":"try-catch","validationCode":"const known = (await api.get('/boards/')).items.map(b => b.board_id);\nif (!known.includes(boardId)) throw new Error(`stale board id: ${boardId}`);","typeGuard":"const isNotFound = (e) => e?.response?.status === 404;","tryCatchPattern":"try {\n  return await api.get(`/boards/${boardId}`);\n} catch (e) {\n  if (isNotFound(e)) return null; // stale/deleted board — refresh list\n  if (e.response?.status === 403) throw new Error('board is private; request access');\n  throw e;\n}","preventionTips":["Re-fetch board lists instead of caching ids long-term","Expect 404 after concurrent deletions in multi-user setups","Never mix board ids across separate InvokeAI installs/databases","Distinguish 404 (missing) from 403 (private) when handling"],"tags":["http-404","api","boards","stale-reference"],"backgroundTag":"resource-not-found","analyzedSha":"0b6a024f2ff6a86bfb953dcdb9cc504ef7397a06","analyzedAt":"2026-08-29T04:46:49.967Z","schemaVersion":2},"datasetVersion":"2026-08-29T07:17:48.351Z"}