{"record":{"id":"f86cee18dc342585","repo":"invoke-ai/InvokeAI","slug":"board-not-found-f86cee","errorCode":null,"errorMessage":"Board not found","messagePattern":"Board not found","errorType":"http","errorClass":"HTTPException","httpStatus":404,"severity":"error","filePath":"invokeai/app/api/routers/videos.py","lineNumber":138,"sourceCode":"        return\n    owner = ApiDependencies.invoker.services.video_records.get_user_id(video_name)\n    if owner is not None and owner == current_user.user_id:\n        return\n    raise HTTPException(status_code=403, detail=\"Not authorized to move this video\")\n\n\ndef _assert_board_write_access(board_id: str, current_user: CurrentUserOrDefault) -> None:\n    \"\"\"Raise 403 if the current user may not mutate the given board.\n\n    Mirrors _assert_board_write_access in board_images.py: admins and the board owner\n    may write; public boards accept contributions from any user.\n    \"\"\"\n    from invokeai.app.services.board_records.board_records_common import BoardVisibility\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    if current_user.is_admin:\n        return\n    if board.user_id == current_user.user_id:\n        return\n    if board.board_visibility == BoardVisibility.Public:\n        return\n    raise HTTPException(status_code=403, detail=\"Not authorized to modify this board\")\n\n\ndef _assert_video_read_access(video_name: str, current_user: CurrentUserOrDefault) -> None:\n    \"\"\"Raise 403 if the current user may not view the video.\"\"\"\n    from invokeai.app.services.board_records.board_records_common import (\n        BoardRecordNotFoundException,\n        BoardVisibility,\n    )\n\n    if current_user.is_admin:\n        return","sourceCodeStart":120,"sourceCodeEnd":156,"githubUrl":"https://github.com/invoke-ai/InvokeAI/blob/0b6a024f2ff6a86bfb953dcdb9cc504ef7397a06/invokeai/app/api/routers/videos.py#L120-L156","documentation":"_assert_board_write_access looks up the board DTO and, if any exception occurs during lookup (e.g. BoardRecordNotFoundException), raises HTTP 404 \"Board not found\". Called before add_video_to_board / remove_video_from_board, it means the target board_id does not exist (or the board store lookup failed).","triggerScenarios":"POST/DELETE /api/v1/videos/{video}/board with a board_id that was deleted, never existed, is mistyped, or belongs to another database/instance.","commonSituations":"Client cached board IDs before a board was deleted; automation scripts with hardcoded board UUIDs; DB rebuilds regenerating board IDs; copy-pasted board IDs between installs.","solutions":["List current boards via GET /api/v1/boards/ and use a valid board_id","Recreate the board if it was deleted, then retry","Fix hardcoded board IDs in scripts after DB changes","Check the board-record store (sqlite) if the board exists in the UI but not via API lookup"],"exampleFix":"# before\nrequests.post(f\"{base}/api/v1/videos/{v}/board\", json={\"board_id\": stale_id})\n# after\nboards = requests.get(f\"{base}/api/v1/boards/\").json()\nboard_id = next(b[\"board_id\"] for b in boards if b[\"board_name\"] == \"My Board\")\nrequests.post(f\"{base}/api/v1/videos/{v}/board\", json={\"board_id\": board_id})","handlingStrategy":"validation","validationCode":"boards = requests.get(f\"{base}/api/v1/boards/\").json()\nassert any(b[\"board_id\"] == board_id for b in boards), f\"board {board_id} missing\"","typeGuard":null,"tryCatchPattern":"try:\n    requests.post(f\"{base}/api/v1/videos/{name}/board\", json={\"board_id\": board_id}).raise_for_status()\nexcept requests.HTTPError as e:\n    if e.response.status_code == 404:\n        board_id = pick_board_from_list()","preventionTips":["Refresh board IDs after any board deletion or DB rebuild","Never hardcode board UUIDs in scripts","Handle 404 by re-listing boards rather than retrying"],"tags":["http-404","board-not-found","api"],"backgroundTag":"resource-not-found","analyzedSha":"0b6a024f2ff6a86bfb953dcdb9cc504ef7397a06","analyzedAt":"2026-08-29T04:46:49.967Z","schemaVersion":2},"datasetVersion":"2026-08-29T07:17:48.351Z"}