{"record":{"id":"c151fd4c7941c305","repo":"invoke-ai/InvokeAI","slug":"failed-to-create-board","errorCode":null,"errorMessage":"Failed to create board","messagePattern":"Failed to create board","errorType":"http","errorClass":"HTTPException","httpStatus":500,"severity":"error","filePath":"invokeai/app/api/routers/boards.py","lineNumber":61,"sourceCode":"@boards_router.post(\n    \"/\",\n    operation_id=\"create_board\",\n    responses={\n        201: {\"description\": \"The board was created successfully\"},\n    },\n    status_code=201,\n    response_model=BoardDTO,\n)\ndef create_board(\n    current_user: CurrentUserOrDefault,\n    board_name: str = Query(description=\"The name of the board to create\", max_length=300),\n) -> BoardDTO:\n    \"\"\"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 (","sourceCodeStart":43,"sourceCodeEnd":79,"githubUrl":"https://github.com/invoke-ai/InvokeAI/blob/0b6a024f2ff6a86bfb953dcdb9cc504ef7397a06/invokeai/app/api/routers/boards.py#L43-L79","documentation":"HTTP 500 from POST /boards/ (create_board) when the boards service create() call throws any exception. The router intentionally converts every non-HTTP error into this generic 500, so name conflicts, validation, or DB issues must be diagnosed from server logs.","triggerScenarios":"POST /boards/ with body {board_name} when ApiDependencies.invoker.services.boards.create throws — duplicate/over-long board_name rejected by storage, or database failure.","commonSituations":"Creating a board whose name already exists in a backend that enforces uniqueness, board_name exceeding DB column length, or SQLite/Postgres outage.","solutions":["Check server logs for the underlying exception","Retry with a different, shorter board_name (avoid duplicates)","Verify DB connectivity and schema migrations are current","Call GET /boards first to check for an existing board with the same name"],"exampleFix":"// before\nawait api.post('/boards/', { board_name: 'My Board' });\n// after\nconst existing = (await api.get('/boards/')).items.find(b => b.board_name === 'My Board');\nconst board = existing ?? await api.post('/boards/', { board_name: 'My Board' });","handlingStrategy":"try-catch","validationCode":"const boards = (await api.get('/boards/')).items;\nif (boards.some(b => b.board_name === desiredName)) throw new Error('board name already in use');","typeGuard":"const isServerError = (e) => e?.response?.status >= 500;","tryCatchPattern":"try {\n  return await api.post('/boards/', { board_name });\n} catch (e) {\n  if (isServerError(e)) throw new Error(`Create board failed — check invokeai server logs; name: ${board_name}`);\n  throw e;\n}","preventionTips":["Check for an existing board with the same name before creating","Keep board_name short and free of exotic characters","Ensure DB migrations are current after upgrading InvokeAI","Monitor DB connectivity in the server logs"],"tags":["http-500","api","boards","database"],"backgroundTag":"unexpected-internal-server-error","analyzedSha":"0b6a024f2ff6a86bfb953dcdb9cc504ef7397a06","analyzedAt":"2026-08-29T04:46:49.967Z","schemaVersion":2},"datasetVersion":"2026-08-29T07:17:48.351Z"}