{"record":{"id":"81a78d716e9ee6ed","repo":"mattermost-community/focalboard","slug":"invalid-board-search-field","errorCode":null,"errorMessage":"invalid board search field","messagePattern":"invalid board search field","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"server/model/error.go","lineNumber":28,"sourceCode":"\tmmModel \"github.com/mattermost/mattermost/server/public/model\"\n\n\tpluginapi \"github.com/mattermost/mattermost/server/public/pluginapi\"\n)\n\nvar (\n\tErrViewsLimitReached        = errors.New(\"views limit reached for board\")\n\tErrPatchUpdatesLimitedCards = errors.New(\"patch updates cards that are limited\")\n\n\tErrInsufficientLicense = errors.New(\"appropriate license required\")\n\n\tErrCategoryPermissionDenied = errors.New(\"category doesn't belong to user\")\n\tErrCategoryDeleted          = errors.New(\"category is deleted\")\n\n\tErrBoardMemberIsLastAdmin = errors.New(\"cannot leave a board with no admins\")\n\n\tErrRequestEntityTooLarge = errors.New(\"request entity too large\")\n\n\tErrInvalidBoardSearchField = errors.New(\"invalid board search field\")\n)\n\n// ErrNotFound is an error type that can be returned by store APIs\n// when a query unexpectedly fetches no records.\ntype ErrNotFound struct {\n\tentity string\n}\n\n// NewErrNotFound creates a new ErrNotFound instance.\nfunc NewErrNotFound(entity string) *ErrNotFound {\n\treturn &ErrNotFound{\n\t\tentity: entity,\n\t}\n}\n\nfunc (nf *ErrNotFound) Error() string {\n\treturn fmt.Sprintf(\"{%s} not found\", nf.entity)\n}","sourceCodeStart":10,"sourceCodeEnd":46,"githubUrl":"https://github.com/mattermost-community/focalboard/blob/a84bbb65e32edf972856b329417096ac413518e9/server/model/error.go#L10-L46","documentation":"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.","triggerScenarios":"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.","commonSituations":"API clients hardcoding field names that changed between versions; custom scripts searching by fields not in the allowlist; case-sensitivity mistakes in field names.","solutions":["Use one of the supported search field constants (e.g. title) exactly as defined","Check the model package for the current list of valid BoardSearchField values","Update client code to match your server's Boards version"],"exampleFix":"// before\nfield, err := model.BoardSearchFieldFromString(\"titel\")\n// after\nfield, err := model.BoardSearchFieldFromString(\"title\")","handlingStrategy":"validation","validationCode":"field, err := model.BoardSearchFieldFromString(userInput)\nif err != nil {\n    return fmt.Errorf(\"unsupported search field %q\", userInput)\n}","typeGuard":"func isInvalidSearchFieldErr(err error) bool {\n    return errors.Is(err, model.ErrInvalidBoardSearchField)\n}","tryCatchPattern":"field, err := model.BoardSearchFieldFromString(name)\nif errors.Is(err, model.ErrInvalidBoardSearchField) {\n    return model.BoardSearchFieldTitle // default safely\n}","preventionTips":["Only pass field constants from the model package, never raw user input","Keep client and server Boards versions in sync","Whitelist searchable fields in API layers"],"tags":["go","validation","search","bad-request"],"backgroundTag":"invalid-search-field","analyzedSha":"a84bbb65e32edf972856b329417096ac413518e9","analyzedAt":"2026-08-30T09:22:20.720Z","schemaVersion":2},"datasetVersion":"2026-08-30T13:17:10.514Z"}