{"record":{"id":"654d8c84d1242d9f","repo":"SigNoz/signoz","slug":"max-limit-exceeded","errorCode":null,"errorMessage":"max limit exceeded","messagePattern":"max limit exceeded","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/query-service/app/querier/querier.go","lineNumber":346,"sourceCode":"\t\tfor i, j := 0, len(tsRanges)-1; i < j; i, j = i+1, j-1 {\n\t\t\ttsRanges[i], tsRanges[j] = tsRanges[j], tsRanges[i]\n\t\t}\n\t}\n\n\t// check if it is a logs query\n\tisLogs := false\n\tif params.CompositeQuery.BuilderQueries[qName].DataSource == v3.DataSourceLogs {\n\t\tisLogs = true\n\t}\n\n\tdata := []*v3.Row{}\n\n\tlimitWithOffset := limit + offset\n\tif isLogs {\n\t\t// for logs we use pageSize to define the current limit and limit to define the absolute limit\n\t\tlimitWithOffset = pageSize + offset\n\t\tif limit > 0 && offset >= limit {\n\t\t\treturn nil, nil, fmt.Errorf(\"max limit exceeded\")\n\t\t}\n\t}\n\n\tfor _, v := range tsRanges {\n\t\tparams.Start = v.Start\n\t\tparams.End = v.End\n\t\tlength := uint64(0)\n\n\t\t// max limit + offset is 10k for pagination for traces/logs\n\t\t// TODO(nitya): define something for logs\n\t\tif !isLogs && limitWithOffset > constants.TRACE_V4_MAX_PAGINATION_LIMIT {\n\t\t\treturn nil, nil, fmt.Errorf(\"maximum traces that can be paginated is 10000\")\n\t\t}\n\n\t\t// we are updating the offset and limit based on the number of traces/logs we have found in the current timerange\n\t\t// eg -\n\t\t// 1)offset = 0, limit = 100, tsRanges = [t1, t10], [t10, 20], [t20, t30]\n\t\t//","sourceCodeStart":328,"sourceCodeEnd":364,"githubUrl":"https://github.com/SigNoz/signoz/blob/5069bf80b08f1f00d7e014eccc09902f9871004f/pkg/query-service/app/querier/querier.go#L328-L364","documentation":"Returned by runWindowBasedListQuery when paginating logs list queries: the requested offset has reached or exceeded the absolute limit. For logs, pageSize defines the per-request limit and limit the absolute cap, so offset >= limit means you have paged past all allowed rows.","triggerScenarios":"Calling QueryRange with a logs List panel where the pagination offset >= the absolute limit (e.g. limit=1000 and offset=1000), typically after repeatedly clicking 'next page' in the logs explorer.","commonSituations":"Deep pagination in the logs UI beyond the configured absolute limit, client code computing offset cumulatively and forgetting it is capped by limit, stale offset retained after changing filters/time range.","solutions":["Reset the offset to 0 whenever filters, time range, or query change","Keep offset < limit: derive offset as (page-1)*pageSize and clamp so it stays below the absolute limit","Raise the absolute limit if deeper pagination is genuinely required"],"exampleFix":"// before\nparams.Offset = 1000; params.Limit = 1000\n// after\nif params.Offset >= params.Limit {\n    params.Offset = 0\n    params.Limit = 1000\n}","handlingStrategy":"validation","validationCode":"if params.CompositeQuery.PanelType == v3.PanelTypeList && isLogs(params) {\n    if params.Offset >= params.Limit {\n        params.Offset = 0 // reset pagination\n    }\n}","typeGuard":"func validLogPagination(limit, offset uint64) bool { return limit == 0 || offset < limit }","tryCatchPattern":null,"preventionTips":["Reset offset when filters or time range change","Clamp offset to limit-1 in pagination UI logic"],"tags":["logs","pagination","offset","limit"],"backgroundTag":"pagination-limit-exceeded","analyzedSha":"5069bf80b08f1f00d7e014eccc09902f9871004f","analyzedAt":"2026-08-28T06:22:12.824Z","schemaVersion":2},"datasetVersion":"2026-08-28T11:17:15.048Z"}