{"record":{"id":"cdcf5ad392b65526","repo":"mattermost-community/focalboard","slug":"request-entity-too-large","errorCode":null,"errorMessage":"request entity too large","messagePattern":"request entity too large","errorType":"http","errorClass":null,"httpStatus":413,"severity":"warning","filePath":"server/model/error.go","lineNumber":26,"sourceCode":"\t\"strings\"\n\n\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 {","sourceCodeStart":8,"sourceCodeEnd":44,"githubUrl":"https://github.com/mattermost-community/focalboard/blob/a84bbb65e32edf972856b329417096ac413518e9/server/model/error.go#L8-L44","documentation":"ErrRequestEntityTooLarge indicates the uploaded file or request body exceeds the allowed size limit. handleUploadFile returns it when an uploaded file exceeds the configured MaxFileSize, and errorResponse translates it to HTTP 413. It protects the server from oversized uploads.","triggerScenarios":"POST /api/v1/boards/{boardID}/files (handleUploadFile) with a file larger than the server's MaxFileSize setting; any handler routing through errorResponse that detects an oversized entity.","commonSituations":"Uploading large design files/videos to cards; server MaxFileSize lowered or plugin proxy limits (proxy_* settings) smaller than expected; reverse proxies with their own body-size caps (client_max_body_size).","solutions":["Reduce the file size or compress it before uploading","Increase service settings (ServiceSettings.MaxFileSize and any proxy/file limits) in config.json and restart","Check intermediary proxies (nginx client_max_body_size) match the app limit"],"exampleFix":"// before\nmaxFileSize := 5 * 1024 * 1024\n// after\n// config.json\n\"ServiceSettings\": { \"MaxFileSize\": 52428800 }","handlingStrategy":"validation","validationCode":"file, header, err := r.FormFile(\"file\")\nif err == nil && header.Size > maxFileSize {\n    http.Error(w, \"file too large\", http.StatusRequestEntityTooLarge)\n    return\n}","typeGuard":"func isEntityTooLargeErr(err error) bool {\n    return errors.Is(err, model.ErrRequestEntityTooLarge)\n}","tryCatchPattern":"err := app.HandleUploadFile(...)\nif errors.Is(err, model.ErrRequestEntityTooLarge) {\n    http.Error(w, err.Error(), http.StatusRequestEntityTooLarge)\n    return\n}","preventionTips":["Check file size client-side before upload","Keep ServiceSettings.MaxFileSize and proxy limits aligned","Compress large assets before attaching to cards"],"tags":["go","upload","size-limit","http-413"],"backgroundTag":"request-entity-too-large","analyzedSha":"a84bbb65e32edf972856b329417096ac413518e9","analyzedAt":"2026-08-30T09:22:20.720Z","schemaVersion":2},"datasetVersion":"2026-08-30T13:17:10.514Z"}