{"record":{"id":"853f9d19e1e2488f","repo":"mattermost-community/focalboard","slug":"could-not-get-history-for-board-w","errorCode":null,"errorMessage":"could not get history for board: %w","messagePattern":"could not get history for board: %w","errorType":"error_code","errorClass":null,"httpStatus":null,"severity":"error","filePath":"server/app/boards.go","lineNumber":98,"sourceCode":"\t\treturn nil, fmt.Errorf(\"cannot get block %s: %w\", blockID, err)\n\t}\n\n\tboard, err := a.GetBoard(block.BoardID)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"cannot get board %s: %w\", block.BoardID, err)\n\t}\n\n\treturn board, nil\n}\n\nfunc (a *App) getBoardHistory(boardID string, latest bool) (*model.Board, error) {\n\topts := model.QueryBoardHistoryOptions{\n\t\tLimit:      1,\n\t\tDescending: latest,\n\t}\n\tboards, err := a.store.GetBoardHistory(boardID, opts)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"could not get history for board: %w\", err)\n\t}\n\tif len(boards) == 0 {\n\t\treturn nil, nil\n\t}\n\n\treturn boards[0], nil\n}\n\nfunc (a *App) getBoardDescendantModifiedInfo(boardID string, latest bool) (int64, string, error) {\n\tboard, err := a.getBoardHistory(boardID, latest)\n\tif err != nil {\n\t\treturn 0, \"\", err\n\t}\n\tif board == nil {\n\t\treturn 0, \"\", fmt.Errorf(\"history not found for board: %w\", err)\n\t}\n\n\tvar timestamp int64","sourceCodeStart":80,"sourceCodeEnd":116,"githubUrl":"https://github.com/mattermost-community/focalboard/blob/a84bbb65e32edf972856b329417096ac413518e9/server/app/boards.go#L80-L116","documentation":"getBoardHistory reads the board's history entries via store.GetBoardHistory with a limit of 1 (first or latest revision). This error wraps any failure of that store call under a contextual message. Callers are GetBoardMetadata and getBoardDescendantModifiedInfo, so this surfaces when computing board metadata or last-modified info.","triggerScenarios":"Calling GetBoardMetadata (or code paths reaching getBoardHistory) where store.GetBoardHistory errors: malformed boardID, database query failure, or a backing store that does not support board history.","commonSituations":"Databases migrated without the history tables/collections populated or created; permission-filtered store returning an error; transient DB outages while loading board metadata.","solutions":["Check the wrapped cause for store/database errors and confirm the board history table/collection exists.","Verify the boardID is valid before calling metadata APIs.","Retry on transient database errors.","If using a plugin/custom store implementation, confirm GetBoardHistory is implemented."],"exampleFix":null,"handlingStrategy":"retry","validationCode":"if boardID == \"\" {\n    return errors.New(\"cannot read board history: empty boardID\")\n}\nif _, err := app.GetBoard(boardID); err != nil {\n    return fmt.Errorf(\"board %s invalid before history query: %w\", boardID, err)\n}","typeGuard":null,"tryCatchPattern":"meta, err := app.GetBoardMetadata(boardID, latest)\nif err != nil {\n    if strings.Contains(err.Error(), \"could not get history for board\") && isTransient(err) {\n        time.Sleep(backoff)\n        meta, err = app.GetBoardMetadata(boardID, latest) // retry once\n    }\n    if err != nil {\n        return err\n    }\n}","preventionTips":["Keep board-history tables/collections included in migrations and backups.","Validate boardIDs before metadata calls.","Monitor database health; this error usually mirrors a store-level failure."],"tags":["history","board","store","wrapped-error"],"backgroundTag":"history-lookup-failed","analyzedSha":"a84bbb65e32edf972856b329417096ac413518e9","analyzedAt":"2026-08-30T09:22:20.720Z","schemaVersion":2},"datasetVersion":"2026-08-30T13:17:10.514Z"}