mattermost-community/focalboard · error
could not get history for board: %w
Error message
could not get history for board: %w
What it means
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.
Source
Thrown at server/app/boards.go:98
return nil, fmt.Errorf("cannot get block %s: %w", blockID, err)
}
board, err := a.GetBoard(block.BoardID)
if err != nil {
return nil, fmt.Errorf("cannot get board %s: %w", block.BoardID, err)
}
return board, nil
}
func (a *App) getBoardHistory(boardID string, latest bool) (*model.Board, error) {
opts := model.QueryBoardHistoryOptions{
Limit: 1,
Descending: latest,
}
boards, err := a.store.GetBoardHistory(boardID, opts)
if err != nil {
return nil, fmt.Errorf("could not get history for board: %w", err)
}
if len(boards) == 0 {
return nil, nil
}
return boards[0], nil
}
func (a *App) getBoardDescendantModifiedInfo(boardID string, latest bool) (int64, string, error) {
board, err := a.getBoardHistory(boardID, latest)
if err != nil {
return 0, "", err
}
if board == nil {
return 0, "", fmt.Errorf("history not found for board: %w", err)
}
var timestamp int64View on GitHub (pinned to a84bbb65e3)
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.
Defensive patterns
Strategy: retry
Validate before calling
if boardID == "" {
return errors.New("cannot read board history: empty boardID")
}
if _, err := app.GetBoard(boardID); err != nil {
return fmt.Errorf("board %s invalid before history query: %w", boardID, err)
} Try / catch
meta, err := app.GetBoardMetadata(boardID, latest)
if err != nil {
if strings.Contains(err.Error(), "could not get history for board") && isTransient(err) {
time.Sleep(backoff)
meta, err = app.GetBoardMetadata(boardID, latest) // retry once
}
if err != nil {
return err
}
} Prevention
- 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.
When it happens
Trigger: 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.
Common situations: Databases migrated without the history tables/collections populated or created; permission-filtered store returning an error; transient DB outages while loading board metadata.
Related errors
- could not get blocks history descendants for board: %w
- cannot get board %s: %w
- %w userID: %s
- cannot fetch board %s for DuplicateBlock: %w
- cannot get block %s: %w
AI-assisted analysis of mattermost-community/focalboard@a84bbb65e3 (2026-08-30).
Data as JSON: /api/errors/853f9d19e1e2488f.
Report an issue: GitHub.