{"record":{"id":"b186a7105d473ca3","repo":"SigNoz/signoz","slug":"invalid-s-s","errorCode":null,"errorMessage":"invalid %s: %s","messagePattern":"invalid (.+?): (.+?)","errorType":"http","errorClass":"model.ApiError","httpStatus":400,"severity":"error","filePath":"pkg/query-service/app/parser.go","lineNumber":532,"sourceCode":"func parseQBFilterSuggestionsRequest(r *http.Request) (\n\t*v3.QBFilterSuggestionsRequest, *model.ApiError,\n) {\n\tdataSource := v3.DataSource(r.URL.Query().Get(\"dataSource\"))\n\tif err := dataSource.Validate(); err != nil {\n\t\treturn nil, model.BadRequest(err)\n\t}\n\n\tparsePositiveIntQP := func(\n\t\tqueryParam string, defaultValue uint64, maxValue uint64,\n\t) (uint64, *model.ApiError) {\n\t\tvalue := defaultValue\n\n\t\tqpValue := r.URL.Query().Get(queryParam)\n\t\tif len(qpValue) > 0 {\n\t\t\tvalue, err := strconv.Atoi(qpValue)\n\n\t\t\tif err != nil || value < 1 || value > int(maxValue) {\n\t\t\t\treturn 0, model.BadRequest(fmt.Errorf(\n\t\t\t\t\t\"invalid %s: %s\", queryParam, qpValue,\n\t\t\t\t))\n\t\t\t}\n\t\t}\n\n\t\treturn value, nil\n\t}\n\n\tattributesLimit, err := parsePositiveIntQP(\n\t\t\"attributesLimit\",\n\t\tbaseconstants.DefaultFilterSuggestionsAttributesLimit,\n\t\tbaseconstants.MaxFilterSuggestionsAttributesLimit,\n\t)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\texamplesLimit, err := parsePositiveIntQP(","sourceCodeStart":514,"sourceCodeEnd":550,"githubUrl":"https://github.com/SigNoz/signoz/blob/5069bf80b08f1f00d7e014eccc09902f9871004f/pkg/query-service/app/parser.go#L514-L550","documentation":"A pagination/limit-type integer query parameter failed validation: it must parse as an integer and fall within [1, maxValue] for that parameter. This is a model.BadRequest (HTTP 400) wrapping the param name and offending value.","triggerScenarios":"Passing ?limit=0, ?limit=-5, ?limit=abc, or a limit above the max (e.g. >100) to endpoints using this helper (filter suggestions, etc.).","commonSituations":"Passing 0 meaning 'no limit'; passing an oversized page size; passing a float string like '2.5'.","solutions":["Send a positive integer within the allowed range for that parameter","Omit the parameter entirely to use the default","Check the endpoint docs or helper call site for the specific maxValue"],"exampleFix":"// before\n?limit=0\n// after\n?limit=10","handlingStrategy":"validation","validationCode":"v, err := strconv.Atoi(qpValue)\nif err != nil || v < 1 || v > int(maxValue) { return fmt.Errorf(\"%s must be an integer in [1,%d]\", qpValue, maxValue) }","typeGuard":"func isValidLimit(s string, max int) bool { v, err := strconv.Atoi(s); return err == nil && v >= 1 && v <= max }","tryCatchPattern":null,"preventionTips":["Clamp page sizes client-side to the documented max","Default limits instead of sending 0"],"tags":["signoz","pagination","integer-validation","bad-request"],"backgroundTag":"query-param-validation-failed","analyzedSha":"5069bf80b08f1f00d7e014eccc09902f9871004f","analyzedAt":"2026-08-28T06:22:12.824Z","schemaVersion":2},"datasetVersion":"2026-08-28T11:17:15.048Z"}