mattermost-community/focalboard · error

invalid board search field

Error message

invalid board search field

What it means

ErrInvalidBoardSearchField is returned when a search request specifies a board field name that is not a searchable/supported field. BoardSearchFieldFromString converts a string to a BoardSearchField enum and errors on unrecognized values. It is an input-validation error preventing arbitrary field injection into search queries.

Source

Thrown at server/model/error.go:28

	mmModel "github.com/mattermost/mattermost/server/public/model"

	pluginapi "github.com/mattermost/mattermost/server/public/pluginapi"
)

var (
	ErrViewsLimitReached        = errors.New("views limit reached for board")
	ErrPatchUpdatesLimitedCards = errors.New("patch updates cards that are limited")

	ErrInsufficientLicense = errors.New("appropriate license required")

	ErrCategoryPermissionDenied = errors.New("category doesn't belong to user")
	ErrCategoryDeleted          = errors.New("category is deleted")

	ErrBoardMemberIsLastAdmin = errors.New("cannot leave a board with no admins")

	ErrRequestEntityTooLarge = errors.New("request entity too large")

	ErrInvalidBoardSearchField = errors.New("invalid board search field")
)

// ErrNotFound is an error type that can be returned by store APIs
// when a query unexpectedly fetches no records.
type ErrNotFound struct {
	entity string
}

// NewErrNotFound creates a new ErrNotFound instance.
func NewErrNotFound(entity string) *ErrNotFound {
	return &ErrNotFound{
		entity: entity,
	}
}

func (nf *ErrNotFound) Error() string {
	return fmt.Sprintf("{%s} not found", nf.entity)
}

View on GitHub (pinned to a84bbb65e3)

Solutions

  1. Use one of the supported search field constants (e.g. title) exactly as defined
  2. Check the model package for the current list of valid BoardSearchField values
  3. Update client code to match your server's Boards version

Example fix

// before
field, err := model.BoardSearchFieldFromString("titel")
// after
field, err := model.BoardSearchFieldFromString("title")
Defensive patterns

Strategy: validation

Validate before calling

field, err := model.BoardSearchFieldFromString(userInput)
if err != nil {
    return fmt.Errorf("unsupported search field %q", userInput)
}

Type guard

func isInvalidSearchFieldErr(err error) bool {
    return errors.Is(err, model.ErrInvalidBoardSearchField)
}

Try / catch

field, err := model.BoardSearchFieldFromString(name)
if errors.Is(err, model.ErrInvalidBoardSearchField) {
    return model.BoardSearchFieldTitle // default safely
}

Prevention

When it happens

Trigger: Passing an unsupported field string to the boards search API or BoardSearchFieldFromString — e.g. a typo like 'titel' instead of 'title', or a field added in a newer version than the server supports.

Common situations: API clients hardcoding field names that changed between versions; custom scripts searching by fields not in the allowlist; case-sensitivity mistakes in field names.

Related errors


AI-assisted analysis of mattermost-community/focalboard@a84bbb65e3 (2026-08-30). Data as JSON: /api/errors/81a78d716e9ee6ed. Report an issue: GitHub.