{"record":{"id":"f9fb973eda84dc05","repo":"vxcontrol/pentagi","slug":"resources-invalidrequest","errorCode":"Resources.InvalidRequest","errorMessage":"too many files: %d exceeds the limit of %d","messagePattern":"too many files: (.+?) exceeds the limit of (.+?)","errorType":"validation","errorClass":null,"httpStatus":400,"severity":"error","filePath":"backend/pkg/server/services/resources.go","lineNumber":273,"sourceCode":"\tif err != nil {\n\t\tlogger.FromContext(c).WithError(err).Error(\"error reading multipart form for resources upload\")\n\t\tresponse.Error(c, response.ErrResourcesInvalidRequest, err)\n\t\treturn\n\t}\n\n\tfileHeaders := multipartForm.File[\"files\"]\n\tif len(fileHeaders) == 0 {\n\t\tif fh, ferr := c.FormFile(\"file\"); ferr == nil && fh != nil {\n\t\t\tfileHeaders = append(fileHeaders, fh)\n\t\t}\n\t}\n\tif len(fileHeaders) == 0 {\n\t\tresponse.Error(c, response.ErrResourcesInvalidRequest, errors.New(\"at least one file is required\"))\n\t\treturn\n\t}\n\tif len(fileHeaders) > resources.MaxUploadFiles {\n\t\tresponse.Error(c, response.ErrResourcesInvalidRequest,\n\t\t\tfmt.Errorf(\"too many files: %d exceeds the limit of %d\", len(fileHeaders), resources.MaxUploadFiles))\n\t\treturn\n\t}\n\n\tif err := resources.EnsureResourcesDir(s.dataDir); err != nil {\n\t\tlogger.FromContext(c).WithError(err).Error(\"failed to ensure resources directory\")\n\t\tresponse.Error(c, response.ErrInternal, err)\n\t\treturn\n\t}\n\tblobsDir := resources.ResourcesDir(s.dataDir)\n\n\tvar totalSize int64\n\tpendingList := make([]pendingResourceUpload, 0, len(fileHeaders))\n\tseenPaths := make(map[string]struct{}, len(fileHeaders))\n\n\t// Phase 1: validate, stream to tmp, compute MD5.\n\tfor _, fh := range fileHeaders {\n\t\tname, err := resources.SanitizeResourceFileName(fh.Filename)\n\t\tif err != nil {","sourceCodeStart":255,"sourceCodeEnd":291,"githubUrl":"https://github.com/vxcontrol/pentagi/blob/ea665308baaff015b226f308438a68d929d0f29b/backend/pkg/server/services/resources.go#L255-L291","documentation":"Error \"too many files: %d exceeds the limit of %d\" thrown in vxcontrol/pentagi.","triggerScenarios":"Thrown at backend/pkg/server/services/resources.go:273 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"ea665308baaff015b226f308438a68d929d0f29b","analyzedAt":"2026-09-01T14:16:31.421Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}