SigNoz/signoz · error

max limit exceeded

Error message

max limit exceeded

What it means

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.

Source

Thrown at pkg/query-service/app/querier/querier.go:346

		for i, j := 0, len(tsRanges)-1; i < j; i, j = i+1, j-1 {
			tsRanges[i], tsRanges[j] = tsRanges[j], tsRanges[i]
		}
	}

	// check if it is a logs query
	isLogs := false
	if params.CompositeQuery.BuilderQueries[qName].DataSource == v3.DataSourceLogs {
		isLogs = true
	}

	data := []*v3.Row{}

	limitWithOffset := limit + offset
	if isLogs {
		// for logs we use pageSize to define the current limit and limit to define the absolute limit
		limitWithOffset = pageSize + offset
		if limit > 0 && offset >= limit {
			return nil, nil, fmt.Errorf("max limit exceeded")
		}
	}

	for _, v := range tsRanges {
		params.Start = v.Start
		params.End = v.End
		length := uint64(0)

		// max limit + offset is 10k for pagination for traces/logs
		// TODO(nitya): define something for logs
		if !isLogs && limitWithOffset > constants.TRACE_V4_MAX_PAGINATION_LIMIT {
			return nil, nil, fmt.Errorf("maximum traces that can be paginated is 10000")
		}

		// we are updating the offset and limit based on the number of traces/logs we have found in the current timerange
		// eg -
		// 1)offset = 0, limit = 100, tsRanges = [t1, t10], [t10, 20], [t20, t30]
		//

View on GitHub (pinned to 5069bf80b0)

Solutions

  1. Reset the offset to 0 whenever filters, time range, or query change
  2. Keep offset < limit: derive offset as (page-1)*pageSize and clamp so it stays below the absolute limit
  3. Raise the absolute limit if deeper pagination is genuinely required

Example fix

// before
params.Offset = 1000; params.Limit = 1000
// after
if params.Offset >= params.Limit {
    params.Offset = 0
    params.Limit = 1000
}
Defensive patterns

Strategy: validation

Validate before calling

if params.CompositeQuery.PanelType == v3.PanelTypeList && isLogs(params) {
    if params.Offset >= params.Limit {
        params.Offset = 0 // reset pagination
    }
}

Type guard

func validLogPagination(limit, offset uint64) bool { return limit == 0 || offset < limit }

Prevention

When it happens

Trigger: 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.

Common situations: 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.

Related errors


AI-assisted analysis of SigNoz/signoz@5069bf80b0 (2026-08-28). Data as JSON: /api/errors/654d8c84d1242d9f. Report an issue: GitHub.